diff --git a/CHANGELOG.md b/CHANGELOG.md index 8515188e..3ca24f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] ### Added ### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@8f4b485](https://github.com/opensearch-project/opensearch-api-specification/commit/8f4b485f22e80570fa2370b5a5c349897758ac12) - Updated opensearch-py APIs to reflect [opensearch-api-specification@3be80d7](https://github.com/opensearch-project/opensearch-api-specification/commit/3be80d700cccc60093ad6265a9582572c0b1e9f4) - Updated opensearch-py APIs to reflect [opensearch-api-specification@89c586c](https://github.com/opensearch-project/opensearch-api-specification/commit/89c586cfe65584f789e8fccc5f6c416cee1e8b3b) - Updated opensearch-py APIs to reflect [opensearch-api-specification@cac8c5d](https://github.com/opensearch-project/opensearch-api-specification/commit/cac8c5d8ab39c702c6c428cfdc3a3a710cf2c0b0) diff --git a/opensearchpy/_async/client/plugins.py b/opensearchpy/_async/client/plugins.py index 69dcb9da..01ed6240 100644 --- a/opensearchpy/_async/client/plugins.py +++ b/opensearchpy/_async/client/plugins.py @@ -30,11 +30,13 @@ from ..plugins.sm import SmClient from ..plugins.sql import SqlClient from ..plugins.transforms import TransformsClient +from ..plugins.ubi import UbiClient from .client import Client from .utils import NamespacedClient class PluginsClient(NamespacedClient): + ubi: Any security_analytics: Any search_relevance: Any sm: Any @@ -57,6 +59,7 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super().__init__(client) + self.ubi = UbiClient(client) self.security_analytics = SecurityAnalyticsClient(client) self.search_relevance = SearchRelevanceClient(client) self.sm = SmClient(client) @@ -84,6 +87,7 @@ def _dynamic_lookup(self, client: Any) -> None: # Issue : https://github.com/opensearch-project/opensearch-py/issues/90#issuecomment-1003396742 plugins = [ + "ubi", "security_analytics", "search_relevance", "sm", diff --git a/opensearchpy/_async/plugins/ubi.py b/opensearchpy/_async/plugins/ubi.py new file mode 100644 index 00000000..6b367c14 --- /dev/null +++ b/opensearchpy/_async/plugins/ubi.py @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import NamespacedClient, query_params + + +class UbiClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def initialize( + self, + *, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Initializes the UBI indexes. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: A comma-separated list of filters used to + filter the response. Use wildcards to match any field or part of a + field's name. To exclude fields, use `-`. + :arg human: Whether to return human-readable values for + statistics. Default is false. + :arg pretty: Whether to pretty-format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "POST", "/_plugins/ubi/initialize", params=params, headers=headers + ) diff --git a/opensearchpy/client/plugins.py b/opensearchpy/client/plugins.py index 69dcb9da..01ed6240 100644 --- a/opensearchpy/client/plugins.py +++ b/opensearchpy/client/plugins.py @@ -30,11 +30,13 @@ from ..plugins.sm import SmClient from ..plugins.sql import SqlClient from ..plugins.transforms import TransformsClient +from ..plugins.ubi import UbiClient from .client import Client from .utils import NamespacedClient class PluginsClient(NamespacedClient): + ubi: Any security_analytics: Any search_relevance: Any sm: Any @@ -57,6 +59,7 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super().__init__(client) + self.ubi = UbiClient(client) self.security_analytics = SecurityAnalyticsClient(client) self.search_relevance = SearchRelevanceClient(client) self.sm = SmClient(client) @@ -84,6 +87,7 @@ def _dynamic_lookup(self, client: Any) -> None: # Issue : https://github.com/opensearch-project/opensearch-py/issues/90#issuecomment-1003396742 plugins = [ + "ubi", "security_analytics", "search_relevance", "sm", diff --git a/opensearchpy/plugins/ubi.py b/opensearchpy/plugins/ubi.py new file mode 100644 index 00000000..d8de573e --- /dev/null +++ b/opensearchpy/plugins/ubi.py @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import NamespacedClient, query_params + + +class UbiClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def initialize( + self, + *, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Initializes the UBI indexes. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: A comma-separated list of filters used to + filter the response. Use wildcards to match any field or part of a + field's name. To exclude fields, use `-`. + :arg human: Whether to return human-readable values for + statistics. Default is false. + :arg pretty: Whether to pretty-format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "POST", "/_plugins/ubi/initialize", params=params, headers=headers + )