Updated opensearch-py to reflect the latest OpenSearch API spec (2024-07-12) (#773)
Signed-off-by: GitHub <[email protected]> Co-authored-by: saimedhi <[email protected]>
This commit is contained in:
co-authored by
saimedhi
parent
9ee0b23c63
commit
04a2350ba0
@@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||||||
### Fixed
|
### 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))
|
- 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 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@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@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)
|
- Updated opensearch-py APIs to reflect [opensearch-api-specification@49cd814](https://github.com/opensearch-project/opensearch-api-specification/commit/49cd8140663f32f7c8b638ddc295683344edba61)
|
||||||
|
|||||||
@@ -339,9 +339,9 @@ class AsyncOpenSearch(Client):
|
|||||||
|
|
||||||
|
|
||||||
:arg index: Name of the data stream or index to target. If the
|
: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
|
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.
|
stream template, this request creates the index.
|
||||||
:arg id: Unique identifier for the document.
|
:arg id: Unique identifier for the document.
|
||||||
:arg body: The document
|
:arg body: The document
|
||||||
@@ -536,7 +536,7 @@ class AsyncOpenSearch(Client):
|
|||||||
shards to make this operation visible to search, if `wait_for` then wait
|
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
|
for a refresh to make this operation visible to search, if `false` do
|
||||||
nothing with refreshes.Valid values: `true`, `false`, `wait_for`.
|
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.
|
an index alias. Default is false.
|
||||||
:arg routing: Custom value used to route operations to a
|
:arg routing: Custom value used to route operations to a
|
||||||
specific shard.
|
specific shard.
|
||||||
@@ -1934,7 +1934,7 @@ class AsyncOpenSearch(Client):
|
|||||||
:arg scroll: Specifies how long a consistent view of the index
|
:arg scroll: Specifies how long a consistent view of the index
|
||||||
should be maintained for scrolled search.
|
should be maintained for scrolled search.
|
||||||
:arg slices: The number of slices this task should be divided
|
: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.
|
Valid choices are auto.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
libraries that do not accept a request body for non-POST requests.
|
libraries that do not accept a request body for non-POST requests.
|
||||||
@@ -2087,9 +2087,9 @@ class AsyncOpenSearch(Client):
|
|||||||
statistics.
|
statistics.
|
||||||
:arg pretty: Whether to pretty format the returned JSON
|
:arg pretty: Whether to pretty format the returned JSON
|
||||||
response.
|
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
|
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.
|
false.
|
||||||
:arg scroll: Period to retain the search context for scrolling.
|
:arg scroll: Period to retain the search context for scrolling.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
:arg timeout: Period to wait for each node to respond.If a node
|
:arg timeout: Period to wait for each node to respond.If a node
|
||||||
does not respond before its timeout expires, the response does not
|
does not respond before its timeout expires, the response does not
|
||||||
include its stats.However, timed out nodes are included in the
|
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(
|
return await self.transport.perform_request(
|
||||||
"GET",
|
"GET",
|
||||||
@@ -656,7 +656,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
to configure backing indices for its data streams. If you use OpenSearch
|
to configure backing indices for its data streams. If you use OpenSearch
|
||||||
Agent and want to overwrite one of these templates, set the `version`
|
Agent and want to overwrite one of these templates, set the `version`
|
||||||
for your replacement template higher than the current version. If you
|
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
|
and index templates, set `stack.templates.enabled` to `false` using the
|
||||||
cluster update settings API.
|
cluster update settings API.
|
||||||
:arg body: The template definition
|
:arg body: The template definition
|
||||||
|
|||||||
@@ -749,8 +749,8 @@ class IndicesClient(NamespacedClient):
|
|||||||
|
|
||||||
|
|
||||||
:arg index: Comma-separated list of data streams, indices, and
|
:arg index: Comma-separated list of data streams, indices, and
|
||||||
aliases used to limit the request. Supports wildcards (`*`). To target
|
aliases used to limit the request.Supports wildcards (`*`).To target all
|
||||||
all data streams and indices, omit this parameter or use `*` or `_all`.
|
data streams and indices, omit this parameter or use `*` or `_all`.
|
||||||
:arg allow_no_indices: If `false`, the request returns an error
|
:arg allow_no_indices: If `false`, the request returns an error
|
||||||
if any wildcard expression, index alias, or `_all` value targets only
|
if any wildcard expression, index alias, or `_all` value targets only
|
||||||
missing or closed indices.This behavior applies even if the request
|
missing or closed indices.This behavior applies even if the request
|
||||||
@@ -874,7 +874,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
:arg index: Comma-separated list of data streams or indices to
|
:arg index: Comma-separated list of data streams or indices to
|
||||||
add. Supports wildcards (`*`). Wildcard patterns that match both data
|
add. Supports wildcards (`*`). Wildcard patterns that match both data
|
||||||
streams and indices return an error.
|
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.
|
request creates it. Index alias names support date math.
|
||||||
:arg body: The settings for the alias, such as `routing` or
|
:arg body: The settings for the alias, such as `routing` or
|
||||||
`filter`
|
`filter`
|
||||||
@@ -1693,6 +1693,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
"expand_wildcards",
|
"expand_wildcards",
|
||||||
"fielddata",
|
"fielddata",
|
||||||
"fields",
|
"fields",
|
||||||
|
"file",
|
||||||
"filter_path",
|
"filter_path",
|
||||||
"human",
|
"human",
|
||||||
"ignore_unavailable",
|
"ignore_unavailable",
|
||||||
@@ -1728,6 +1729,8 @@ class IndicesClient(NamespacedClient):
|
|||||||
`fields` parameter to clear the cache of specific fields only.
|
`fields` parameter to clear the cache of specific fields only.
|
||||||
:arg fields: Comma-separated list of field names used to limit
|
:arg fields: Comma-separated list of field names used to limit
|
||||||
the `fielddata` parameter.
|
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
|
:arg filter_path: Comma-separated list of filters used to reduce
|
||||||
the response.
|
the response.
|
||||||
:arg human: Whether to return human readable values for
|
:arg human: Whether to return human readable values for
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class IngestClient(NamespacedClient):
|
|||||||
|
|
||||||
|
|
||||||
:arg body: The simulate definition
|
: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.
|
the request body, this parameter is required.
|
||||||
:arg error_trace: Whether to include the stack trace of returned
|
:arg error_trace: Whether to include the stack trace of returned
|
||||||
errors.
|
errors.
|
||||||
|
|||||||
@@ -219,16 +219,16 @@ class TransformsClient(NamespacedClient):
|
|||||||
errors.
|
errors.
|
||||||
:arg filter_path: Comma-separated list of filters used to reduce
|
:arg filter_path: Comma-separated list of filters used to reduce
|
||||||
the response.
|
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
|
:arg human: Whether to return human readable values for
|
||||||
statistics.
|
statistics.
|
||||||
:arg pretty: Whether to pretty format the returned JSON
|
:arg pretty: Whether to pretty format the returned JSON
|
||||||
response.
|
response.
|
||||||
:arg search: The search term to use to filter results.
|
:arg search: The search term to use to filter results.
|
||||||
:arg size: Specifies the number of transforms to return. Default
|
:arg size: Specifies the number of transforms to return. Default
|
||||||
is 10.
|
is `10`.
|
||||||
:arg sortDirection: Specifies the direction to sort results in.
|
: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 sortField: The field to sort results with.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
libraries that do not accept a request body for non-POST requests.
|
libraries that do not accept a request body for non-POST requests.
|
||||||
|
|||||||
@@ -339,9 +339,9 @@ class OpenSearch(Client):
|
|||||||
|
|
||||||
|
|
||||||
:arg index: Name of the data stream or index to target. If the
|
: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
|
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.
|
stream template, this request creates the index.
|
||||||
:arg id: Unique identifier for the document.
|
:arg id: Unique identifier for the document.
|
||||||
:arg body: The document
|
:arg body: The document
|
||||||
@@ -536,7 +536,7 @@ class OpenSearch(Client):
|
|||||||
shards to make this operation visible to search, if `wait_for` then wait
|
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
|
for a refresh to make this operation visible to search, if `false` do
|
||||||
nothing with refreshes.Valid values: `true`, `false`, `wait_for`.
|
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.
|
an index alias. Default is false.
|
||||||
:arg routing: Custom value used to route operations to a
|
:arg routing: Custom value used to route operations to a
|
||||||
specific shard.
|
specific shard.
|
||||||
@@ -1934,7 +1934,7 @@ class OpenSearch(Client):
|
|||||||
:arg scroll: Specifies how long a consistent view of the index
|
:arg scroll: Specifies how long a consistent view of the index
|
||||||
should be maintained for scrolled search.
|
should be maintained for scrolled search.
|
||||||
:arg slices: The number of slices this task should be divided
|
: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.
|
Valid choices are auto.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
libraries that do not accept a request body for non-POST requests.
|
libraries that do not accept a request body for non-POST requests.
|
||||||
@@ -2087,9 +2087,9 @@ class OpenSearch(Client):
|
|||||||
statistics.
|
statistics.
|
||||||
:arg pretty: Whether to pretty format the returned JSON
|
:arg pretty: Whether to pretty format the returned JSON
|
||||||
response.
|
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
|
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.
|
false.
|
||||||
:arg scroll: Period to retain the search context for scrolling.
|
:arg scroll: Period to retain the search context for scrolling.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
:arg timeout: Period to wait for each node to respond.If a node
|
:arg timeout: Period to wait for each node to respond.If a node
|
||||||
does not respond before its timeout expires, the response does not
|
does not respond before its timeout expires, the response does not
|
||||||
include its stats.However, timed out nodes are included in the
|
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(
|
return self.transport.perform_request(
|
||||||
"GET",
|
"GET",
|
||||||
@@ -656,7 +656,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
to configure backing indices for its data streams. If you use OpenSearch
|
to configure backing indices for its data streams. If you use OpenSearch
|
||||||
Agent and want to overwrite one of these templates, set the `version`
|
Agent and want to overwrite one of these templates, set the `version`
|
||||||
for your replacement template higher than the current version. If you
|
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
|
and index templates, set `stack.templates.enabled` to `false` using the
|
||||||
cluster update settings API.
|
cluster update settings API.
|
||||||
:arg body: The template definition
|
:arg body: The template definition
|
||||||
|
|||||||
@@ -749,8 +749,8 @@ class IndicesClient(NamespacedClient):
|
|||||||
|
|
||||||
|
|
||||||
:arg index: Comma-separated list of data streams, indices, and
|
:arg index: Comma-separated list of data streams, indices, and
|
||||||
aliases used to limit the request. Supports wildcards (`*`). To target
|
aliases used to limit the request.Supports wildcards (`*`).To target all
|
||||||
all data streams and indices, omit this parameter or use `*` or `_all`.
|
data streams and indices, omit this parameter or use `*` or `_all`.
|
||||||
:arg allow_no_indices: If `false`, the request returns an error
|
:arg allow_no_indices: If `false`, the request returns an error
|
||||||
if any wildcard expression, index alias, or `_all` value targets only
|
if any wildcard expression, index alias, or `_all` value targets only
|
||||||
missing or closed indices.This behavior applies even if the request
|
missing or closed indices.This behavior applies even if the request
|
||||||
@@ -874,7 +874,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
:arg index: Comma-separated list of data streams or indices to
|
:arg index: Comma-separated list of data streams or indices to
|
||||||
add. Supports wildcards (`*`). Wildcard patterns that match both data
|
add. Supports wildcards (`*`). Wildcard patterns that match both data
|
||||||
streams and indices return an error.
|
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.
|
request creates it. Index alias names support date math.
|
||||||
:arg body: The settings for the alias, such as `routing` or
|
:arg body: The settings for the alias, such as `routing` or
|
||||||
`filter`
|
`filter`
|
||||||
@@ -1693,6 +1693,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
"expand_wildcards",
|
"expand_wildcards",
|
||||||
"fielddata",
|
"fielddata",
|
||||||
"fields",
|
"fields",
|
||||||
|
"file",
|
||||||
"filter_path",
|
"filter_path",
|
||||||
"human",
|
"human",
|
||||||
"ignore_unavailable",
|
"ignore_unavailable",
|
||||||
@@ -1728,6 +1729,8 @@ class IndicesClient(NamespacedClient):
|
|||||||
`fields` parameter to clear the cache of specific fields only.
|
`fields` parameter to clear the cache of specific fields only.
|
||||||
:arg fields: Comma-separated list of field names used to limit
|
:arg fields: Comma-separated list of field names used to limit
|
||||||
the `fielddata` parameter.
|
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
|
:arg filter_path: Comma-separated list of filters used to reduce
|
||||||
the response.
|
the response.
|
||||||
:arg human: Whether to return human readable values for
|
:arg human: Whether to return human readable values for
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class IngestClient(NamespacedClient):
|
|||||||
|
|
||||||
|
|
||||||
:arg body: The simulate definition
|
: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.
|
the request body, this parameter is required.
|
||||||
:arg error_trace: Whether to include the stack trace of returned
|
:arg error_trace: Whether to include the stack trace of returned
|
||||||
errors.
|
errors.
|
||||||
|
|||||||
@@ -219,16 +219,16 @@ class TransformsClient(NamespacedClient):
|
|||||||
errors.
|
errors.
|
||||||
:arg filter_path: Comma-separated list of filters used to reduce
|
:arg filter_path: Comma-separated list of filters used to reduce
|
||||||
the response.
|
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
|
:arg human: Whether to return human readable values for
|
||||||
statistics.
|
statistics.
|
||||||
:arg pretty: Whether to pretty format the returned JSON
|
:arg pretty: Whether to pretty format the returned JSON
|
||||||
response.
|
response.
|
||||||
:arg search: The search term to use to filter results.
|
:arg search: The search term to use to filter results.
|
||||||
:arg size: Specifies the number of transforms to return. Default
|
:arg size: Specifies the number of transforms to return. Default
|
||||||
is 10.
|
is `10`.
|
||||||
:arg sortDirection: Specifies the direction to sort results in.
|
: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 sortField: The field to sort results with.
|
||||||
:arg source: The URL-encoded request definition. Useful for
|
:arg source: The URL-encoded request definition. Useful for
|
||||||
libraries that do not accept a request body for non-POST requests.
|
libraries that do not accept a request body for non-POST requests.
|
||||||
|
|||||||
Reference in New Issue
Block a user