Skip to content

Commit

Permalink
Re-generate cluster namespace (part 1) (#356)
Browse files Browse the repository at this point in the history
* Re-generate `cluster.allocation_explain`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.delete_component_template`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.delete_voting_config_exclusions`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.exists_component_template`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.get_component_template`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.get_settings`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.health`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-generate `cluster.pending_tasks`

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

---------

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia committed Oct 4, 2023
1 parent 1532724 commit f1df48d
Show file tree
Hide file tree
Showing 27 changed files with 1,910 additions and 1,040 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[Unreleased]: https://github.com/opensearch-project/opensearch-net/compare/v1.5.0...main
[1.5.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
9 changes: 9 additions & 0 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ public static class CodeConfiguration
{
private static readonly Glob[] OperationsToInclude =
{
new("cluster.allocation_explain"),
new("cluster.delete_component_template"),
new("cluster.delete_voting_config_exclusions"),
new("cluster.exists_component_template"),
new("cluster.get_component_template"),
new("cluster.get_settings"),
new("cluster.health"),
new("cluster.pending_tasks"),

new("dangling_indices.*"),
new("ingest.*"),
new("nodes.*"),
Expand Down
60 changes: 34 additions & 26 deletions src/ApiGenerator/OpenSearch.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11823,7 +11823,8 @@
"$ref": "#/components/schemas/PatchActionGroupsInputPayload"
}
}
}
},
"required": true
},
"responses": {
"200": {
Expand Down Expand Up @@ -11948,7 +11949,8 @@
"$ref": "#/components/schemas/PatchActionGroupInputPayload"
}
}
}
},
"required": true
},
"parameters": [
{
Expand Down Expand Up @@ -11989,7 +11991,8 @@
"$ref": "#/components/schemas/Action_Group"
}
}
}
},
"required": true
},
"parameters": [
{
Expand Down Expand Up @@ -13244,7 +13247,8 @@
"$ref": "#/components/schemas/CreateTenantParams"
}
}
}
},
"required": true
},
"parameters": [
{
Expand Down Expand Up @@ -17925,21 +17929,23 @@
"description": "Limit the information returned the specific metrics.",
"x-enum-options": [
"_all",
"completion",
"docs",
"fielddata",
"query_cache",
"flush",
"get",
"store",
"indexing",
"get",
"search",
"merge",
"request_cache",
"flush",
"refresh",
"search",
"segments",
"store",
"query_cache",
"fielddata",
"docs",
"warmer",
"suggest"
"completion",
"segments",
"translog",
"suggest",
"request_cache",
"recovery"
],
"x-data-type": "array"
},
Expand Down Expand Up @@ -28506,21 +28512,23 @@
"description": "Limit the information returned the specific metrics.",
"x-enum-options": [
"_all",
"completion",
"docs",
"fielddata",
"query_cache",
"flush",
"get",
"store",
"indexing",
"get",
"search",
"merge",
"request_cache",
"flush",
"refresh",
"search",
"segments",
"store",
"query_cache",
"fielddata",
"docs",
"warmer",
"suggest"
"completion",
"segments",
"translog",
"suggest",
"request_cache",
"recovery"
],
"x-data-type": "array"
},
Expand Down
5 changes: 0 additions & 5 deletions src/OpenSearch.Client/ApiUrlsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ internal static partial class ApiUrlsLookups
internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"});
internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"});
internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"});
internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[]{"_cluster/allocation/explain"});
internal static ApiUrls ClusterDeleteVotingConfigExclusions = new ApiUrls(new[]{"_cluster/voting_config_exclusions"});
internal static ApiUrls ClusterGetSettings = new ApiUrls(new[]{"_cluster/settings"});
internal static ApiUrls ClusterHealth = new ApiUrls(new[]{"_cluster/health", "_cluster/health/{index}"});
internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[]{"_cluster/pending_tasks"});
internal static ApiUrls ClusterPostVotingConfigExclusions = new ApiUrls(new[]{"_cluster/voting_config_exclusions"});
internal static ApiUrls ClusterPutSettings = new ApiUrls(new[]{"_cluster/settings"});
internal static ApiUrls ClusterRemoteInfo = new ApiUrls(new[]{"_remote/info"});
Expand Down
111 changes: 0 additions & 111 deletions src/OpenSearch.Client/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,117 +57,6 @@
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.ClusterApi
{
///<summary>Descriptor for AllocationExplain <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-allocation/</para></summary>
public partial class ClusterAllocationExplainDescriptor : RequestDescriptorBase<ClusterAllocationExplainDescriptor, ClusterAllocationExplainRequestParameters, IClusterAllocationExplainRequest>, IClusterAllocationExplainRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterAllocationExplain;
// values part of the url path
// Request parameters
///<summary>Return information about disk usage and shard sizes (default: false)</summary>
public ClusterAllocationExplainDescriptor IncludeDiskInfo(bool? includediskinfo = true) => Qs("include_disk_info", includediskinfo);
///<summary>Return 'YES' decisions in explanation (default: false)</summary>
public ClusterAllocationExplainDescriptor IncludeYesDecisions(bool? includeyesdecisions = true) => Qs("include_yes_decisions", includeyesdecisions);
}

///<summary>Descriptor for DeleteVotingConfigExclusions <para></para></summary>
public partial class DeleteVotingConfigExclusionsDescriptor : RequestDescriptorBase<DeleteVotingConfigExclusionsDescriptor, DeleteVotingConfigExclusionsRequestParameters, IDeleteVotingConfigExclusionsRequest>, IDeleteVotingConfigExclusionsRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterDeleteVotingConfigExclusions;
// values part of the url path
// Request parameters
///<summary>Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.</summary>
public DeleteVotingConfigExclusionsDescriptor WaitForRemoval(bool? waitforremoval = true) => Qs("wait_for_removal", waitforremoval);
}

