Skip to content

Commit

Permalink
Generate opensearch-py client from API specs
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Oct 16, 2023
1 parent fa8f3a7 commit 840cd86
Show file tree
Hide file tree
Showing 9 changed files with 1,045 additions and 1,149 deletions.
1,047 changes: 502 additions & 545 deletions opensearchpy/_async/client/__init__.py

Large diffs are not rendered by default.

35 changes: 12 additions & 23 deletions opensearchpy/_async/client/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
# specific language governing permissions and limitations
# under the License.

# ----------------------------------------------------
# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST.
#
# To contribute, kindly make essential modifications through either the "opensearch-py client generator":
# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py
# or the "OpenSearch API specification" available at:
# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json
# -----------------------------------------------------

from __future__ import unicode_literals

import logging
Expand Down Expand Up @@ -333,8 +342,8 @@ class AsyncOpenSearch(object):
self,
id: Any,
*,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
Expand Down Expand Up @@ -490,8 +499,8 @@ class AsyncOpenSearch(object):
self,
id: Any,
*,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
Expand Down Expand Up @@ -642,8 +651,8 @@ class AsyncOpenSearch(object):
*,
body: Any,
context: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
Expand Down Expand Up @@ -802,7 +811,6 @@ class AsyncOpenSearch(object):
ignore_unavailable: Optional[Any] = ...,
lenient: Optional[Any] = ...,
max_concurrent_shard_requests: Optional[Any] = ...,
min_compatible_shard_node: Optional[Any] = ...,
pre_filter_shard_size: Optional[Any] = ...,
preference: Optional[Any] = ...,
q: Optional[Any] = ...,
Expand Down Expand Up @@ -991,7 +999,6 @@ class AsyncOpenSearch(object):
terminate_after: Optional[Any] = ...,
timeout: Optional[Any] = ...,
version: Optional[Any] = ...,
version_type: Optional[Any] = ...,
wait_for_active_shards: Optional[Any] = ...,
wait_for_completion: Optional[Any] = ...,
pretty: Optional[bool] = ...,
Expand Down Expand Up @@ -1128,21 +1135,3 @@ class AsyncOpenSearch(object):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def terms_enum(
self,
index: Any,
*,
body: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
2 changes: 1 addition & 1 deletion opensearchpy/_async/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def simulate(self, body, id=None, params=None, headers=None):
:arg body: The simulate definition
:arg id: Pipeline ID.
:arg verbose: Verbose mode. Display data output for each
processor in executed pipeline.
processor in executed pipeline. (default: false)
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
Expand Down
9 changes: 5 additions & 4 deletions opensearchpy/_async/client/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ async def list(self, params=None, headers=None):
:arg actions: Comma-separated list of actions that should be
returned. Leave empty to return all.
:arg detailed: Return detailed task information.
:arg detailed: Return detailed task information. (default:
false)
:arg group_by: Group tasks by nodes or parent/child
relationships. Valid choices: nodes, parents, none
:arg nodes: Comma-separated list of node IDs or names to limit
Expand All @@ -68,7 +69,7 @@ async def list(self, params=None, headers=None):
(node_id:task_number). Set to -1 to return all.
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning.
operation has completed before returning. (default: false)
"""
return await self.transport.perform_request(
"GET", "/_tasks", params=params, headers=headers
Expand All @@ -91,7 +92,7 @@ async def cancel(self, task_id=None, params=None, headers=None):
:arg parent_task_id: Cancel tasks with specified parent task id
(node_id:task_number). Set to -1 to cancel all.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning.
operation has completed before returning. (default: false)
"""
return await self.transport.perform_request(
"POST",
Expand All @@ -110,7 +111,7 @@ async def get(self, task_id=None, params=None, headers=None):
(node_id:task_number).
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning.
operation has completed before returning. (default: false)
"""
if task_id in SKIP_IN_PATH:
warnings.warn(
Expand Down
Loading

0 comments on commit 840cd86

Please sign in to comment.