Skip to content

Commit

Permalink
Generate new version of the client code with the correct argument order
Browse files Browse the repository at this point in the history
Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com>
  • Loading branch information
Tenzer committed Aug 22, 2024
1 parent eec018b commit 4be23a6
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 114 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed the use of `minimum_should_match` with `Bool` to allow the use of string-based value (percent string, combination). ([#780](https://github.com/opensearch-project/opensearch-py/pull/780))
- Fixed incorrect `retry_on_conflict` type ([#795](https://github.com/opensearch-project/opensearch-py/pull/795))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@b28c1cf](https://github.com/opensearch-project/opensearch-api-specification/commit/b28c1cfaf4a76d786c789929eaa7fabffd09cb99)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@9d3bc34](https://github.com/opensearch-project/opensearch-api-specification/commit/9d3bc340ccd7d049e7d6e14a4aff2293780cb446)
### Security
### Dependencies
Expand Down
114 changes: 57 additions & 57 deletions opensearchpy/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,63 +852,6 @@ async def get_field_mapping(
headers=headers,
)

@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def put_alias(
self,
body: Any = None,
index: Any = None,
name: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or updates an alias.
:arg body: The settings for the alias, such as `routing` or
`filter`
: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
request creates it. Index alias names support date math.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"PUT",
_make_path(index, "_alias", name),
params=params,
headers=headers,
body=body,
)

@query_params(
"allow_no_indices",
"error_trace",
Expand Down Expand Up @@ -2766,3 +2709,60 @@ async def data_streams_stats(
params=params,
headers=headers,
)

@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def put_alias(
self,
index: Any = None,
name: Any = None,
body: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or updates an alias.
:arg body: The settings for the alias, such as `routing` or
`filter`
: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
request creates it. Index alias names support date math.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(

Check warning on line 2762 in opensearchpy/_async/client/indices.py

View check run for this annotation

Codecov / codecov/patch

opensearchpy/_async/client/indices.py#L2762

Added line #L2762 was not covered by tests
"PUT",
_make_path(index, "_alias", name),
params=params,
headers=headers,
body=body,
)
114 changes: 57 additions & 57 deletions opensearchpy/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,63 +852,6 @@ def get_field_mapping(
headers=headers,
)

@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def put_alias(
self,
body: Any = None,
index: Any = None,
name: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or updates an alias.
:arg body: The settings for the alias, such as `routing` or
`filter`
: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
request creates it. Index alias names support date math.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"PUT",
_make_path(index, "_alias", name),
params=params,
headers=headers,
body=body,
)

@query_params(
"allow_no_indices",
"error_trace",
Expand Down Expand Up @@ -2766,3 +2709,60 @@ def data_streams_stats(
params=params,
headers=headers,
)

@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def put_alias(
self,
index: Any = None,
name: Any = None,
body: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or updates an alias.
:arg body: The settings for the alias, such as `routing` or
`filter`
: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
request creates it. Index alias names support date math.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"PUT",
_make_path(index, "_alias", name),
params=params,
headers=headers,
body=body,
)

0 comments on commit 4be23a6

Please sign in to comment.