diff --git a/opensearchpy/client/__init__.pyi b/opensearchpy/client/__init__.pyi index 64f21ca7..8647393a 100644 --- a/opensearchpy/client/__init__.pyi +++ b/opensearchpy/client/__init__.pyi @@ -50,6 +50,7 @@ class OpenSearch(object): cat: CatClient cluster: ClusterClient + dangling_indices: DanglingIndicesClient features: FeaturesClient indices: IndicesClient ingest: IngestClient diff --git a/opensearchpy/client/dangling_indices.py b/opensearchpy/client/dangling_indices.py deleted file mode 100644 index 4d1b5a36..00000000 --- a/opensearchpy/client/dangling_indices.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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. -# -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params - - -class DanglingIndicesClient(NamespacedClient): - @query_params( - "accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout" - ) - def delete_dangling_index(self, index_uuid, params=None, headers=None): - """ - Deletes the specified dangling index - - - :arg index_uuid: The UUID of the dangling index - :arg accept_data_loss: Must be set to true in order to delete - the dangling index - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - """ - if index_uuid in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index_uuid'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_dangling", index_uuid), - params=params, - headers=headers, - ) - - @query_params( - "accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout" - ) - def import_dangling_index(self, index_uuid, params=None, headers=None): - """ - Imports the specified dangling index - - - :arg index_uuid: The UUID of the dangling index - :arg accept_data_loss: Must be set to true in order to import - the dangling index - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - """ - if index_uuid in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index_uuid'.") - - return self.transport.perform_request( - "POST", _make_path("_dangling", index_uuid), params=params, headers=headers - ) - - @query_params() - def list_dangling_indices(self, params=None, headers=None): - """ - Returns all dangling indices. - - """ - return self.transport.perform_request( - "GET", "/_dangling", params=params, headers=headers - ) diff --git a/opensearchpy/client/dangling_indices/__init__.py b/opensearchpy/client/dangling_indices/__init__.py new file mode 100644 index 00000000..752d9748 --- /dev/null +++ b/opensearchpy/client/dangling_indices/__init__.py @@ -0,0 +1,33 @@ +# 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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from opensearchpy.client.utils import NamespacedClient + + +class DanglingIndicesClient(NamespacedClient): + from .delete_dangling_index import delete_dangling_index + from .import_dangling_index import import_dangling_index + from .list_dangling_indices import list_dangling_indices diff --git a/opensearchpy/client/dangling_indices/__init__.pyi b/opensearchpy/client/dangling_indices/__init__.pyi new file mode 100644 index 00000000..752d9748 --- /dev/null +++ b/opensearchpy/client/dangling_indices/__init__.pyi @@ -0,0 +1,33 @@ +# 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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from opensearchpy.client.utils import NamespacedClient + + +class DanglingIndicesClient(NamespacedClient): + from .delete_dangling_index import delete_dangling_index + from .import_dangling_index import import_dangling_index + from .list_dangling_indices import list_dangling_indices diff --git a/opensearchpy/client/dangling_indices/delete_dangling_index.py b/opensearchpy/client/dangling_indices/delete_dangling_index.py new file mode 100644 index 00000000..1ffd3a0b --- /dev/null +++ b/opensearchpy/client/dangling_indices/delete_dangling_index.py @@ -0,0 +1,53 @@ +# 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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from opensearchpy.client.utils import SKIP_IN_PATH, _make_path, query_params + + +@query_params( + "accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout" +) +def delete_dangling_index(self, index_uuid, params=None, headers=None): + """ + Deletes the specified dangling index + + + :arg index_uuid: The UUID of the dangling index + :arg accept_data_loss: Must be set to true in order to delete + the dangling index + :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master + :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + :arg timeout: Explicit operation timeout + """ + if index_uuid in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index_uuid'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_dangling", index_uuid), + params=params, + headers=headers, + ) diff --git a/opensearchpy/client/dangling_indices/delete_dangling_index.pyi b/opensearchpy/client/dangling_indices/delete_dangling_index.pyi new file mode 100644 index 00000000..43a8aea2 --- /dev/null +++ b/opensearchpy/client/dangling_indices/delete_dangling_index.pyi @@ -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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Any, Collection, MutableMapping, Optional, Tuple, Union + + +def delete_dangling_index( + self, + index_uuid: Any, + *, + accept_data_loss: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., + timeout: 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: str = ..., +) -> Any: ... \ No newline at end of file diff --git a/opensearchpy/client/dangling_indices/import_dangling_index.py b/opensearchpy/client/dangling_indices/import_dangling_index.py new file mode 100644 index 00000000..48dabaac --- /dev/null +++ b/opensearchpy/client/dangling_indices/import_dangling_index.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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from opensearchpy.client.utils import SKIP_IN_PATH, _make_path, query_params + + +@query_params( + "accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout" +) +def import_dangling_index(self, index_uuid, params=None, headers=None): + """ + Imports the specified dangling index + + + :arg index_uuid: The UUID of the dangling index + :arg accept_data_loss: Must be set to true in order to import + the dangling index + :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master + :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + :arg timeout: Explicit operation timeout + """ + if index_uuid in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index_uuid'.") + + return self.transport.perform_request( + "POST", _make_path("_dangling", index_uuid), params=params, headers=headers + ) diff --git a/opensearchpy/client/dangling_indices.pyi b/opensearchpy/client/dangling_indices/import_dangling_index.pyi similarity index 53% rename from opensearchpy/client/dangling_indices.pyi rename to opensearchpy/client/dangling_indices/import_dangling_index.pyi index 56e4a72f..0d726394 100644 --- a/opensearchpy/client/dangling_indices.pyi +++ b/opensearchpy/client/dangling_indices/import_dangling_index.pyi @@ -26,10 +26,8 @@ from typing import Any, Collection, MutableMapping, Optional, Tuple, Union -from .utils import NamespacedClient -class DanglingIndicesClient(NamespacedClient): - def delete_dangling_index( +def import_dangling_index( self, index_uuid: Any, *, @@ -49,41 +47,4 @@ class DanglingIndicesClient(NamespacedClient): api_key: Optional[Union[str, Tuple[str, str]]] = ..., params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def import_dangling_index( - self, - index_uuid: Any, - *, - accept_data_loss: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., - timeout: 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: ... - def list_dangling_indices( - 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: ... +) -> Any: ... \ No newline at end of file diff --git a/opensearchpy/client/dangling_indices/list_dangling_indices.py b/opensearchpy/client/dangling_indices/list_dangling_indices.py new file mode 100644 index 00000000..9e7c9c17 --- /dev/null +++ b/opensearchpy/client/dangling_indices/list_dangling_indices.py @@ -0,0 +1,38 @@ +# 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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from opensearchpy.client.utils import SKIP_IN_PATH, _make_path, query_params + + +@query_params() +def list_dangling_indices(self, params=None, headers=None): + """ + Returns all dangling indices. + + """ + return self.transport.perform_request( + "GET", "/_dangling", params=params, headers=headers + ) diff --git a/opensearchpy/client/dangling_indices/list_dangling_indices.pyi b/opensearchpy/client/dangling_indices/list_dangling_indices.pyi new file mode 100644 index 00000000..4dd248df --- /dev/null +++ b/opensearchpy/client/dangling_indices/list_dangling_indices.pyi @@ -0,0 +1,45 @@ +# 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. +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Any, Collection, MutableMapping, Optional, Tuple, Union + + +def list_dangling_indices( + 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: ... \ No newline at end of file