diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 0e280c4b1c..00cd565c42 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -42,30 +42,7 @@ public static class CodeConfiguration new("{create,delete}_pit"), new("{delete,get}_all_pits"), - new("cat.aliases"), - new("cat.allocation"), - new("cat.all_pit_segments"), - new("cat.cluster_manager"), - new("cat.count"), - new("cat.fielddata"), - new("cat.health"), - new("cat.help"), - new("cat.indices"), - new("cat.master"), - new("cat.nodeattrs"), - new("cat.nodes"), - new("cat.pending_tasks"), - new("cat.pit_segments"), - new("cat.plugins"), - new("cat.recovery"), - new("cat.repositories"), - new("cat.segments"), - new("cat.shards"), - new("cat.snapshots"), - new("cat.tasks"), - new("cat.templates"), - new("cat.thread_pool"), - + new("cat.*"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index 3c9fab8e76..bb15270ef1 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -2705,7 +2705,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CatPitSegment" + "$ref": "#/components/schemas/CatPitSegmentsOutputPayload" } } } @@ -2796,7 +2796,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CatPitSegment" + "$ref": "#/components/schemas/CatAllPitSegmentsOutputPayload" } } } @@ -3308,6 +3308,89 @@ "description": "A short version of the Accept header, e.g. json, yaml." } }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, { "name": "active_only", "in": "query", @@ -3360,30 +3443,6 @@ }, "explode": true }, - { - "name": "h", - "in": "query", - "description": "Comma-separated list of column names to display.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names to display." - }, - "explode": true - }, - { - "name": "help", - "in": "query", - "description": "Return help information.", - "schema": { - "type": "boolean", - "default": false, - "description": "Return help information." - } - }, { "name": "index", "in": "query", @@ -3398,20 +3457,6 @@ }, "explode": true }, - { - "name": "s", - "in": "query", - "description": "Comma-separated list of column names or column aliases to sort by.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names or column aliases to sort by." - }, - "explode": true - }, { "name": "time", "in": "query", @@ -3421,23 +3466,31 @@ } }, { - "name": "v", + "name": "timeout", "in": "query", - "description": "Verbose mode. Display column headers.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "default": false, - "description": "Verbose mode. Display column headers." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "CatSegmentReplication 200 response" + "description": "CatSegmentReplication 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatSegmentReplicationOutputPayload" + } + } + } } }, "x-operation-group": "cat.segment_replication", - "x-version-added": "1.0" + "x-version-added": "2.6.0" } }, "/_cat/segment_replication/{index}": { @@ -3466,6 +3519,89 @@ "description": "A short version of the Accept header, e.g. json, yaml." } }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, { "name": "active_only", "in": "query", @@ -3518,30 +3654,6 @@ }, "explode": true }, - { - "name": "h", - "in": "query", - "description": "Comma-separated list of column names to display.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names to display." - }, - "explode": true - }, - { - "name": "help", - "in": "query", - "description": "Return help information.", - "schema": { - "type": "boolean", - "default": false, - "description": "Return help information." - } - }, { "name": "index", "in": "query", @@ -3556,20 +3668,6 @@ }, "explode": true }, - { - "name": "s", - "in": "query", - "description": "Comma-separated list of column names or column aliases to sort by.", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of column names or column aliases to sort by." - }, - "explode": true - }, { "name": "time", "in": "query", @@ -3579,23 +3677,31 @@ } }, { - "name": "v", + "name": "timeout", "in": "query", - "description": "Verbose mode. Display column headers.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "default": false, - "description": "Verbose mode. Display column headers." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "CatSegmentReplication_WithIndex 200 response" + "description": "CatSegmentReplication_WithIndex 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatSegmentReplication_WithIndexOutputPayload" + } + } + } } }, "x-operation-group": "cat.segment_replication", - "x-version-added": "1.0" + "x-version-added": "2.6.0" } }, "/_cat/segments": { @@ -8166,6 +8272,16 @@ "type": "boolean", "description": "Specify whether the operation should only expunge deleted documents." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } } ], "responses": { @@ -21331,6 +21447,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the cloned index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -21425,6 +21562,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the cloned index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -24084,6 +24242,16 @@ "type": "boolean", "description": "Specify whether the operation should only expunge deleted documents." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } } ], "responses": { @@ -25506,6 +25674,27 @@ "type": "string", "description": "Sets the number of active shards to wait for before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -27963,6 +28152,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -28067,6 +28277,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -28457,6 +28688,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -28561,6 +28813,27 @@ "type": "string", "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "task_execution_timeout", + "in": "query", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h.", + "x-data-type": "time" + } } ], "responses": { @@ -30610,7 +30883,19 @@ "pb" ] }, - "CatPitSegment": { + "CatAllPitSegmentsOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatPitSegmentsRecord" + } + }, + "CatPitSegmentsOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatPitSegmentsRecord" + } + }, + "CatPitSegmentsRecord": { "type": "object", "properties": { "index": { @@ -30671,6 +30956,98 @@ "pit_id" ] }, + "CatSegmentReplicationOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatSegmentReplicationRecord" + } + }, + "CatSegmentReplicationRecord": { + "type": "object", + "properties": { + "shardId": { + "type": "string" + }, + "target_node": { + "type": "string" + }, + "target_host": { + "type": "string" + }, + "checkpoints_behind": { + "type": "string" + }, + "bytes_behind": { + "type": "string" + }, + "current_lag": { + "type": "string" + }, + "last_completed_lag": { + "type": "string" + }, + "rejected_requests": { + "type": "string" + }, + "stage": { + "type": "string" + }, + "time": { + "type": "string" + }, + "files_fetched": { + "type": "string" + }, + "files_percent": { + "type": "string" + }, + "bytes_fetched": { + "type": "string" + }, + "bytes_percent": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "stop_time": { + "type": "string" + }, + "files": { + "type": "string" + }, + "files_total": { + "type": "string" + }, + "bytes": { + "type": "string" + }, + "bytes_total": { + "type": "string" + }, + "replicating_stage_time_taken": { + "type": "string" + }, + "get_checkpoint_info_stage_time_taken": { + "type": "string" + }, + "file_diff_stage_time_taken": { + "type": "string" + }, + "get_files_stage_time_taken": { + "type": "string" + }, + "finalize_replication_stage_time_taken": { + "type": "string" + } + } + }, + "CatSegmentReplication_WithIndexOutputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatSegmentReplicationRecord" + } + }, "CertificatesDetail": { "type": "object", "properties": { diff --git a/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs new file mode 100644 index 0000000000..0e08e9751b --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRecord.cs @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +using System.Runtime.Serialization; + +namespace OpenSearch.Client; + +[DataContract] +public class CatSegmentReplicationRecord : ICatRecord +{ + [DataMember(Name = "shardId")] + public string ShardId { get; set; } + + [DataMember(Name = "target_node")] + public string TargetNode { get; set; } + + [DataMember(Name = "target_host")] + public string TargetHost { get; set; } + + [DataMember(Name = "checkpoints_behind")] + public string CheckpointsBehind { get; set; } + + [DataMember(Name = "bytes_behind")] + public string BytesBehind { get; set; } + + [DataMember(Name = "current_lag")] + public string CurrentLag { get; set; } + + [DataMember(Name = "last_completed_lag")] + public string LastCompletedLag { get; set; } + + [DataMember(Name = "rejected_requests")] + public string RejectedRequests { get; set; } + + [DataMember(Name = "stage")] + public string Stage { get; set; } + + [DataMember(Name = "time")] + public string Time { get; set; } + + [DataMember(Name = "files_fetched")] + public string FilesFetched { get; set; } + + [DataMember(Name = "files_percent")] + public string FilesPercent { get; set; } + + [DataMember(Name = "bytes_fetched")] + public string BytesFetched { get; set; } + + [DataMember(Name = "bytes_percent")] + public string BytesPercent { get; set; } + + [DataMember(Name = "start_time")] + public string StartTime { get; set; } + + [DataMember(Name = "stop_time")] + public string StopTime { get; set; } + + [DataMember(Name = "files")] + public string Files { get; set; } + + [DataMember(Name = "files_total")] + public string FilesTotal { get; set; } + + [DataMember(Name = "bytes")] + public string Bytes { get; set; } + + [DataMember(Name = "bytes_total")] + public string BytesTotal { get; set; } + + [DataMember(Name = "replicating_stage_time_taken")] + public string ReplicatingStageTimeTaken { get; set; } + + [DataMember(Name = "get_checkpoint_info_stage_time_taken")] + public string GetCheckpointInfoStageTimeTaken { get; set; } + + [DataMember(Name = "file_diff_stage_time_taken")] + public string FileDiffStageTimeTaken { get; set; } + + [DataMember(Name = "get_files_stage_time_taken")] + public string GetFilesStageTimeTaken { get; set; } + + [DataMember(Name = "finalize_replication_stage_time_taken")] + public string FinalizeReplicationStageTimeTaken { get; set; } +} diff --git a/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs new file mode 100644 index 0000000000..72c85a72bc --- /dev/null +++ b/src/OpenSearch.Client/Cat/CatSegmentReplication/CatSegmentReplicationRequest.cs @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +namespace OpenSearch.Client; + +[MapsApi("cat.segment_replication")] +public partial interface ICatSegmentReplicationRequest { } + +public partial class CatSegmentReplicationRequest { } + +public partial class CatSegmentReplicationDescriptor { } diff --git a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs index f98e0275ac..cb20f45805 100644 --- a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs @@ -86,6 +86,9 @@ internal static partial class ApiUrlsLookups internal static readonly ApiUrls CatRepositories = new(new[] { "_cat/repositories" }); + internal static readonly ApiUrls CatSegmentReplication = + new(new[] { "_cat/segment_replication", "_cat/segment_replication/{index}" }); + internal static readonly ApiUrls CatSegments = new(new[] { "_cat/segments", "_cat/segments/{index}" }); diff --git a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs index acc302d39c..a35fb0c7f2 100644 --- a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs @@ -850,6 +850,97 @@ public CatRepositoriesDescriptor SortByColumns(params string[] sortbycolumns) => public CatRepositoriesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); } + /// Descriptor for SegmentReplication https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + public partial class CatSegmentReplicationDescriptor + : RequestDescriptorBase< + CatSegmentReplicationDescriptor, + CatSegmentReplicationRequestParameters, + ICatSegmentReplicationRequest + >, + ICatSegmentReplicationRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegmentReplication; + + /// /_cat/segment_replication + public CatSegmentReplicationDescriptor() + : base() { } + + /// /_cat/segment_replication/{index} + /// Optional, accepts null + public CatSegmentReplicationDescriptor(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + Indices ICatSegmentReplicationRequest.Index => Self.RouteValues.Get("index"); + + /// Comma-separated list or wildcard expression of index names to limit the returned information. + public CatSegmentReplicationDescriptor Index(Indices index) => + Assign(index, (a, v) => a.RouteValues.Optional("index", v)); + + /// a shortcut into calling Index(typeof(TOther)) + public CatSegmentReplicationDescriptor Index() + where TOther : class => + Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); + + /// A shortcut into calling Index(Indices.All) + public CatSegmentReplicationDescriptor AllIndices() => Index(Indices.All); + + // Request parameters + /// If `true`, the response only includes ongoing segment replication events. + public CatSegmentReplicationDescriptor ActiveOnly(bool? activeonly = true) => + Qs("active_only", activeonly); + + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + public CatSegmentReplicationDescriptor AllowNoIndices(bool? allownoindices = true) => + Qs("allow_no_indices", allownoindices); + + /// The unit in which to display byte values. + public CatSegmentReplicationDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); + + /// If `true`, the response only includes latest completed segment replication events. + public CatSegmentReplicationDescriptor CompletedOnly(bool? completedonly = true) => + Qs("completed_only", completedonly); + + /// If `true`, the response includes detailed information about segment replications. + public CatSegmentReplicationDescriptor Detailed(bool? detailed = true) => + Qs("detailed", detailed); + + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + public CatSegmentReplicationDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => + Qs("expand_wildcards", expandwildcards); + + /// A short version of the Accept header, e.g. json, yaml. + public CatSegmentReplicationDescriptor Format(string format) => Qs("format", format); + + /// Comma-separated list of column names to display. + public CatSegmentReplicationDescriptor Headers(params string[] headers) => Qs("h", headers); + + /// Return help information. + public CatSegmentReplicationDescriptor Help(bool? help = true) => Qs("help", help); + + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled. + public CatSegmentReplicationDescriptor IgnoreThrottled(bool? ignorethrottled = true) => + Qs("ignore_throttled", ignorethrottled); + + /// Whether specified concrete indices should be ignored when unavailable (missing or closed). + public CatSegmentReplicationDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => + Qs("ignore_unavailable", ignoreunavailable); + + /// Comma-separated list of shards to display. + public CatSegmentReplicationDescriptor Shards(params string[] shards) => + Qs("shards", shards); + + /// Comma-separated list of column names or column aliases to sort by. + public CatSegmentReplicationDescriptor SortByColumns(params string[] sortbycolumns) => + Qs("s", sortbycolumns); + + /// Operation timeout. + public CatSegmentReplicationDescriptor Timeout(Time timeout) => Qs("timeout", timeout); + + /// Verbose mode. Display column headers. + public CatSegmentReplicationDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); + } + /// Descriptor for Segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ public partial class CatSegmentsDescriptor : RequestDescriptorBase< diff --git a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs index 7761cd208f..62f1245ab9 100644 --- a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs @@ -797,6 +797,62 @@ public Task> RepositoriesAsync( CatRepositoriesRecord >(request, ct); + /// + /// GET request to the cat.segment_replication API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + /// + /// Supported by OpenSearch servers of version 2.6.0 or greater. + public CatResponse SegmentReplication( + Func selector = null + ) => SegmentReplication(selector.InvokeOrDefault(new CatSegmentReplicationDescriptor())); + + /// + /// GET request to the cat.segment_replication API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + /// + /// Supported by OpenSearch servers of version 2.6.0 or greater. + public Task> SegmentReplicationAsync( + Func selector = null, + CancellationToken ct = default + ) => + SegmentReplicationAsync( + selector.InvokeOrDefault(new CatSegmentReplicationDescriptor()), + ct + ); + + /// + /// GET request to the cat.segment_replication API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + /// + /// Supported by OpenSearch servers of version 2.6.0 or greater. + public CatResponse SegmentReplication( + ICatSegmentReplicationRequest request + ) => + DoCat< + ICatSegmentReplicationRequest, + CatSegmentReplicationRequestParameters, + CatSegmentReplicationRecord + >(request); + + /// + /// GET request to the cat.segment_replication API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + /// + /// Supported by OpenSearch servers of version 2.6.0 or greater. + public Task> SegmentReplicationAsync( + ICatSegmentReplicationRequest request, + CancellationToken ct = default + ) => + DoCatAsync< + ICatSegmentReplicationRequest, + CatSegmentReplicationRequestParameters, + CatSegmentReplicationRecord + >(request, ct); + /// /// GET request to the cat.segments API, read more about this API online: /// diff --git a/src/OpenSearch.Client/_Generated/Requests.Cat.cs b/src/OpenSearch.Client/_Generated/Requests.Cat.cs index 3f21472120..b3ff283684 100644 --- a/src/OpenSearch.Client/_Generated/Requests.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Requests.Cat.cs @@ -1393,6 +1393,149 @@ public bool? Verbose } } + [InterfaceDataContract] + public partial interface ICatSegmentReplicationRequest + : IRequest + { + [IgnoreDataMember] + Indices Index { get; } + } + + /// Request for SegmentReplication https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + public partial class CatSegmentReplicationRequest + : PlainRequestBase, + ICatSegmentReplicationRequest + { + protected ICatSegmentReplicationRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegmentReplication; + + /// /_cat/segment_replication + public CatSegmentReplicationRequest() + : base() { } + + /// /_cat/segment_replication/{index} + /// Optional, accepts null + public CatSegmentReplicationRequest(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + [IgnoreDataMember] + Indices ICatSegmentReplicationRequest.Index => Self.RouteValues.Get("index"); + + // Request parameters + /// If `true`, the response only includes ongoing segment replication events. + public bool? ActiveOnly + { + get => Q("active_only"); + set => Q("active_only", value); + } + + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have + /// been specified). + /// + public bool? AllowNoIndices + { + get => Q("allow_no_indices"); + set => Q("allow_no_indices", value); + } + + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// If `true`, the response only includes latest completed segment replication events. + public bool? CompletedOnly + { + get => Q("completed_only"); + set => Q("completed_only", value); + } + + /// If `true`, the response includes detailed information about segment replications. + public bool? Detailed + { + get => Q("detailed"); + set => Q("detailed", value); + } + + /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + public ExpandWildcards? ExpandWildcards + { + get => Q("expand_wildcards"); + set => Q("expand_wildcards", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Whether specified concrete, expanded or aliased indices should be ignored when throttled. + public bool? IgnoreThrottled + { + get => Q("ignore_throttled"); + set => Q("ignore_throttled", value); + } + + /// Whether specified concrete indices should be ignored when unavailable (missing or closed). + public bool? IgnoreUnavailable + { + get => Q("ignore_unavailable"); + set => Q("ignore_unavailable", value); + } + + /// Comma-separated list of shards to display. + public string[] Shards + { + get => Q("shards"); + set => Q("shards", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Operation timeout. + public Time Timeout + { + get => Q