diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index ba804e74b..b92d92ad2 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -5,11 +5,15 @@ on: - "*" paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' pull_request: branches: - "*" paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' jobs: test-opensearch: diff --git a/.github/workflows/generate_api.yml b/.github/workflows/generate_api.yml index 8e137be05..2569fc41c 100644 --- a/.github/workflows/generate_api.yml +++ b/.github/workflows/generate_api.yml @@ -1,6 +1,6 @@ name: Generate API from Spec on: - push: + pull_request: paths: - '.github/workflows/generate_api.yml' - 'api_generator/**' @@ -43,19 +43,19 @@ jobs: - name: Get current date id: date - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'pull_request' }} run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: GitHub App token id: github_app_token - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'pull_request' }} uses: tibdex/github-app-token@v2.1.0 with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create pull request - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'pull_request' }} uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.github_app_token.outputs.token }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 364afafcb..59b373107 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,11 +5,15 @@ on: - "*" paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' pull_request: branches: - "*" paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' jobs: test-opensearch: env: diff --git a/.github/workflows/test-unreleased.yml b/.github/workflows/test-unreleased.yml index 63a826fad..80acc475c 100644 --- a/.github/workflows/test-unreleased.yml +++ b/.github/workflows/test-unreleased.yml @@ -6,11 +6,15 @@ on: - 'main' paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' pull_request: branches: - 'main' paths-ignore: - '*.md' + - '.github/workflows/generate_api.yml' + - 'api_generator/**' jobs: test: diff --git a/lib/opensearch/api/actions/asynchronous_search/delete.rb b/lib/opensearch/api/actions/asynchronous_search/delete.rb index 2d1ce0442..ae1b991cc 100644 --- a/lib/opensearch/api/actions/asynchronous_search/delete.rb +++ b/lib/opensearch/api/actions/asynchronous_search/delete.rb @@ -13,7 +13,7 @@ module OpenSearch module API module AsynchronousSearch module Actions - # Delete asynchronous search. + # Deletes any responses from an asynchronous search. # # @option args [String] :id *Required* # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request diff --git a/lib/opensearch/api/actions/asynchronous_search/get.rb b/lib/opensearch/api/actions/asynchronous_search/get.rb index 0823619e7..28fa105cc 100644 --- a/lib/opensearch/api/actions/asynchronous_search/get.rb +++ b/lib/opensearch/api/actions/asynchronous_search/get.rb @@ -13,7 +13,7 @@ module OpenSearch module API module AsynchronousSearch module Actions - # Get partial responses from asynchronous search. + # Gets partial responses from an asynchronous search. # # @option args [String] :id *Required* def get(args = {}) diff --git a/lib/opensearch/api/actions/asynchronous_search/search.rb b/lib/opensearch/api/actions/asynchronous_search/search.rb index 454366b15..8780b9a90 100644 --- a/lib/opensearch/api/actions/asynchronous_search/search.rb +++ b/lib/opensearch/api/actions/asynchronous_search/search.rb @@ -13,12 +13,12 @@ module OpenSearch module API module AsynchronousSearch module Actions - # Perform an asynchronous search. + # Performs an asynchronous search. # # @option args [String] :index The name of the index to be searched. Can be an individual name, a comma-separated list of indexes, or a wildcard expression of index names. - # @option args [String] :keep_alive The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query overruns this time, the process cancels this query automatically. - # @option args [Boolean] :keep_on_completion Whether you want to save the results in the cluster after the search is complete. - # @option args [String] :wait_for_completion_timeout The amount of time that you plan to wait for the results. You can poll the remaining results based on an ID. The maximum value is `300s`. Default is `1s`. + # @option args [String] :keep_alive The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query exceeds this amount of time, the process cancels this query automatically. + # @option args [Boolean] :keep_on_completion Whether to save the results in the cluster after the search is complete. You can examine the stored results at a later time. + # @option args [String] :wait_for_completion_timeout The amount of time to wait for the results. You can poll the remaining results based on an ID. The maximum value is 300 seconds. Default is `1s`. # @option args [Hash] :body The search definition using the Query DSL. def search(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/asynchronous_search/stats.rb b/lib/opensearch/api/actions/asynchronous_search/stats.rb index 595895379..3ed9fd2fb 100644 --- a/lib/opensearch/api/actions/asynchronous_search/stats.rb +++ b/lib/opensearch/api/actions/asynchronous_search/stats.rb @@ -13,7 +13,7 @@ module OpenSearch module API module AsynchronousSearch module Actions - # Monitoring of asynchronous searches that are running, completed, and/or persisted. + # Monitors any asynchronous searches that are `running`, `completed`, or `persisted`. # def stats(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/bulk_stream.rb b/lib/opensearch/api/actions/bulk_stream.rb index 7410efa09..236eaad9d 100644 --- a/lib/opensearch/api/actions/bulk_stream.rb +++ b/lib/opensearch/api/actions/bulk_stream.rb @@ -23,7 +23,7 @@ module Actions # @option args [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. # @option args [Boolean] :require_alias If `true`, the request's actions must target an index alias. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :timeout Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. # @option args [String] :type Default document type for items which don't provide one. # @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/lib/opensearch/api/actions/cat/aliases.rb b/lib/opensearch/api/actions/cat/aliases.rb index 32555612a..4d0e5f657 100644 --- a/lib/opensearch/api/actions/cat/aliases.rb +++ b/lib/opensearch/api/actions/cat/aliases.rb @@ -13,15 +13,15 @@ module OpenSearch module API module Cat module Actions - # Shows information about currently configured aliases to indexes including filter and routing info. + # Shows information about aliases currently configured to indexes, including filter and routing information. # - # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Whether to return information from the local node only instead of from the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Enumerable, String] :name A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. def aliases(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/all_pit_segments.rb b/lib/opensearch/api/actions/cat/all_pit_segments.rb index efb0460ba..ccb2bf539 100644 --- a/lib/opensearch/api/actions/cat/all_pit_segments.rb +++ b/lib/opensearch/api/actions/cat/all_pit_segments.rb @@ -13,14 +13,14 @@ module OpenSearch module API module Cat module Actions - # Lists all active point-in-time segments. + # Lists all active CAT point-in-time segments. # - # @option args [String] :bytes The unit in which to display byte values. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def all_pit_segments(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/allocation.rb b/lib/opensearch/api/actions/cat/allocation.rb index 3a88472ac..c9f1bdcdd 100644 --- a/lib/opensearch/api/actions/cat/allocation.rb +++ b/lib/opensearch/api/actions/cat/allocation.rb @@ -15,16 +15,16 @@ module Cat module Actions # Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. - # @option args [Enumerable, String] :node_id Comma-separated list of node identifiers or names used to limit the returned information. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :cluster_manager_timeout A timeout for connection to the cluster manager node. + # @option args [String] :format A short version of the HTTP `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from cluster-manager node. + # @option args [String] :master_timeout DEPRECATED A timeout for connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. + # @option args [Enumerable, String] :node_id A comma-separated list of node IDs or names used to limit the returned information. def allocation(args = {}) args = Utils.clone_and_normalize_arguments(args) _node_id = args.delete('node_id') diff --git a/lib/opensearch/api/actions/cat/cluster_manager.rb b/lib/opensearch/api/actions/cat/cluster_manager.rb index 8cdc60292..f1c4fdf58 100644 --- a/lib/opensearch/api/actions/cat/cluster_manager.rb +++ b/lib/opensearch/api/actions/cat/cluster_manager.rb @@ -15,14 +15,14 @@ module Cat module Actions # Returns information about the cluster-manager node. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout A timeout for connection to the cluster manager node. + # @option args [String] :format A short version of the HTTP `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A timeout for connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def cluster_manager(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/count.rb b/lib/opensearch/api/actions/cat/count.rb index f2675e072..bfdb198fa 100644 --- a/lib/opensearch/api/actions/cat/count.rb +++ b/lib/opensearch/api/actions/cat/count.rb @@ -13,13 +13,13 @@ module OpenSearch module API module Cat module Actions - # Provides quick access to the document count of the entire cluster, or individual indexes. + # Provides quick access to the document count of the entire cluster or of an individual index. # - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Enumerable, String] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def count(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/fielddata.rb b/lib/opensearch/api/actions/cat/fielddata.rb index 2092ea6c4..c5c306be1 100644 --- a/lib/opensearch/api/actions/cat/fielddata.rb +++ b/lib/opensearch/api/actions/cat/fielddata.rb @@ -15,13 +15,13 @@ module Cat module Actions # Shows how much heap memory is currently being used by field data on every data node in the cluster. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [Enumerable, String] :fields Comma-separated list of fields used to limit returned information. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [Enumerable, String] :fields A comma-separated list of fields used to limit the amount of returned information. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def fielddata(args = {}) args = Utils.clone_and_normalize_arguments(args) _fields = args.delete('fields') diff --git a/lib/opensearch/api/actions/cat/health.rb b/lib/opensearch/api/actions/cat/health.rb index 690d49e99..3ef74646b 100644 --- a/lib/opensearch/api/actions/cat/health.rb +++ b/lib/opensearch/api/actions/cat/health.rb @@ -15,13 +15,13 @@ module Cat module Actions # Returns a concise representation of the cluster health. # - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. # @option args [String] :time The unit used to display time values. - # @option args [Boolean] :ts (default: true) If `true`, returns `HH:MM:SS` and Unix epoch timestamps. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Boolean] :ts (default: true) When `true`, returns `HH:MM:SS` and Unix epoch timestamps. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def health(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/indices.rb b/lib/opensearch/api/actions/cat/indices.rb index 68e537b9a..82ef70302 100644 --- a/lib/opensearch/api/actions/cat/indices.rb +++ b/lib/opensearch/api/actions/cat/indices.rb @@ -13,23 +13,23 @@ module OpenSearch module API module Cat module Actions - # Returns information about indexes: number of primaries and replicas, document counts, disk size, ... + # Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, and so on. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Enumerable, String] :expand_wildcards The type of index that wildcard patterns can match. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [String] :health The health status used to limit returned indexes. By default, the response includes indexes of any health status. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :include_unloaded_segments If `true`, the response includes information from segments that are not loaded into memory. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :pri If `true`, the response only includes information from primary shards. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit used to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. - # @option args [Enumerable, String] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [String] :health Limits indexes based on their health status. Supported values are `green`, `yellow`, and `red`. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :include_unloaded_segments Whether to include information from segments not loaded into memory. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Boolean] :pri When `true`, returns information only from the primary shards. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. + # @option args [Enumerable, String] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def indices(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/cat/master.rb b/lib/opensearch/api/actions/cat/master.rb index 88dea0cd4..9cf9b125a 100644 --- a/lib/opensearch/api/actions/cat/master.rb +++ b/lib/opensearch/api/actions/cat/master.rb @@ -15,14 +15,14 @@ module Cat module Actions # Returns information about the cluster-manager node. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def master(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/nodeattrs.rb b/lib/opensearch/api/actions/cat/nodeattrs.rb index d5e036e31..bc4134051 100644 --- a/lib/opensearch/api/actions/cat/nodeattrs.rb +++ b/lib/opensearch/api/actions/cat/nodeattrs.rb @@ -15,14 +15,14 @@ module Cat module Actions # Returns information about custom node attributes. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def nodeattrs(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/nodes.rb b/lib/opensearch/api/actions/cat/nodes.rb index a155edefa..341ca9f82 100644 --- a/lib/opensearch/api/actions/cat/nodes.rb +++ b/lib/opensearch/api/actions/cat/nodes.rb @@ -13,19 +13,19 @@ module OpenSearch module API module Cat module Actions - # Returns basic statistics about performance of cluster nodes. + # Returns basic statistics about the performance of cluster nodes. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Boolean, String] :full_id If `true`, return the full node ID. If `false`, return the shortened node ID. - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local DEPRECATED Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Boolean, String] :full_id When `true`, returns the full node ID. When `false`, returns the shortened node ID. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local DEPRECATED Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def nodes(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/pending_tasks.rb b/lib/opensearch/api/actions/cat/pending_tasks.rb index 40efa7af9..979727a03 100644 --- a/lib/opensearch/api/actions/cat/pending_tasks.rb +++ b/lib/opensearch/api/actions/cat/pending_tasks.rb @@ -13,17 +13,17 @@ module OpenSearch module API module Cat module Actions - # Returns a concise representation of the cluster pending tasks. + # Returns a concise representation of the cluster's pending tasks. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def pending_tasks(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/pit_segments.rb b/lib/opensearch/api/actions/cat/pit_segments.rb index 950bbf2eb..60571a046 100644 --- a/lib/opensearch/api/actions/cat/pit_segments.rb +++ b/lib/opensearch/api/actions/cat/pit_segments.rb @@ -13,14 +13,14 @@ module OpenSearch module API module Cat module Actions - # List segments for one or several PITs. + # Lists one or several CAT point-in-time segments. # - # @option args [String] :bytes The unit in which to display byte values. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Hash] :body def pit_segments(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/plugins.rb b/lib/opensearch/api/actions/cat/plugins.rb index ed2b40bf8..496eb2470 100644 --- a/lib/opensearch/api/actions/cat/plugins.rb +++ b/lib/opensearch/api/actions/cat/plugins.rb @@ -13,16 +13,16 @@ module OpenSearch module API module Cat module Actions - # Returns information about installed plugins across nodes node. + # Returns information about the names, components, and versions of the installed plugins. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def plugins(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/recovery.rb b/lib/opensearch/api/actions/cat/recovery.rb index 45339d596..8b1d07d4a 100644 --- a/lib/opensearch/api/actions/cat/recovery.rb +++ b/lib/opensearch/api/actions/cat/recovery.rb @@ -13,18 +13,18 @@ module OpenSearch module API module Cat module Actions - # Returns information about index shard recoveries, both on-going completed. + # Returns all completed and ongoing index and shard recoveries. # # @option args [Boolean] :active_only If `true`, the response only includes ongoing shard recoveries. - # @option args [String] :bytes The unit used to display byte values. - # @option args [Boolean] :detailed If `true`, the response includes detailed information about shard recoveries. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :index Comma-separated list or wildcard expression of index names to limit the returned information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [Boolean] :detailed When `true`, includes detailed information about shard recoveries. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def recovery(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/cat/repositories.rb b/lib/opensearch/api/actions/cat/repositories.rb index 86cfc6052..f8ac1c171 100644 --- a/lib/opensearch/api/actions/cat/repositories.rb +++ b/lib/opensearch/api/actions/cat/repositories.rb @@ -13,16 +13,16 @@ module OpenSearch module API module Cat module Actions - # Returns information about snapshot repositories registered in the cluster. + # Returns information about all snapshot repositories for a cluster. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def repositories(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/segment_replication.rb b/lib/opensearch/api/actions/cat/segment_replication.rb index 7da9eb202..33b6a414b 100644 --- a/lib/opensearch/api/actions/cat/segment_replication.rb +++ b/lib/opensearch/api/actions/cat/segment_replication.rb @@ -13,25 +13,26 @@ module OpenSearch module API module Cat module Actions - # Returns information about both on-going and latest completed Segment Replication events. + # Returns information about active and last-completed segment replication events on each replica shard, including related shard-level metrics. + # These metrics provide information about how far behind the primary shard the replicas are lagging. # - # @option args [Boolean] :active_only If `true`, the response only includes ongoing segment replication events. - # @option args [Boolean] :allow_no_indices Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). - # @option args [String] :bytes The unit in which to display byte values. - # @option args [Boolean] :completed_only If `true`, the response only includes latest completed segment replication events. - # @option args [Boolean] :detailed If `true`, the response includes detailed information about segment replications. - # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indexes should be ignored when throttled. - # @option args [Boolean] :ignore_unavailable Whether specified concrete indexes should be ignored when unavailable (missing or closed). - # @option args [Enumerable] :index Comma-separated list or wildcard expression of index names to limit the returned information. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Enumerable] :shards Comma-separated list of shards to display. - # @option args [String] :time The unit in which to display time values. - # @option args [String] :timeout Operation timeout. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Boolean] :active_only When `true`, the response only includes ongoing segment replication events. + # @option args [Boolean] :allow_no_indices Whether to ignore the index if a wildcard index expression resolves to no concrete indexes. This includes the `_all` string or when no indexes have been specified. + # @option args [String] :bytes The units used to display byte values. + # @option args [Boolean] :completed_only When `true`, the response only includes the last-completed segment replication events. + # @option args [Boolean] :detailed When `true`, the response includes additional metrics for each stage of a segment replication event. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :ignore_throttled Whether specified concrete, expanded, or aliased indexes should be ignored when throttled. + # @option args [Boolean] :ignore_unavailable Whether the specified concrete indexes should be ignored when missing or closed. + # @option args [Enumerable] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Enumerable] :shards A comma-separated list of shards to display. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [String] :timeout The operation timeout. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def segment_replication(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/cat/segments.rb b/lib/opensearch/api/actions/cat/segments.rb index 3b82db76d..a3bfcf707 100644 --- a/lib/opensearch/api/actions/cat/segments.rb +++ b/lib/opensearch/api/actions/cat/segments.rb @@ -15,14 +15,14 @@ module Cat module Actions # Provides low-level information about the segments in the shards of an index. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Enumerable, String] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def segments(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/shards.rb b/lib/opensearch/api/actions/cat/shards.rb index 496d45dd1..65d97a007 100644 --- a/lib/opensearch/api/actions/cat/shards.rb +++ b/lib/opensearch/api/actions/cat/shards.rb @@ -13,18 +13,18 @@ module OpenSearch module API module Cat module Actions - # Provides a detailed view of shard allocation on nodes. + # Lists the states of all primary and replica shards and how they are distributed. # - # @option args [String] :bytes The unit used to display byte values. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :bytes The units used to display byte values. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Enumerable, String] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def shards(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/snapshots.rb b/lib/opensearch/api/actions/cat/snapshots.rb index e5ecdf341..183b898bb 100644 --- a/lib/opensearch/api/actions/cat/snapshots.rb +++ b/lib/opensearch/api/actions/cat/snapshots.rb @@ -13,18 +13,18 @@ module OpenSearch module API module Cat module Actions - # Returns all snapshots in a specific repository. + # Lists all of the snapshots stored in a specific repository. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :ignore_unavailable If `true`, the response does not include information from unavailable snapshots. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :ignore_unavailable When `true`, the response does not include information from unavailable snapshots. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. # @option args [Enumerable, String] :repository *Required* A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. If any repository fails during the request, OpenSearch returns an error. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def snapshots(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? diff --git a/lib/opensearch/api/actions/cat/tasks.rb b/lib/opensearch/api/actions/cat/tasks.rb index 17b30ed3f..079bbdf7a 100644 --- a/lib/opensearch/api/actions/cat/tasks.rb +++ b/lib/opensearch/api/actions/cat/tasks.rb @@ -13,18 +13,18 @@ module OpenSearch module API module Cat module Actions - # Returns information about the tasks currently executing on one or more nodes in the cluster. + # Lists the progress of all tasks currently running on the cluster. # - # @option args [Enumerable] :actions The task action names, which are used to limit the response. + # @option args [Enumerable] :actions The task action names used to limit the response. # @option args [Boolean] :detailed If `true`, the response includes detailed information about shard recoveries. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Enumerable] :nodes Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Enumerable] :nodes A comma-separated list of node IDs or names used to limit the returned information. Use `_local` to return information from the node to which you're connecting, specify a specific node from which to get information, or keep the parameter empty to get information from all nodes. # @option args [String] :parent_task_id The parent task identifier, which is used to limit the response. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [String] :time The unit in which to display time values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [String] :time Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + # @option args [Boolean] :v Enables verbose mode, which displays column headers. def tasks(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cat/templates.rb b/lib/opensearch/api/actions/cat/templates.rb index 6c9432928..e30fb2f0d 100644 --- a/lib/opensearch/api/actions/cat/templates.rb +++ b/lib/opensearch/api/actions/cat/templates.rb @@ -13,16 +13,16 @@ module OpenSearch module API module Cat module Actions - # Returns information about existing templates. + # Lists the names, patterns, order numbers, and version numbers of index templates. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [String] :cluster_manager_timeout The amount of time allowed to establish a connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [String] :name The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. def templates(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cat/thread_pool.rb b/lib/opensearch/api/actions/cat/thread_pool.rb index 022d250b6..19b48ade6 100644 --- a/lib/opensearch/api/actions/cat/thread_pool.rb +++ b/lib/opensearch/api/actions/cat/thread_pool.rb @@ -14,17 +14,17 @@ module API module Cat module Actions # Returns cluster-wide thread pool statistics per node. - # By default the active, queue and rejected statistics are returned for all thread pools. + # By default the active, queued, and rejected statistics are returned for all thread pools. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`). - # @option args [Enumerable] :h Comma-separated list of column names to display. - # @option args [Boolean] :help Return help information. - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node. - # @option args [Enumerable] :s Comma-separated list of column names or column aliases to sort by. + # @option args [String] :cluster_manager_timeout A timeout for connection to the cluster manager node. + # @option args [String] :format A short version of the `Accept` header, such as `json` or `yaml`. + # @option args [Enumerable] :h A comma-separated list of column names to display. + # @option args [Boolean] :help Returns help information. + # @option args [Boolean] :local Returns local information but does not retrieve the state from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED The amount of time allowed to establish a connection to the cluster manager node. + # @option args [Enumerable] :s A comma-separated list of column names or column aliases to sort by. # @option args [Integer] :size The multiplier in which to display values. - # @option args [Boolean] :v Verbose mode. Display column headers. + # @option args [Boolean] :v Enables verbose mode, which displays column headers. # @option args [Enumerable, String] :thread_pool_patterns A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. def thread_pool(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cluster/allocation_explain.rb b/lib/opensearch/api/actions/cluster/allocation_explain.rb index 3ec993922..90db98d5b 100644 --- a/lib/opensearch/api/actions/cluster/allocation_explain.rb +++ b/lib/opensearch/api/actions/cluster/allocation_explain.rb @@ -13,11 +13,11 @@ module OpenSearch module API module Cluster module Actions - # Provides explanations for shard allocations in the cluster. + # Explains how shards are allocated in the current cluster and provides an explanation for why unassigned shards can't be allocated to a node. # - # @option args [Boolean] :include_disk_info If `true`, returns information about disk usage and shard sizes. - # @option args [Boolean] :include_yes_decisions If `true`, returns YES decisions in explanation. - # @option args [Hash] :body The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' + # @option args [Boolean] :include_disk_info When `true`, returns information about disk usage and shard sizes. + # @option args [Boolean] :include_yes_decisions When `true`, returns any `YES` decisions in the allocation explanation. + # @option args [Hash] :body The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard. def allocation_explain(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cluster/delete_component_template.rb b/lib/opensearch/api/actions/cluster/delete_component_template.rb index 5a9a1641c..5ea7fc56b 100644 --- a/lib/opensearch/api/actions/cluster/delete_component_template.rb +++ b/lib/opensearch/api/actions/cluster/delete_component_template.rb @@ -15,10 +15,10 @@ module Cluster module Actions # Deletes a component template. # - # @option args [String] :name *Required* Name of the component template to delete. Wildcard (*) expressions are supported. + # @option args [String] :name *Required* The name of the component template to delete. Supports wildcard (*) expressions. # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [String] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_component_template(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb index f7fb8a54c..b8473b9be 100644 --- a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb @@ -13,7 +13,7 @@ module OpenSearch module API module Cluster module Actions - # Delete any existing decommission. + # Recommissions a decommissioned zone. # # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_decommission_awareness(args = {}) diff --git a/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb b/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb index 5d36f5541..2717e0072 100644 --- a/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb +++ b/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb @@ -13,9 +13,9 @@ module OpenSearch module API module Cluster module Actions - # Clears cluster voting config exclusions. + # Clears any cluster voting configuration exclusions. # - # @option args [Boolean] :wait_for_removal (default: true) Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to `false` then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. + # @option args [Boolean] :wait_for_removal (default: true) Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When `true`, all excluded nodes are removed from the cluster before this API takes any action. When `false`, the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_voting_config_exclusions(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cluster/exists_component_template.rb b/lib/opensearch/api/actions/cluster/exists_component_template.rb index 778a424ff..d9ac4a389 100644 --- a/lib/opensearch/api/actions/cluster/exists_component_template.rb +++ b/lib/opensearch/api/actions/cluster/exists_component_template.rb @@ -15,10 +15,10 @@ module Cluster module Actions # Returns information about whether a particular component template exist. # - # @option args [String] :name *Required* Name of the component template to check existence of. Wildcard (*) expressions are supported. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [String] :name *Required* The name of the component template. Wildcard (*) expressions are supported. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false, information is retrieved from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. def exists_component_template(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? diff --git a/lib/opensearch/api/actions/cluster/get_component_template.rb b/lib/opensearch/api/actions/cluster/get_component_template.rb index f94382a9f..aea73b50e 100644 --- a/lib/opensearch/api/actions/cluster/get_component_template.rb +++ b/lib/opensearch/api/actions/cluster/get_component_template.rb @@ -15,10 +15,11 @@ module Cluster module Actions # Returns one or more component templates. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [String] :name Name of the component template to retrieve. Wildcard (`*`) expressions are supported. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :flat_settings If `true`, returns settings in flat format. + # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :name The name of the component template to retrieve. Wildcard (`*`) expressions are supported. def get_component_template(args = {}) args = Utils.clone_and_normalize_arguments(args) _name = args.delete('name') @@ -34,6 +35,7 @@ def get_component_template(args = {}) GET_COMPONENT_TEMPLATE_QUERY_PARAMS = Set.new(%w[ cluster_manager_timeout + flat_settings local master_timeout ]).freeze diff --git a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb index c86dab28b..9791a94dd 100644 --- a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb @@ -13,9 +13,9 @@ module OpenSearch module API module Cluster module Actions - # Get details and status of decommissioned attribute. + # Retrieves the decommission status for all zones. # - # @option args [String] :awareness_attribute_name *Required* Awareness attribute name. + # @option args [String] :awareness_attribute_name *Required* The name of the awareness attribute. def get_decommission_awareness(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'awareness_attribute_name' missing" if args['awareness_attribute_name'].nil? diff --git a/lib/opensearch/api/actions/cluster/get_settings.rb b/lib/opensearch/api/actions/cluster/get_settings.rb index 18e2a5777..d1daef438 100644 --- a/lib/opensearch/api/actions/cluster/get_settings.rb +++ b/lib/opensearch/api/actions/cluster/get_settings.rb @@ -15,11 +15,11 @@ module Cluster module Actions # Returns cluster settings. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :flat_settings If `true`, returns settings in flat format. - # @option args [Boolean] :include_defaults If `true`, returns default cluster settings from the local node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [String] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :flat_settings When `true`, returns cluster settings in a flat format. + # @option args [Boolean] :include_defaults When `true`, returns default cluster settings from the local node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. def get_settings(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb index e813eed96..1bfae0081 100644 --- a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb @@ -15,7 +15,7 @@ module Cluster module Actions # Fetches weighted shard routing weights. # - # @option args [String] :attribute *Required* Awareness attribute name. + # @option args [String] :attribute *Required* The name of the awareness attribute. def get_weighted_routing(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'attribute' missing" if args['attribute'].nil? diff --git a/lib/opensearch/api/actions/cluster/health.rb b/lib/opensearch/api/actions/cluster/health.rb index 1d6713f8b..63085e59d 100644 --- a/lib/opensearch/api/actions/cluster/health.rb +++ b/lib/opensearch/api/actions/cluster/health.rb @@ -15,20 +15,20 @@ module Cluster module Actions # Returns basic information about the health of the cluster. # - # @option args [String] :awareness_attribute The awareness attribute for which the health is required. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. - # @option args [String] :level Can be one of cluster, indexes or shards. Controls the details level of the health information returned. - # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [String] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [Integer, String] :wait_for_active_shards A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. - # @option args [String] :wait_for_events Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. - # @option args [Boolean] :wait_for_no_initializing_shards A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. - # @option args [Boolean] :wait_for_no_relocating_shards A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. - # @option args [Float, String] :wait_for_nodes The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will not wait for any status. - # @option args [Enumerable, String] :index Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indexes in a cluster, omit this parameter or use `_all` or `*`. + # @option args [String] :awareness_attribute The name of the awareness attribute for which to return the cluster health status (for example, `zone`). Applicable only if `level` is set to `awareness_attributes`. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. + # @option args [String] :level (default: cluster) + # @option args [Boolean] :local Whether to return information from the local node only instead of from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Integer, String] :wait_for_active_shards Waits until the specified number of shards is active before returning a response. Use `all` for all shards. + # @option args [String] :wait_for_events Waits until all currently queued events with the given priority are processed. + # @option args [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no initializing shards in the cluster. + # @option args [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating shards in the cluster. + # @option args [Float, String] :wait_for_nodes Waits until the specified number of nodes (`N`) is available. Accepts `>=N`, `<=N`, `>N`, and `, String] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def health(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/cluster/pending_tasks.rb b/lib/opensearch/api/actions/cluster/pending_tasks.rb index 8032be229..a5d8c00cb 100644 --- a/lib/opensearch/api/actions/cluster/pending_tasks.rb +++ b/lib/opensearch/api/actions/cluster/pending_tasks.rb @@ -13,12 +13,12 @@ module OpenSearch module API module Cluster module Actions - # Returns a list of any cluster-level changes (e.g. create index, update mapping, - # allocate or fail shard) which have not yet been executed. + # Returns a list of pending cluster-level tasks, such as index creation, mapping updates, + # or new allocations. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. def pending_tasks(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb b/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb index d2478260e..2512bcc4a 100644 --- a/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb +++ b/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb @@ -13,11 +13,11 @@ module OpenSearch module API module Cluster module Actions - # Updates the cluster voting config exclusions by node ids or node names. + # Updates the cluster voting configuration by excluding certain node IDs or names. # - # @option args [Enumerable, String] :node_ids A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify `node_names`. - # @option args [Enumerable, String] :node_names A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify `node_ids`. - # @option args [String] :timeout When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. + # @option args [Enumerable, String] :node_ids A comma-separated list of node IDs to exclude from the voting configuration. When using this setting, you cannot also specify `node_names`. + # @option args [Enumerable, String] :node_names A comma-separated list of node names to exclude from the voting configuration. When using this setting, you cannot also specify `node_ids`. + # @option args [String] :timeout When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning a response. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. def post_voting_config_exclusions(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/cluster/put_component_template.rb b/lib/opensearch/api/actions/cluster/put_component_template.rb index 24e52295f..1163c7d65 100644 --- a/lib/opensearch/api/actions/cluster/put_component_template.rb +++ b/lib/opensearch/api/actions/cluster/put_component_template.rb @@ -15,12 +15,12 @@ module Cluster module Actions # Creates or updates a component template. # - # @option args [String] :name *Required* Name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. OpenSearch Agent uses these templates to configure backing indexes for its data streams. If you use OpenSearch Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don't use OpenSearch Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :create If `true`, this request cannot replace or update existing component templates. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [String] :timeout Operation timeout. - # @option args [Hash] :body *Required* The template definition + # @option args [String] :name *Required* The name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. OpenSearch uses these templates to configure backing indexes for its data streams. If you want to overwrite one of these templates, set the replacement template `version` to a higher value than the current version. If you want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the Cluster Update Settings API. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :create When `true`, this request cannot replace or update existing component templates. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Hash] :body *Required* The template definition. def put_component_template(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? diff --git a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb index a1640b669..6754b76fd 100644 --- a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb @@ -13,10 +13,10 @@ module OpenSearch module API module Cluster module Actions - # Decommissions an awareness attribute. + # Decommissions a cluster zone based on awareness. This can greatly benefit multi-zone deployments, where awareness attributes can aid in applying new upgrades to a cluster in a controlled fashion. # - # @option args [String] :awareness_attribute_name *Required* Awareness attribute name. - # @option args [String] :awareness_attribute_value *Required* Awareness attribute value. + # @option args [String] :awareness_attribute_name *Required* The name of the awareness attribute. + # @option args [String] :awareness_attribute_value *Required* The value of the awareness attribute. def put_decommission_awareness(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'awareness_attribute_name' missing" if args['awareness_attribute_name'].nil? diff --git a/lib/opensearch/api/actions/cluster/put_settings.rb b/lib/opensearch/api/actions/cluster/put_settings.rb index cc057985a..eb3e0cc0e 100644 --- a/lib/opensearch/api/actions/cluster/put_settings.rb +++ b/lib/opensearch/api/actions/cluster/put_settings.rb @@ -15,11 +15,11 @@ module Cluster module Actions # Updates the cluster settings. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :flat_settings Return settings in flat format. - # @option args [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node - # @option args [String] :timeout Explicit operation timeout - # @option args [Hash] :body *Required* The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :flat_settings Returns settings in a flat format. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Hash] :body *Required* The cluster settings to update. def put_settings(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? diff --git a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb index f436ca491..5bfdbcd33 100644 --- a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb @@ -15,7 +15,7 @@ module Cluster module Actions # Updates weighted shard routing weights. # - # @option args [String] :attribute *Required* Awareness attribute name. + # @option args [String] :attribute *Required* The name of the awareness attribute. # @option args [Hash] :body def put_weighted_routing(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cluster/reroute.rb b/lib/opensearch/api/actions/cluster/reroute.rb index dfb8b53bf..f3776a3b7 100644 --- a/lib/opensearch/api/actions/cluster/reroute.rb +++ b/lib/opensearch/api/actions/cluster/reroute.rb @@ -15,13 +15,13 @@ module Cluster module Actions # Allows to manually change the allocation of individual shards in the cluster. # - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Boolean] :dry_run If `true`, then the request simulates the operation only and returns the resulting state. - # @option args [Boolean] :explain If `true`, then the response contains an explanation of why the commands can or cannot be executed. - # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Boolean] :dry_run When `true`, the request simulates the operation and returns the resulting state. + # @option args [Boolean] :explain When `true`, the response contains an explanation of why certain commands can or cannot be executed. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. # @option args [Enumerable, String] :metric Limits the information returned to the specified metrics. - # @option args [Boolean] :retry_failed If `true`, then retries allocation of shards that are blocked due to too many subsequent allocation failures. - # @option args [String] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + # @option args [Boolean] :retry_failed When `true`, retries shard allocation if it was blocked because of too many subsequent failures. + # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. # @option args [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`) def reroute(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/cluster/state.rb b/lib/opensearch/api/actions/cluster/state.rb index fd45b9234..560c1db19 100644 --- a/lib/opensearch/api/actions/cluster/state.rb +++ b/lib/opensearch/api/actions/cluster/state.rb @@ -13,19 +13,19 @@ module OpenSearch module API module Cluster module Actions - # Returns a comprehensive information about the state of the cluster. + # Returns comprehensive information about the state of the cluster. # - # @option args [Boolean] :allow_no_indices Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) - # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. - # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. - # @option args [Boolean] :flat_settings Return settings in flat format. - # @option args [Boolean] :ignore_unavailable Whether specified concrete indexes should be ignored when unavailable (missing or closed) - # @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node. - # @option args [String] :master_timeout DEPRECATED Specify timeout for connection to cluster manager. + # @option args [Boolean] :allow_no_indices Whether to ignore a wildcard index expression that resolves into no concrete indexes. This includes the `_all` string or when no indexes have been specified. + # @option args [String] :cluster_manager_timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. + # @option args [Boolean] :flat_settings Returns settings in a flat format. + # @option args [Boolean] :ignore_unavailable Whether the specified concrete indexes should be ignored when unavailable (missing or closed). + # @option args [Boolean] :local Whether to return information from the local node only instead of from the cluster manager node. + # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. # @option args [Integer] :wait_for_metadata_version Wait for the metadata version to be equal or greater than the specified metadata version. # @option args [String] :wait_for_timeout The maximum time to wait for `wait_for_metadata_version` before timing out. - # @option args [Enumerable] :metric Limit the information returned to the specified metrics - # @option args [Enumerable, String] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes + # @option args [Enumerable] :metric Limits the information returned to only the specified metrics. + # @option args [Enumerable, String] :index A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def state(args = {}) args = Utils.clone_and_normalize_arguments(args) _metric = args.delete('metric') diff --git a/lib/opensearch/api/actions/cluster/stats.rb b/lib/opensearch/api/actions/cluster/stats.rb index 3fcc63bdd..69393d767 100644 --- a/lib/opensearch/api/actions/cluster/stats.rb +++ b/lib/opensearch/api/actions/cluster/stats.rb @@ -13,13 +13,13 @@ module OpenSearch module API module Cluster module Actions - # Returns high-level overview of cluster statistics. + # Returns a high-level overview of cluster statistics. # - # @option args [Boolean] :flat_settings If `true`, returns settings in flat format. - # @option args [String] :timeout Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response's `_nodes.failed` property. Defaults to no timeout. - # @option args [Enumerable] :index_metric Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified. + # @option args [Boolean] :flat_settings When `true`, returns settings in a flat format. + # @option args [String] :timeout The amount of time to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response's `_nodes.failed` property. Defaults to no timeout. + # @option args [Enumerable] :index_metric A comma-separated list of index metric groups, for example, `docs,store`. # @option args [Enumerable] :metric Limit the information returned to the specified metrics. - # @option args [Enumerable, String] :node_id Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. + # @option args [Enumerable, String] :node_id A comma-separated list of node IDs used to filter results. Supports [node filters](https://opensearch.org/docs/latest/api-reference/nodes-apis/index/#node-filters). def stats(args = {}) args = Utils.clone_and_normalize_arguments(args) _index_metric = args.delete('index_metric') diff --git a/lib/opensearch/api/actions/count.rb b/lib/opensearch/api/actions/count.rb index 34efc8c44..dd0b1e41b 100644 --- a/lib/opensearch/api/actions/count.rb +++ b/lib/opensearch/api/actions/count.rb @@ -20,14 +20,14 @@ module Actions # @option args [String] :analyzer Analyzer to use for the query string. This parameter can only be used when the `q` query string parameter is specified. # @option args [String] :default_operator The default operator for query string query: `AND` or `OR`. This parameter can only be used when the `q` query string parameter is specified. # @option args [String] :df Field to use as default where no field prefix is given in the query string. This parameter can only be used when the `q` query string parameter is specified. - # @option args [Enumerable, String] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. + # @option args [Enumerable, String] :expand_wildcards Specifies the type of index that wildcard expressions can match. Supports comma-separated values. # @option args [Boolean] :ignore_throttled If `true`, concrete, expanded or aliased indexes are ignored when frozen. # @option args [Boolean] :ignore_unavailable If `false`, the request returns an error if it targets a missing or closed index. # @option args [Boolean] :lenient If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. # @option args [Float] :min_score Sets the minimum `_score` value that documents must have to be included in the result. # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [String] :q Query in the Lucene query string syntax. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. # @option args [Enumerable, String] :index Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams and indexes, omit this parameter or use `*` or `_all`. # @option args [Hash] :body Query to restrict the results specified with the Query DSL (optional) diff --git a/lib/opensearch/api/actions/create.rb b/lib/opensearch/api/actions/create.rb index e940f5173..e7dad7a2f 100644 --- a/lib/opensearch/api/actions/create.rb +++ b/lib/opensearch/api/actions/create.rb @@ -20,7 +20,7 @@ module Actions # @option args [String] :index *Required* Name of the data stream or index to target. If the target doesn't exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn't exist and doesn't match a data stream template, this request creates the index. # @option args [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :timeout Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `external`, `external_gte`. diff --git a/lib/opensearch/api/actions/create_pit.rb b/lib/opensearch/api/actions/create_pit.rb index 73fc8efcc..e50b7b2e9 100644 --- a/lib/opensearch/api/actions/create_pit.rb +++ b/lib/opensearch/api/actions/create_pit.rb @@ -20,7 +20,7 @@ module Actions # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. # @option args [String] :keep_alive Specify the keep alive for point in time. # @option args [String] :preference (default: random) Specify the node or shard the operation should be performed on. - # @option args [Enumerable, String] :routing Comma-separated list of specific routing values. + # @option args [Hash] :routing Comma-separated list of specific routing values. def create_pit(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? diff --git a/lib/opensearch/api/actions/delete.rb b/lib/opensearch/api/actions/delete.rb index fd7c15eca..b5da8172c 100644 --- a/lib/opensearch/api/actions/delete.rb +++ b/lib/opensearch/api/actions/delete.rb @@ -20,7 +20,7 @@ module Actions # @option args [Integer] :if_primary_term Only perform the operation if the document has this primary term. # @option args [Integer] :if_seq_no Only perform the operation if the document has this sequence number. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :timeout Period to wait for active shards. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `external`, `external_gte`. diff --git a/lib/opensearch/api/actions/delete_by_query.rb b/lib/opensearch/api/actions/delete_by_query.rb index cd6ca4ced..8e5946745 100644 --- a/lib/opensearch/api/actions/delete_by_query.rb +++ b/lib/opensearch/api/actions/delete_by_query.rb @@ -16,7 +16,7 @@ module Actions # Deletes documents matching the provided query. # # @option args [Enumerable, String] :index *Required* Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams or indexes, omit this parameter or use `*` or `_all`. - # @option args [Enumerable] :_source Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. + # @option args [Boolean, Enumerable, String] :_source Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. # @option args [Enumerable] :_source_excludes List of fields to exclude from the returned `_source` field. # @option args [Enumerable] :_source_includes List of fields to extract and return from the `_source` field. # @option args [Boolean] :allow_no_indices If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. @@ -35,13 +35,13 @@ module Actions # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. # @option args [Boolean] :request_cache If `true`, the request cache is used for this request. Defaults to the index-level setting. # @option args [Float] :requests_per_second (default: 0) The throttle for this request in sub-requests per second. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :scroll Period to retain the search context for scrolling. # @option args [Integer] :scroll_size (default: 100) Size of the scroll request that powers the operation. # @option args [String] :search_timeout Explicit timeout for each search request. Defaults to no timeout. # @option args [String] :search_type The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. # @option args [Integer] :size Deprecated, use `max_docs` instead. - # @option args [Float, String] :slices The number of slices this task should be divided into. + # @option args [Integer, String] :slices The number of slices this task should be divided into. # @option args [Enumerable] :sort A comma-separated list of : pairs. # @option args [Enumerable] :stats Specific `tag` of the request for logging and statistical purposes. # @option args [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. diff --git a/lib/opensearch/api/actions/exists.rb b/lib/opensearch/api/actions/exists.rb index 8f15eb40a..ab78169f8 100644 --- a/lib/opensearch/api/actions/exists.rb +++ b/lib/opensearch/api/actions/exists.rb @@ -23,7 +23,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. - # @option args [Enumerable, String] :routing Target the specified primary shard. + # @option args [Hash] :routing Target the specified primary shard. # @option args [Enumerable, String] :stored_fields List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `external`, `external_gte`. diff --git a/lib/opensearch/api/actions/exists_source.rb b/lib/opensearch/api/actions/exists_source.rb index 1a12cbb02..b4cb18e47 100644 --- a/lib/opensearch/api/actions/exists_source.rb +++ b/lib/opensearch/api/actions/exists_source.rb @@ -23,7 +23,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. - # @option args [Enumerable, String] :routing Target the specified primary shard. + # @option args [Hash] :routing Target the specified primary shard. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `external`, `external_gte`. def exists_source(args = {}) diff --git a/lib/opensearch/api/actions/explain.rb b/lib/opensearch/api/actions/explain.rb index 40d6b0850..2fbe5423f 100644 --- a/lib/opensearch/api/actions/explain.rb +++ b/lib/opensearch/api/actions/explain.rb @@ -27,7 +27,7 @@ module Actions # @option args [Boolean] :lenient If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [String] :q Query in the Lucene query string syntax. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Enumerable, String] :stored_fields A comma-separated list of stored fields to return in the response. # @option args [Hash] :body The query definition using the Query DSL def explain(args = {}) diff --git a/lib/opensearch/api/actions/get.rb b/lib/opensearch/api/actions/get.rb index 6bac950b0..8bc49c1bf 100644 --- a/lib/opensearch/api/actions/get.rb +++ b/lib/opensearch/api/actions/get.rb @@ -23,7 +23,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. - # @option args [Enumerable, String] :routing Target the specified primary shard. + # @option args [Hash] :routing Target the specified primary shard. # @option args [Enumerable, String] :stored_fields List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `internal`, `external`, `external_gte`. diff --git a/lib/opensearch/api/actions/get_source.rb b/lib/opensearch/api/actions/get_source.rb index f181bb142..31ae4edfe 100644 --- a/lib/opensearch/api/actions/get_source.rb +++ b/lib/opensearch/api/actions/get_source.rb @@ -23,7 +23,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime Boolean) If `true`, the request is real-time as opposed to near-real-time. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. - # @option args [Enumerable, String] :routing Target the specified primary shard. + # @option args [Hash] :routing Target the specified primary shard. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type. One of `internal`, `external`, `external_gte`. def get_source(args = {}) diff --git a/lib/opensearch/api/actions/index.rb b/lib/opensearch/api/actions/index.rb index ceeb51f07..912887705 100644 --- a/lib/opensearch/api/actions/index.rb +++ b/lib/opensearch/api/actions/index.rb @@ -22,7 +22,7 @@ module Actions # @option args [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. # @option args [Boolean] :require_alias If `true`, the destination must be an index alias. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :timeout Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. # @option args [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. # @option args [String] :version_type Specific version type: `external`, `external_gte`. diff --git a/lib/opensearch/api/actions/indices/forcemerge.rb b/lib/opensearch/api/actions/indices/forcemerge.rb index af4283db0..87ce095f4 100644 --- a/lib/opensearch/api/actions/indices/forcemerge.rb +++ b/lib/opensearch/api/actions/indices/forcemerge.rb @@ -19,7 +19,7 @@ module Actions # @option args [Enumerable, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both. # @option args [Boolean] :flush (default: true) Specify whether the index should be flushed after performing the operation. # @option args [Boolean] :ignore_unavailable Whether specified concrete indexes should be ignored when unavailable (missing or closed) - # @option args [Float] :max_num_segments The number of larger segments into which smaller segments are merged. Set this parameter to 1 to merge all segments into one segment. The default behavior is to perform the merge as necessary. + # @option args [Integer] :max_num_segments The number of larger segments into which smaller segments are merged. Set this parameter to 1 to merge all segments into one segment. The default behavior is to perform the merge as necessary. # @option args [Boolean] :only_expunge_deletes Specify whether the operation should only expunge deleted documents # @option args [Boolean] :primary_only Specify whether the operation should only perform on primary shards. Defaults to false. # @option args [Boolean] :wait_for_completion (default: true) Should the request wait until the force merge is completed. diff --git a/lib/opensearch/api/actions/indices/put_template.rb b/lib/opensearch/api/actions/indices/put_template.rb index de080486d..5b3f86098 100644 --- a/lib/opensearch/api/actions/indices/put_template.rb +++ b/lib/opensearch/api/actions/indices/put_template.rb @@ -19,7 +19,7 @@ module Actions # @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node. # @option args [Boolean] :create If `true`, this request cannot replace or update existing index templates. # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. - # @option args [Float] :order Order in which OpenSearch applies this template if index matches multiple templates. Templates with lower 'order' values are merged first. Templates with higher 'order' values are merged later, overriding templates with lower values. + # @option args [Integer] :order Order in which OpenSearch applies this template if index matches multiple templates. Templates with lower 'order' values are merged first. Templates with higher 'order' values are merged later, overriding templates with lower values. # @option args [Hash] :body *Required* The template definition def put_template(args = {}) args = Utils.clone_and_normalize_arguments(args) diff --git a/lib/opensearch/api/actions/indices/upgrade.rb b/lib/opensearch/api/actions/indices/upgrade.rb index 9e03ada46..06b19f18f 100644 --- a/lib/opensearch/api/actions/indices/upgrade.rb +++ b/lib/opensearch/api/actions/indices/upgrade.rb @@ -21,7 +21,6 @@ module Actions # @option args [Boolean] :only_ancient_segments If `true`, only ancient (an older Lucene major release) segments will be upgraded. # @option args [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning. # @option args [Enumerable] :index Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. - # @option args [Hash] :body def upgrade(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/knn/search_models.rb b/lib/opensearch/api/actions/knn/search_models.rb index 5999b6463..2445cc517 100644 --- a/lib/opensearch/api/actions/knn/search_models.rb +++ b/lib/opensearch/api/actions/knn/search_models.rb @@ -39,7 +39,7 @@ module Actions # @option args [String] :q Query in the Lucene query string syntax. # @option args [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to index level setting. # @option args [Boolean] :rest_total_hits_as_int Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. - # @option args [Enumerable, String] :routing Comma-separated list of specific routing values. + # @option args [Hash] :routing Comma-separated list of specific routing values. # @option args [String] :scroll Specify how long a consistent view of the index should be maintained for scrolled search. # @option args [String] :search_type Search operation type. # @option args [Boolean] :seq_no_primary_term Specify whether to return sequence number and primary term of the last modification of each hit. diff --git a/lib/opensearch/api/actions/mget.rb b/lib/opensearch/api/actions/mget.rb index 2c8155f12..3ab7afe22 100644 --- a/lib/opensearch/api/actions/mget.rb +++ b/lib/opensearch/api/actions/mget.rb @@ -21,7 +21,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. # @option args [Boolean, String] :refresh If `true`, the request refreshes relevant shards before retrieving documents. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Enumerable, String] :stored_fields If `true`, retrieves the document fields stored in the index rather than the document `_source`. # @option args [String] :index Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. # @option args [Hash] :body *Required* Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. diff --git a/lib/opensearch/api/actions/ml/search_models.rb b/lib/opensearch/api/actions/ml/search_models.rb index 3bf8b76be..ee6fda6d4 100644 --- a/lib/opensearch/api/actions/ml/search_models.rb +++ b/lib/opensearch/api/actions/ml/search_models.rb @@ -20,7 +20,7 @@ def search_models(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - method = 'GET' + method = body ? 'POST' : 'GET' url = '_plugins/_ml/models/_search' Utils.validate_query_params! args diff --git a/lib/opensearch/api/actions/ml/undeploy_model.rb b/lib/opensearch/api/actions/ml/undeploy_model.rb index 93b25228b..a8965f059 100644 --- a/lib/opensearch/api/actions/ml/undeploy_model.rb +++ b/lib/opensearch/api/actions/ml/undeploy_model.rb @@ -15,11 +15,10 @@ module Ml module Actions # Undeploys a model. # - # @option args [String] :model_id *Required* + # @option args [String] :model_id + # @option args [Hash] :body def undeploy_model(args = {}) args = Utils.clone_and_normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? - _model_id = args.delete('model_id') headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/mtermvectors.rb b/lib/opensearch/api/actions/mtermvectors.rb index df030f914..c64105064 100644 --- a/lib/opensearch/api/actions/mtermvectors.rb +++ b/lib/opensearch/api/actions/mtermvectors.rb @@ -23,7 +23,7 @@ module Actions # @option args [Boolean] :positions (default: true) If `true`, the response includes term positions. # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime (default: true) If `true`, the request is real-time as opposed to near-real-time. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Boolean] :term_statistics If `true`, the response includes term frequency and document frequency. # @option args [Integer] :version If `true`, returns the document version as part of a hit. # @option args [String] :version_type Specific version type. diff --git a/lib/opensearch/api/actions/reindex.rb b/lib/opensearch/api/actions/reindex.rb index c45c59a72..05f06f586 100644 --- a/lib/opensearch/api/actions/reindex.rb +++ b/lib/opensearch/api/actions/reindex.rb @@ -20,8 +20,9 @@ module Actions # @option args [Integer] :max_docs Maximum number of documents to process. By default, all documents. # @option args [Boolean, String] :refresh If `true`, the request refreshes affected shards to make this operation visible to search. # @option args [Float] :requests_per_second (default: 0) The throttle for this request in sub-requests per second. Defaults to no throttle. + # @option args [Boolean] :require_alias # @option args [String] :scroll Specifies how long a consistent view of the index should be maintained for scrolled search. - # @option args [Float, String] :slices The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn't sliced into subtasks. + # @option args [Integer, String] :slices The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn't sliced into subtasks. # @option args [String] :timeout Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. # @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). # @option args [Boolean] :wait_for_completion (default: true) If `true`, the request blocks until the operation is complete. @@ -43,6 +44,7 @@ def reindex(args = {}) max_docs refresh requests_per_second + require_alias scroll slices timeout diff --git a/lib/opensearch/api/actions/reindex_rethrottle.rb b/lib/opensearch/api/actions/reindex_rethrottle.rb index 6b4572c8f..dad7002f9 100644 --- a/lib/opensearch/api/actions/reindex_rethrottle.rb +++ b/lib/opensearch/api/actions/reindex_rethrottle.rb @@ -13,7 +13,7 @@ module OpenSearch module API module Root module Actions - # Changes the number of requests per second for a particular Reindex operation. + # Changes the number of requests per second for a particular reindex operation. # # @option args [String] :task_id *Required* Identifier for the task. # @option args [Float] :requests_per_second The throttle for this request in sub-requests per second. diff --git a/lib/opensearch/api/actions/scroll.rb b/lib/opensearch/api/actions/scroll.rb index 5e2ed45fb..fecf892c5 100644 --- a/lib/opensearch/api/actions/scroll.rb +++ b/lib/opensearch/api/actions/scroll.rb @@ -18,7 +18,7 @@ module Actions # @option args [Boolean] :rest_total_hits_as_int If `true`, the API response's `hit.total` property is returned as an integer. If `false`, the API response's `hit.total` property is returned as an object. # @option args [String] :scroll Period to retain the search context for scrolling. # @option args [String] :scroll_id DEPRECATED The scroll ID for scrolled search - # @option args [Hash] :body The scroll ID if not passed by URL or query parameter. + # @option args [Hash] :body def scroll(args = {}) args = Utils.clone_and_normalize_arguments(args) _scroll_id = args.delete('scroll_id') diff --git a/lib/opensearch/api/actions/search.rb b/lib/opensearch/api/actions/search.rb index 2ec7a08ba..9b1e7c3ab 100644 --- a/lib/opensearch/api/actions/search.rb +++ b/lib/opensearch/api/actions/search.rb @@ -42,7 +42,7 @@ module Actions # @option args [String] :q Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing. # @option args [Boolean] :request_cache If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings. # @option args [Boolean] :rest_total_hits_as_int Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :scroll Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting. # @option args [String] :search_pipeline Customizable sequence of processing stages applied to search queries. # @option args [String] :search_type How distributed term frequencies are calculated for relevance scoring. diff --git a/lib/opensearch/api/actions/search_shards.rb b/lib/opensearch/api/actions/search_shards.rb index a006c5654..c923c1152 100644 --- a/lib/opensearch/api/actions/search_shards.rb +++ b/lib/opensearch/api/actions/search_shards.rb @@ -20,9 +20,8 @@ module Actions # @option args [Boolean] :ignore_unavailable If `false`, the request returns an error if it targets a missing or closed index. # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Enumerable, String] :index Returns the indexes and shards that a search request would be executed against. - # @option args [Hash] :body Defines the parameters that can be used in the `search_shards` endpoint request. See documentation for supported query syntax. def search_shards(args = {}) args = Utils.clone_and_normalize_arguments(args) _index = args.delete('index') diff --git a/lib/opensearch/api/actions/search_template.rb b/lib/opensearch/api/actions/search_template.rb index 69e1103e8..4b24f1918 100644 --- a/lib/opensearch/api/actions/search_template.rb +++ b/lib/opensearch/api/actions/search_template.rb @@ -24,7 +24,7 @@ module Actions # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :profile If `true`, the query execution is profiled. # @option args [Boolean] :rest_total_hits_as_int If `true`, `hits.total` are rendered as an integer in the response. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :scroll Specifies how long a consistent view of the index should be maintained for scrolled search. # @option args [String] :search_type The type of the search operation. # @option args [Boolean] :typed_keys If `true`, the response prefixes aggregation and suggester names with their respective types. diff --git a/lib/opensearch/api/actions/security/patch_distinguished_name.rb b/lib/opensearch/api/actions/security/patch_distinguished_name.rb index a89e8c332..0341f88ac 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_name.rb @@ -16,15 +16,15 @@ module Actions # Updates a distinguished cluster name for a specific cluster. Only accessible to super-admins and with rest-api permissions when enabled. # # @option args [String] :cluster_name *Required* The cluster name to update `nodesDn` value. - # @option args [Hash] :body + # @option args [Enumerable] :body def patch_distinguished_name(args = {}) args = Utils.clone_and_normalize_arguments(args) raise ArgumentError, "Required argument 'cluster_name' missing" if args['cluster_name'].nil? _cluster_name = args.delete('cluster_name') - headers = args.delete('headers') || {} - body = args.delete('body') + headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') + body = Utils.bulkify(args.delete('body')) method = 'PATCH' url = Utils.build_url('_plugins/_security/api/nodesdn', _cluster_name) diff --git a/lib/opensearch/api/actions/termvectors.rb b/lib/opensearch/api/actions/termvectors.rb index 05afe7a77..d48df3307 100644 --- a/lib/opensearch/api/actions/termvectors.rb +++ b/lib/opensearch/api/actions/termvectors.rb @@ -23,7 +23,7 @@ module Actions # @option args [Boolean] :positions (default: true) If `true`, the response includes term positions. # @option args [String] :preference (default: random) Specifies the node or shard the operation should be performed on. Random by default. # @option args [Boolean] :realtime (default: true) If `true`, the request is real-time as opposed to near-real-time. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [Boolean] :term_statistics If `true`, the response includes term frequency and document frequency. # @option args [Integer] :version If `true`, returns the document version as part of a hit. # @option args [String] :version_type Specific version type. diff --git a/lib/opensearch/api/actions/update.rb b/lib/opensearch/api/actions/update.rb index c3001a0be..e5b405f94 100644 --- a/lib/opensearch/api/actions/update.rb +++ b/lib/opensearch/api/actions/update.rb @@ -26,7 +26,7 @@ module Actions # @option args [Boolean, String] :refresh If 'true', OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. # @option args [Boolean] :require_alias If `true`, the destination must be an index alias. # @option args [Integer] :retry_on_conflict (default: 0) Specify how many times should the operation be retried when a conflict occurs. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :timeout Period to wait for dynamic mapping updates and active shards. This guarantees OpenSearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. # @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard. # @option args [Hash] :body *Required* The request definition requires either `script` or partial `doc` diff --git a/lib/opensearch/api/actions/update_by_query.rb b/lib/opensearch/api/actions/update_by_query.rb index 1c160120d..35ca9065b 100644 --- a/lib/opensearch/api/actions/update_by_query.rb +++ b/lib/opensearch/api/actions/update_by_query.rb @@ -17,7 +17,7 @@ module Actions # for example to pick up a mapping change. # # @option args [Enumerable, String] :index *Required* Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams or indexes, omit this parameter or use `*` or `_all`. - # @option args [Enumerable] :_source Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. + # @option args [Boolean, Enumerable, String] :_source Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. # @option args [Enumerable] :_source_excludes List of fields to exclude from the returned `_source` field. # @option args [Enumerable] :_source_includes List of fields to extract and return from the `_source` field. # @option args [Boolean] :allow_no_indices If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. @@ -37,13 +37,13 @@ module Actions # @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes affected shards to make the operation visible to search. # @option args [Boolean] :request_cache If `true`, the request cache is used for this request. # @option args [Float] :requests_per_second (default: 0) The throttle for this request in sub-requests per second. - # @option args [Enumerable, String] :routing Custom value used to route operations to a specific shard. + # @option args [Hash] :routing Custom value used to route operations to a specific shard. # @option args [String] :scroll Period to retain the search context for scrolling. # @option args [Integer] :scroll_size (default: 100) Size of the scroll request that powers the operation. # @option args [String] :search_timeout Explicit timeout for each search request. # @option args [String] :search_type The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. # @option args [Integer] :size Deprecated, use `max_docs` instead. - # @option args [Float, String] :slices The number of slices this task should be divided into. + # @option args [Integer, String] :slices The number of slices this task should be divided into. # @option args [Enumerable] :sort A comma-separated list of : pairs. # @option args [Enumerable] :stats Specific `tag` of the request for logging and statistical purposes. # @option args [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers.