From b1922b1f994ed3611f115329dae41fb02b238dc6 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Fri, 12 Jul 2024 03:34:37 +0000 Subject: [PATCH] Updated opensearch-py to reflect the latest OpenSearch API spec (2024-07-12) Signed-off-by: GitHub --- CHANGELOG.md | 1 + opensearchpy/_async/client/__init__.py | 12 ++++++------ opensearchpy/_async/client/cluster.py | 4 ++-- opensearchpy/_async/client/indices.py | 9 ++++++--- opensearchpy/_async/client/ingest.py | 2 +- opensearchpy/_async/plugins/transforms.py | 6 +++--- opensearchpy/client/__init__.py | 12 ++++++------ opensearchpy/client/cluster.py | 4 ++-- opensearchpy/client/indices.py | 9 ++++++--- opensearchpy/client/ingest.py | 2 +- opensearchpy/plugins/transforms.py | 6 +++--- 11 files changed, 37 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33856463e..ca02573cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fixed Search helper to ensure proper retention of the _collapse attribute in chained operations. ([#771](https://github.com/opensearch-project/opensearch-py/pull/771)) ### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@d5ca873](https://github.com/opensearch-project/opensearch-api-specification/commit/d5ca873d20ff54be16ec48e7bd629cda7c4a6332) - Updated opensearch-py APIs to reflect [opensearch-api-specification@7452827](https://github.com/opensearch-project/opensearch-api-specification/commit/745282767026703ea27967d2705633c3e2661c97) - Updated opensearch-py APIs to reflect [opensearch-api-specification@f2afd71](https://github.com/opensearch-project/opensearch-api-specification/commit/f2afd7171406c7477fbd644d74087bb0e2948c75) - Updated opensearch-py APIs to reflect [opensearch-api-specification@49cd814](https://github.com/opensearch-project/opensearch-api-specification/commit/49cd8140663f32f7c8b638ddc295683344edba61) diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index d740912ee..52cb54a65 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -339,9 +339,9 @@ async def create( :arg index: Name of the data stream or index to target. If the - target doesn’t exist and matches the name or wildcard (`*`) pattern of + 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 + the data stream. If the target doesn't exist and doesn't match a data stream template, this request creates the index. :arg id: Unique identifier for the document. :arg body: The document @@ -536,7 +536,7 @@ async def bulk( 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`. - :arg require_alias: If `true`, the request’s actions must target + :arg require_alias: If `true`, the request's actions must target an index alias. Default is false. :arg routing: Custom value used to route operations to a specific shard. @@ -1934,7 +1934,7 @@ async def reindex( :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + into.Defaults to 1 slice, meaning the task isn't sliced into subtasks. Valid choices are auto. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. @@ -2087,9 +2087,9 @@ async def scroll( statistics. :arg pretty: Whether to pretty format the returned JSON response. - :arg rest_total_hits_as_int: If true, the API response’s + :arg 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. Default is + response's hit.total property is returned as an object. Default is false. :arg scroll: Period to retain the search context for scrolling. :arg source: The URL-encoded request definition. Useful for diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index 2f873a908..e9691308d 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -288,7 +288,7 @@ async def stats( :arg 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. + response's `_nodes.failed` property. Defaults to no timeout. """ return await self.transport.perform_request( "GET", @@ -656,7 +656,7 @@ async def put_component_template( to configure backing indices 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 + 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. :arg body: The template definition diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index 5be0770e6..406328083 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -749,8 +749,8 @@ async def get_mapping( :arg index: Comma-separated list of data streams, indices, and - aliases used to limit the request. Supports wildcards (`*`). To target - all data streams and indices, omit this parameter or use `*` or `_all`. + aliases used to limit the request.Supports wildcards (`*`).To target all + data streams and indices, omit this parameter or use `*` or `_all`. :arg allow_no_indices: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request @@ -874,7 +874,7 @@ async def put_alias( :arg index: Comma-separated list of data streams or indices to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indices return an error. - :arg name: Alias to update. If the alias doesn’t exist, the + :arg name: Alias to update. If the alias doesn't exist, the request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` @@ -1693,6 +1693,7 @@ async def validate_query( "expand_wildcards", "fielddata", "fields", + "file", "filter_path", "human", "ignore_unavailable", @@ -1728,6 +1729,8 @@ async def clear_cache( `fields` parameter to clear the cache of specific fields only. :arg fields: Comma-separated list of field names used to limit the `fielddata` parameter. + :arg file: If true, clears the unused entries from the file + cache on nodes with the Search role. Default is false. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index 848466382..bd1d0165e 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -204,7 +204,7 @@ async def simulate( :arg body: The simulate definition - :arg id: Pipeline to test. If you don’t specify a `pipeline` in + :arg id: Pipeline to test. If you don't specify a `pipeline` in the request body, this parameter is required. :arg error_trace: Whether to include the stack trace of returned errors. diff --git a/opensearchpy/_async/plugins/transforms.py b/opensearchpy/_async/plugins/transforms.py index 231d02eec..8fe3cb417 100644 --- a/opensearchpy/_async/plugins/transforms.py +++ b/opensearchpy/_async/plugins/transforms.py @@ -219,16 +219,16 @@ async def search( errors. :arg filter_path: Comma-separated list of filters used to reduce the response. - :arg from_: The starting transform to return. Default is 0. + :arg from_: The starting transform to return. Default is `0`. :arg human: Whether to return human readable values for statistics. :arg pretty: Whether to pretty format the returned JSON response. :arg search: The search term to use to filter results. :arg size: Specifies the number of transforms to return. Default - is 10. + is `10`. :arg sortDirection: Specifies the direction to sort results in. - Can be ASC or DESC. Default is ASC. + Can be `ASC` or `DESC`. Default is `ASC`. :arg sortField: The field to sort results with. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 9ee3b7aa4..773434735 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -339,9 +339,9 @@ def create( :arg index: Name of the data stream or index to target. If the - target doesn’t exist and matches the name or wildcard (`*`) pattern of + 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 + the data stream. If the target doesn't exist and doesn't match a data stream template, this request creates the index. :arg id: Unique identifier for the document. :arg body: The document @@ -536,7 +536,7 @@ def bulk( 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`. - :arg require_alias: If `true`, the request’s actions must target + :arg require_alias: If `true`, the request's actions must target an index alias. Default is false. :arg routing: Custom value used to route operations to a specific shard. @@ -1934,7 +1934,7 @@ def reindex( :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + into.Defaults to 1 slice, meaning the task isn't sliced into subtasks. Valid choices are auto. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. @@ -2087,9 +2087,9 @@ def scroll( statistics. :arg pretty: Whether to pretty format the returned JSON response. - :arg rest_total_hits_as_int: If true, the API response’s + :arg 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. Default is + response's hit.total property is returned as an object. Default is false. :arg scroll: Period to retain the search context for scrolling. :arg source: The URL-encoded request definition. Useful for diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index f1b01e816..6bffedfe3 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -288,7 +288,7 @@ def stats( :arg 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. + response's `_nodes.failed` property. Defaults to no timeout. """ return self.transport.perform_request( "GET", @@ -656,7 +656,7 @@ def put_component_template( to configure backing indices 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 + 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. :arg body: The template definition diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index 7bb81c014..5ebb95da6 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -749,8 +749,8 @@ def get_mapping( :arg index: Comma-separated list of data streams, indices, and - aliases used to limit the request. Supports wildcards (`*`). To target - all data streams and indices, omit this parameter or use `*` or `_all`. + aliases used to limit the request.Supports wildcards (`*`).To target all + data streams and indices, omit this parameter or use `*` or `_all`. :arg allow_no_indices: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request @@ -874,7 +874,7 @@ def put_alias( :arg index: Comma-separated list of data streams or indices to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indices return an error. - :arg name: Alias to update. If the alias doesn’t exist, the + :arg name: Alias to update. If the alias doesn't exist, the request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` @@ -1693,6 +1693,7 @@ def validate_query( "expand_wildcards", "fielddata", "fields", + "file", "filter_path", "human", "ignore_unavailable", @@ -1728,6 +1729,8 @@ def clear_cache( `fields` parameter to clear the cache of specific fields only. :arg fields: Comma-separated list of field names used to limit the `fielddata` parameter. + :arg file: If true, clears the unused entries from the file + cache on nodes with the Search role. Default is false. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index 14495bff7..92bc402c5 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -204,7 +204,7 @@ def simulate( :arg body: The simulate definition - :arg id: Pipeline to test. If you don’t specify a `pipeline` in + :arg id: Pipeline to test. If you don't specify a `pipeline` in the request body, this parameter is required. :arg error_trace: Whether to include the stack trace of returned errors. diff --git a/opensearchpy/plugins/transforms.py b/opensearchpy/plugins/transforms.py index 9f8161edd..2eedfaddb 100644 --- a/opensearchpy/plugins/transforms.py +++ b/opensearchpy/plugins/transforms.py @@ -219,16 +219,16 @@ def search( errors. :arg filter_path: Comma-separated list of filters used to reduce the response. - :arg from_: The starting transform to return. Default is 0. + :arg from_: The starting transform to return. Default is `0`. :arg human: Whether to return human readable values for statistics. :arg pretty: Whether to pretty format the returned JSON response. :arg search: The search term to use to filter results. :arg size: Specifies the number of transforms to return. Default - is 10. + is `10`. :arg sortDirection: Specifies the direction to sort results in. - Can be ASC or DESC. Default is ASC. + Can be `ASC` or `DESC`. Default is `ASC`. :arg sortField: The field to sort results with. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.