Skip to content

Commit 5de337b

Browse files
saimedhigithub-actions[bot]
authored andcommitted
Updated opensearch-py to reflect the latest OpenSearch API spec (2025-05-21)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1a18e58 commit 5de337b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+7277
-2088
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
- Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863))
77
- Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859))
88
### Updated APIs
9+
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3d086c0](https://github.com/opensearch-project/opensearch-api-specification/commit/3d086c000f24551662dfb99dc9f9b647edfabf61)
910
### Changed
1011
- Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866))
1112
- Small refactor to fix overwriting the module files when generating apis ([874](https://github.com/opensearch-project/opensearch-py/pull/874))

opensearchpy/_async/client/__init__.py

Lines changed: 46 additions & 59 deletions
Large diffs are not rendered by default.

opensearchpy/_async/client/cat.py

Lines changed: 341 additions & 334 deletions
Large diffs are not rendered by default.

opensearchpy/_async/client/cluster.py

Lines changed: 194 additions & 212 deletions
Large diffs are not rendered by default.

opensearchpy/_async/client/indices.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async def create(
236236
:arg wait_for_active_shards: The number of shard copies that
237237
must be active before proceeding with the operation. Set to `all` or
238238
any positive integer up to the total number of shards in the index
239-
(`number_of_replicas+1`). Valid choices are all, index-setting.
239+
(`number_of_replicas+1`).
240240
"""
241241
if index in SKIP_IN_PATH:
242242
raise ValueError("Empty value passed for a required argument 'index'.")
@@ -300,7 +300,7 @@ async def clone(
300300
:arg wait_for_active_shards: The number of shard copies that
301301
must be active before proceeding with the operation. Set to `all` or any
302302
positive integer up to the total number of shards in the index
303-
(`number_of_replicas+1`). Valid choices are all, index-setting.
303+
(`number_of_replicas+1`).
304304
:arg wait_for_completion: Should this request wait until the
305305
operation has completed before returning. Default is True.
306306
"""
@@ -459,7 +459,7 @@ async def open(
459459
:arg wait_for_active_shards: The number of shard copies that
460460
must be active before proceeding with the operation. Set to `all` or any
461461
positive integer up to the total number of shards in the index
462-
(`number_of_replicas+1`). Valid choices are all, index-setting.
462+
(`number_of_replicas+1`).
463463
:arg wait_for_completion: Should this request wait until the
464464
operation has completed before returning. Default is True.
465465
"""
@@ -531,7 +531,7 @@ async def close(
531531
:arg wait_for_active_shards: The number of shard copies that
532532
must be active before proceeding with the operation. Set to `all` or any
533533
positive integer up to the total number of shards in the index
534-
(`number_of_replicas+1`). Valid choices are all, index-setting.
534+
(`number_of_replicas+1`).
535535
"""
536536
if index in SKIP_IN_PATH:
537537
raise ValueError("Empty value passed for a required argument 'index'.")
@@ -1638,7 +1638,7 @@ async def validate_query(
16381638
parameter can only be used when the `q` query string parameter is
16391639
specified.
16401640
:arg default_operator: The default operator for query string
1641-
query: `AND` or `OR`. Valid choices are and, or.
1641+
query: `AND` or `OR`. Valid choices are and, AND, or, OR.
16421642
:arg df: Field to use as default where no field prefix is given
16431643
in the query string. This parameter can only be used when the `q` query
16441644
string parameter is specified.
@@ -2053,7 +2053,7 @@ async def shrink(
20532053
:arg wait_for_active_shards: The number of shard copies that
20542054
must be active before proceeding with the operation. Set to `all` or any
20552055
positive integer up to the total number of shards in the index
2056-
(`number_of_replicas+1`). Valid choices are all, index-setting.
2056+
(`number_of_replicas+1`).
20572057
:arg wait_for_completion: Should this request wait until the
20582058
operation has completed before returning. Default is True.
20592059
"""
@@ -2128,7 +2128,7 @@ async def split(
21282128
:arg wait_for_active_shards: The number of shard copies that
21292129
must be active before proceeding with the operation. Set to `all` or any
21302130
positive integer up to the total number of shards in the index
2131-
(`number_of_replicas+1`). Valid choices are all, index-setting.
2131+
(`number_of_replicas+1`).
21322132
:arg wait_for_completion: Should this request wait until the
21332133
operation has completed before returning. Default is True.
21342134
"""
@@ -2201,7 +2201,7 @@ async def rollover(
22012201
:arg wait_for_active_shards: The number of shard copies that
22022202
must be active before proceeding with the operation. Set to all or any
22032203
positive integer up to the total number of shards in the index
2204-
(`number_of_replicas+1`). Valid choices are all, index-setting.
2204+
(`number_of_replicas+1`).
22052205
"""
22062206
if alias in SKIP_IN_PATH:
22072207
raise ValueError("Empty value passed for a required argument 'alias'.")

opensearchpy/_async/client/ingest.py

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ async def get_pipeline(
5656
headers: Any = None,
5757
) -> Any:
5858
"""
59-
Returns a pipeline.
59+
Returns an ingest pipeline.
6060
6161
62-
:arg id: Comma-separated list of pipeline IDs to retrieve.
62+
:arg id: A comma-separated list of pipeline IDs to retrieve.
6363
Wildcard (`*`) expressions are supported. To get all ingest pipelines,
6464
omit this parameter or use `*`.
65-
:arg cluster_manager_timeout: Operation timeout for connection
66-
to cluster-manager node.
65+
:arg cluster_manager_timeout: The amount of time allowed to
66+
establish a connection to the cluster manager node.
6767
:arg error_trace: Whether to include the stack trace of returned
6868
errors. Default is false.
6969
:arg filter_path: Used to reduce the response. This parameter
@@ -103,13 +103,13 @@ async def put_pipeline(
103103
headers: Any = None,
104104
) -> Any:
105105
"""
106-
Creates or updates a pipeline.
106+
Creates or updates an ingest pipeline.
107107
108108
109-
:arg id: ID of the ingest pipeline to create or update.
110-
:arg body: The ingest definition
111-
:arg cluster_manager_timeout: Operation timeout for connection
112-
to cluster-manager node.
109+
:arg id: The ID of the ingest pipeline.
110+
:arg body: The ingest definition.
111+
:arg cluster_manager_timeout: The amount of time allowed to
112+
establish a connection to the cluster manager node.
113113
:arg error_trace: Whether to include the stack trace of returned
114114
errors. Default is false.
115115
:arg filter_path: Used to reduce the response. This parameter
@@ -126,9 +126,7 @@ async def put_pipeline(
126126
response. Default is false.
127127
:arg source: The URL-encoded request definition. Useful for
128128
libraries that do not accept a request body for non-POST requests.
129-
:arg timeout: Period to wait for a response. If no response is
130-
received before the timeout expires, the request fails and returns an
131-
error.
129+
:arg timeout: The amount of time to wait for a response.
132130
"""
133131
for param in (id, body):
134132
if param in SKIP_IN_PATH:
@@ -159,14 +157,14 @@ async def delete_pipeline(
159157
headers: Any = None,
160158
) -> Any:
161159
"""
162-
Deletes a pipeline.
160+
Deletes an ingest pipeline.
163161
164162
165-
:arg id: Pipeline ID or wildcard expression of pipeline IDs used
166-
to limit the request. To delete all ingest pipelines in a cluster, use a
167-
value of `*`.
168-
:arg cluster_manager_timeout: Operation timeout for connection
169-
to cluster-manager node.
163+
:arg id: The pipeline ID or wildcard expression of pipeline IDs
164+
used to limit the request. To delete all ingest pipelines in a cluster,
165+
use a value of `*`.
166+
:arg cluster_manager_timeout: The amount of time allowed to
167+
establish a connection to the cluster manager node.
170168
:arg error_trace: Whether to include the stack trace of returned
171169
errors. Default is false.
172170
:arg filter_path: Used to reduce the response. This parameter
@@ -183,9 +181,7 @@ async def delete_pipeline(
183181
response. Default is false.
184182
:arg source: The URL-encoded request definition. Useful for
185183
libraries that do not accept a request body for non-POST requests.
186-
:arg timeout: Period to wait for a response. If no response is
187-
received before the timeout expires, the request fails and returns an
188-
error.
184+
:arg timeout: The amount of time to wait for a response.
189185
"""
190186
if id in SKIP_IN_PATH:
191187
raise ValueError("Empty value passed for a required argument 'id'.")
@@ -206,12 +202,12 @@ async def simulate(
206202
headers: Any = None,
207203
) -> Any:
208204
"""
209-
Allows to simulate a pipeline with example documents.
205+
Simulates an ingest pipeline with example documents.
210206
211207
212208
:arg body: The simulate definition
213-
:arg id: Pipeline to test. If you don't specify a `pipeline` in
214-
the request body, this parameter is required.
209+
:arg id: The pipeline to test. If you don't specify a `pipeline`
210+
in the request body, this parameter is required.
215211
:arg error_trace: Whether to include the stack trace of returned
216212
errors. Default is false.
217213
:arg filter_path: Used to reduce the response. This parameter
@@ -224,8 +220,8 @@ async def simulate(
224220
response. Default is false.
225221
:arg source: The URL-encoded request definition. Useful for
226222
libraries that do not accept a request body for non-POST requests.
227-
:arg verbose: If `true`, the response includes output data for
228-
each processor in the executed pipeline. Default is false.
223+
:arg verbose: When `true`, the response includes output data for
224+
each processor in the pipeline Default is false.
229225
"""
230226
if body in SKIP_IN_PATH:
231227
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -245,7 +241,7 @@ async def processor_grok(
245241
headers: Any = None,
246242
) -> Any:
247243
"""
248-
Returns a list of the built-in patterns.
244+
Returns a list of built-in grok patterns.
249245
250246
251247
:arg error_trace: Whether to include the stack trace of returned
@@ -258,7 +254,8 @@ async def processor_grok(
258254
statistics. Default is True.
259255
:arg pretty: Whether to pretty format the returned JSON
260256
response. Default is false.
261-
:arg s: Sort returned patterns by key name. Default is false.
257+
:arg s: Determines how to sort returned grok patterns by key
258+
name. Default is false.
262259
:arg source: The URL-encoded request definition. Useful for
263260
libraries that do not accept a request body for non-POST requests.
264261
"""

opensearchpy/_async/client/list.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ async def indices(
8787
:arg index: Comma-separated list of data streams, indexes, and
8888
aliases used to limit the request. Supports wildcards (`*`). To target
8989
all data streams and indexes, omit this parameter or use `*` or `_all`.
90-
:arg bytes: The unit used to display byte values. Valid choices
91-
are b, g, gb, k, kb, m, mb, p, pb, t, tb.
90+
:arg bytes: The unit used to display byte values.
9291
:arg cluster_manager_timeout: Operation timeout for connection
9392
to cluster-manager node.
9493
:arg error_trace: Whether to include the stack trace of returned
@@ -103,8 +102,7 @@ async def indices(
103102
`JSON`, `YAML`.
104103
:arg h: Comma-separated list of column names to display.
105104
:arg health: The health status used to limit returned indexes.
106-
By default, the response includes indexes of any health status. Valid
107-
choices are green, red, yellow.
105+
By default, the response includes indexes of any health status.
108106
:arg help: Return help information. Default is false.
109107
:arg human: Whether to return human readable values for
110108
statistics. Default is True.
@@ -129,8 +127,7 @@ async def indices(
129127
indexes would be displayed first. Valid choices are asc, desc.
130128
:arg source: The URL-encoded request definition. Useful for
131129
libraries that do not accept a request body for non-POST requests.
132-
:arg time: The unit used to display time values. Valid choices
133-
are d, h, m, micros, ms, nanos, s.
130+
:arg time: The unit used to display time values.
134131
:arg v: Verbose mode. Display column headers. Default is false.
135132
"""
136133
return await self.transport.perform_request(
@@ -170,8 +167,7 @@ async def shards(
170167
:arg index: A comma-separated list of data streams, indexes, and
171168
aliases used to limit the request. Supports wildcards (`*`). To target
172169
all data streams and indexes, omit this parameter or use `*` or `_all`.
173-
:arg bytes: The unit used to display byte values. Valid choices
174-
are b, g, gb, k, kb, m, mb, p, pb, t, tb.
170+
:arg bytes: The unit used to display byte values.
175171
:arg cluster_manager_timeout: Operation timeout for connection
176172
to cluster-manager node.
177173
:arg error_trace: Whether to include the stack trace of returned
@@ -202,8 +198,7 @@ async def shards(
202198
shards would be displayed first. Valid choices are asc, desc.
203199
:arg source: The URL-encoded request definition. Useful for
204200
libraries that do not accept a request body for non-POST requests.
205-
:arg time: The unit in which to display time values. Valid
206-
choices are d, h, m, micros, ms, nanos, s.
201+
:arg time: The unit in which to display time values.
207202
:arg v: Verbose mode. Display column headers. Default is false.
208203
"""
209204
return await self.transport.perform_request(

0 commit comments

Comments
 (0)