Skip to content

Commit

Permalink
Updated opensearch-py to reflect the latest OpenSearch API spec (2024…
Browse files Browse the repository at this point in the history
…-07-12)

Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
saimedhi committed Jul 12, 2024
1 parent f0bce7c commit b1922b1
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions opensearchpy/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ async def create(
:arg index: Name of the data stream or index to target. If the
target doesnt 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 doesnt exist and doesnt 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
Expand Down Expand Up @@ -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 requests 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.
Expand Down Expand Up @@ -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 isnt 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.
Expand Down Expand Up @@ -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 responses
:arg rest_total_hits_as_int: If true, the API response's
hit.total property is returned as an integer. If false, the API
responses 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
Expand Down
4 changes: 2 additions & 2 deletions opensearchpy/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
responses `_nodes.failed` property. Defaults to no timeout.
response's `_nodes.failed` property. Defaults to no timeout.
"""
return await self.transport.perform_request(
"GET",
Expand Down Expand Up @@ -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
dont 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
Expand Down
9 changes: 6 additions & 3 deletions opensearchpy/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 doesnt 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`
Expand Down Expand Up @@ -1693,6 +1693,7 @@ async def validate_query(
"expand_wildcards",
"fielddata",
"fields",
"file",
"filter_path",
"human",
"ignore_unavailable",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/_async/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async def simulate(
:arg body: The simulate definition
:arg id: Pipeline to test. If you dont 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.
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/_async/plugins/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions opensearchpy/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ def create(
:arg index: Name of the data stream or index to target. If the
target doesnt 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 doesnt exist and doesnt 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
Expand Down Expand Up @@ -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 requests 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.
Expand Down Expand Up @@ -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 isnt 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.
Expand Down Expand Up @@ -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 responses
:arg rest_total_hits_as_int: If true, the API response's
hit.total property is returned as an integer. If false, the API
responses 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
Expand Down
4 changes: 2 additions & 2 deletions opensearchpy/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
responses `_nodes.failed` property. Defaults to no timeout.
response's `_nodes.failed` property. Defaults to no timeout.
"""
return self.transport.perform_request(
"GET",
Expand Down Expand Up @@ -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
dont 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
Expand Down
9 changes: 6 additions & 3 deletions opensearchpy/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 doesnt 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`
Expand Down Expand Up @@ -1693,6 +1693,7 @@ def validate_query(
"expand_wildcards",
"fielddata",
"fields",
"file",
"filter_path",
"human",
"ignore_unavailable",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def simulate(
:arg body: The simulate definition
:arg id: Pipeline to test. If you dont 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.
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/plugins/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b1922b1

Please sign in to comment.