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

Proposal/split dangling indices #475

Closed
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 opensearchpy/client/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class OpenSearch(object):

cat: CatClient
cluster: ClusterClient
dangling_indices: DanglingIndicesClient
features: FeaturesClient
indices: IndicesClient
ingest: IngestClient
Expand Down
87 changes: 0 additions & 87 deletions opensearchpy/client/dangling_indices.py

This file was deleted.

33 changes: 33 additions & 0 deletions opensearchpy/client/dangling_indices/__init__.py
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions opensearchpy/client/dangling_indices/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions opensearchpy/client/dangling_indices/delete_dangling_index.py
Original file line number Diff line number Diff line change
@@ -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,
)
50 changes: 50 additions & 0 deletions opensearchpy/client/dangling_indices/delete_dangling_index.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
50 changes: 50 additions & 0 deletions opensearchpy/client/dangling_indices/import_dangling_index.py
Original file line number Diff line number Diff line change
@@ -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
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
*,
Expand All @@ -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: ...
Loading
Loading