///<summary>Descriptor for GetSettings <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/</para></summary>
public partial class ClusterGetSettingsDescriptor : RequestDescriptorBase<ClusterGetSettingsDescriptor, ClusterGetSettingsRequestParameters, IClusterGetSettingsRequest>, IClusterGetSettingsRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterGetSettings;
// values part of the url path
// Request parameters
///<summary>Return settings in flat format (default: false)</summary>
public ClusterGetSettingsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings);
///<summary>Whether to return all default clusters setting.</summary>
public ClusterGetSettingsDescriptor IncludeDefaults(bool? includedefaults = true) => Qs("include_defaults", includedefaults);
///<summary>Explicit operation timeout for connection to master node</summary>
///<remarks>Deprecated as of OpenSearch 2.0, use <see cref="ClusterManagerTimeout"/> instead</remarks>
public ClusterGetSettingsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///<summary>Explicit operation timeout for connection to cluster_manager node</summary>
///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks>
public ClusterGetSettingsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
///<summary>Explicit operation timeout</summary>
public ClusterGetSettingsDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}

///<summary>Descriptor for Health <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</para></summary>
public partial class ClusterHealthDescriptor : RequestDescriptorBase<ClusterHealthDescriptor, ClusterHealthRequestParameters, IClusterHealthRequest>, IClusterHealthRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterHealth;
///<summary>/_cluster/health</summary>
public ClusterHealthDescriptor(): base()
{
}

///<summary>/_cluster/health/{index}</summary>
///<param name = "index">Optional, accepts null</param>
public ClusterHealthDescriptor(Indices index): base(r => r.Optional("index", index))
{
}

// values part of the url path
Indices IClusterHealthRequest.Index => Self.RouteValues.Get<Indices>("index");
///<summary>Limit the information returned to a specific index</summary>
public ClusterHealthDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public ClusterHealthDescriptor Index<TOther>()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
///<summary>A shortcut into calling Index(Indices.All)</summary>
public ClusterHealthDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ClusterHealthDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///<summary>Specify the level of detail for returned information</summary>
public ClusterHealthDescriptor Level(Level? level) => Qs("level", level);
///<summary>Return local information, do not retrieve the state from cluster_manager node (default: false)</summary>
public ClusterHealthDescriptor Local(bool? local = true) => Qs("local", local);
///<summary>Explicit operation timeout for connection to master node</summary>
///<remarks>Deprecated as of OpenSearch 2.0, use <see cref="ClusterManagerTimeout"/> instead</remarks>
public ClusterHealthDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///<summary>Explicit operation timeout for connection to cluster_manager node</summary>
///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks>
public ClusterHealthDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
///<summary>Explicit operation timeout</summary>
public ClusterHealthDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///<summary>Wait until the specified number of shards is active</summary>
public ClusterHealthDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
///<summary>Wait until all currently queued events with the given priority are processed</summary>
public ClusterHealthDescriptor WaitForEvents(WaitForEvents? waitforevents) => Qs("wait_for_events", waitforevents);
///<summary>Whether to wait until there are no initializing shards in the cluster</summary>
public ClusterHealthDescriptor WaitForNoInitializingShards(bool? waitfornoinitializingshards = true) => Qs("wait_for_no_initializing_shards", waitfornoinitializingshards);
///<summary>Whether to wait until there are no relocating shards in the cluster</summary>
public ClusterHealthDescriptor WaitForNoRelocatingShards(bool? waitfornorelocatingshards = true) => Qs("wait_for_no_relocating_shards", waitfornorelocatingshards);
///<summary>Wait until the specified number of nodes is available</summary>
public ClusterHealthDescriptor WaitForNodes(string waitfornodes) => Qs("wait_for_nodes", waitfornodes);
///<summary>Wait until cluster is in a specific state</summary>
public ClusterHealthDescriptor WaitForStatus(WaitForStatus? waitforstatus) => Qs("wait_for_status", waitforstatus);
}

///<summary>Descriptor for PendingTasks <para>https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/</para></summary>
public partial class ClusterPendingTasksDescriptor : RequestDescriptorBase<ClusterPendingTasksDescriptor, ClusterPendingTasksRequestParameters, IClusterPendingTasksRequest>, IClusterPendingTasksRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterPendingTasks;
// values part of the url path
// Request parameters
///<summary>Return local information, do not retrieve the state from cluster_manager node (default: false)</summary>
public ClusterPendingTasksDescriptor Local(bool? local = true) => Qs("local", local);
///<summary>Explicit operation timeout for connection to master node</summary>
///<remarks>Deprecated as of OpenSearch 2.0, use <see cref="ClusterManagerTimeout"/> instead</remarks>
public ClusterPendingTasksDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///<summary>Explicit operation timeout for connection to cluster_manager node</summary>
///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks>
public ClusterPendingTasksDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
}

///<summary>Descriptor for PostVotingConfigExclusions <para></para></summary>
public partial class PostVotingConfigExclusionsDescriptor : RequestDescriptorBase<PostVotingConfigExclusionsDescriptor, PostVotingConfigExclusionsRequestParameters, IPostVotingConfigExclusionsRequest>, IPostVotingConfigExclusionsRequest
{
Expand Down
6 changes: 0 additions & 6 deletions src/OpenSearch.Client/IOpenSearchClient.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ CatNamespace Cat
get;
}

///<summary>Cluster APIs</summary>
ClusterNamespace Cluster
{
get;
}

///<summary>Indices APIs</summary>
IndicesNamespace Indices
{
Expand Down
Loading

0 comments on commit f1df48d

Please sign in to comment.