Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated generated "ingest" client APIs into the existing module #513

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added point-in-time APIs (create_pit, delete_pit, delete_all_pits, get_all_pits) and Security Client APIs (health and update_audit_configuration) ([#502](https://github.com/opensearch-project/opensearch-py/pull/502))
### Changed
- Integrated generated `tasks client` APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility ([#508](https://github.com/opensearch-project/opensearch-py/pull/508))
- Integrated generated `ingest client` APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility ([#513](https://github.com/opensearch-project/opensearch-py/pull/513))
### Deprecated
- Deprecated point-in-time APIs (list_all_point_in_time, create_point_in_time, delete_point_in_time) and Security Client APIs (health_check and update_audit_config) ([#502](https://github.com/opensearch-project/opensearch-py/pull/502))
### Removed
Expand Down
71 changes: 36 additions & 35 deletions opensearchpy/_async/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,52 @@
# 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 .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params


class IngestClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "summary")
@query_params("cluster_manager_timeout", "master_timeout")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this is correct?

Copy link
Collaborator Author

@saimedhi saimedhi Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async def get_pipeline(self, id=None, params=None, headers=None):
"""
Returns a pipeline.


:arg id: Comma separated list of pipeline ids. Wildcards
supported
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg summary: Return pipelines without their definitions
(default: false)
:arg id: Comma-separated list of pipeline ids. Wildcards
supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
"""
return await self.transport.perform_request(
"GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers
)

@query_params("master_timeout", "cluster_manager_timeout", "timeout")
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
async def put_pipeline(self, id, body, params=None, headers=None):
"""
Creates or updates a pipeline.


:arg id: Pipeline ID
:arg id: Pipeline ID.
:arg body: The ingest definition
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg timeout: Explicit operation timeout
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
:arg timeout: Operation timeout.
"""
for param in (id, body):
if param in SKIP_IN_PATH:
Expand All @@ -74,18 +84,19 @@ async def put_pipeline(self, id, body, params=None, headers=None):
body=body,
)

@query_params("master_timeout", "cluster_manager_timeout", "timeout")
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
async def delete_pipeline(self, id, params=None, headers=None):
"""
Deletes a pipeline.


:arg id: Pipeline ID
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg timeout: Explicit operation timeout
:arg id: Pipeline ID.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
:arg timeout: Operation timeout.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
Expand All @@ -104,9 +115,9 @@ async def simulate(self, body, id=None, params=None, headers=None):


:arg body: The simulate definition
:arg id: Pipeline ID
:arg id: Pipeline ID.
:arg verbose: Verbose mode. Display data output for each
processor in executed pipeline
processor in executed pipeline.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
Expand All @@ -128,13 +139,3 @@ async def processor_grok(self, params=None, headers=None):
return await self.transport.perform_request(
"GET", "/_ingest/processor/grok", params=params, headers=headers
)

@query_params()
async def geo_ip_stats(self, params=None, headers=None):
"""
Returns statistical information about geoip databases

"""
return await self.transport.perform_request(
"GET", "/_ingest/geoip/stats", params=params, headers=headers
)
32 changes: 12 additions & 20 deletions opensearchpy/_async/client/ingest.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 typing import Any, Collection, MutableMapping, Optional, Tuple, Union

from .utils import NamespacedClient
Expand All @@ -33,9 +42,8 @@ class IngestClient(NamespacedClient):
self,
*,
id: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
summary: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
Expand All @@ -54,8 +62,8 @@ class IngestClient(NamespacedClient):
id: Any,
*,
body: Any,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
Expand All @@ -74,8 +82,8 @@ class IngestClient(NamespacedClient):
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 @@ -125,19 +133,3 @@ class IngestClient(NamespacedClient):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def geo_ip_stats(
self,
*,
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: ...
71 changes: 36 additions & 35 deletions opensearchpy/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,52 @@
# 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 .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params


class IngestClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "summary")
@query_params("cluster_manager_timeout", "master_timeout")
def get_pipeline(self, id=None, params=None, headers=None):
"""
Returns a pipeline.


:arg id: Comma separated list of pipeline ids. Wildcards
supported
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg summary: Return pipelines without their definitions
(default: false)
:arg id: Comma-separated list of pipeline ids. Wildcards
supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
"""
return self.transport.perform_request(
"GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers
)

@query_params("master_timeout", "cluster_manager_timeout", "timeout")
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
def put_pipeline(self, id, body, params=None, headers=None):
"""
Creates or updates a pipeline.


:arg id: Pipeline ID
:arg id: Pipeline ID.
:arg body: The ingest definition
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg timeout: Explicit operation timeout
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
:arg timeout: Operation timeout.
"""
for param in (id, body):
if param in SKIP_IN_PATH:
Expand All @@ -74,18 +84,19 @@ def put_pipeline(self, id, body, params=None, headers=None):
body=body,
)

@query_params("master_timeout", "cluster_manager_timeout", "timeout")
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
def delete_pipeline(self, id, params=None, headers=None):
"""
Deletes a pipeline.


:arg id: Pipeline ID
:arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection
to master node
:arg cluster_manager_timeout: Explicit operation timeout for connection
to cluster_manager node
:arg timeout: Explicit operation timeout
:arg id: Pipeline ID.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead): Operation timeout for connection
to master node.
:arg timeout: Operation timeout.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
Expand All @@ -104,9 +115,9 @@ def simulate(self, body, id=None, params=None, headers=None):


:arg body: The simulate definition
:arg id: Pipeline ID
:arg id: Pipeline ID.
:arg verbose: Verbose mode. Display data output for each
processor in executed pipeline
processor in executed pipeline.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
Expand All @@ -128,13 +139,3 @@ def processor_grok(self, params=None, headers=None):
return self.transport.perform_request(
"GET", "/_ingest/processor/grok", params=params, headers=headers
)

@query_params()
def geo_ip_stats(self, params=None, headers=None):
"""
Returns statistical information about geoip databases

"""
return self.transport.perform_request(
"GET", "/_ingest/geoip/stats", params=params, headers=headers
)
32 changes: 12 additions & 20 deletions opensearchpy/client/ingest.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 typing import Any, Collection, MutableMapping, Optional, Tuple, Union

from .utils import NamespacedClient
Expand All @@ -33,9 +42,8 @@ class IngestClient(NamespacedClient):
self,
*,
id: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
summary: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
Expand All @@ -54,8 +62,8 @@ class IngestClient(NamespacedClient):
id: Any,
*,
body: Any,
master_timeout: Optional[Any] = ...,
cluster_manager_timeout: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
Expand All @@ -74,8 +82,8 @@ class IngestClient(NamespacedClient):
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 @@ -125,19 +133,3 @@ class IngestClient(NamespacedClient):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
def geo_ip_stats(
self,
*,
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: ...
Loading
Loading