Skip to content

Commit

Permalink
Merge branch 'main' into merge/nodes_client
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
dblock authored Oct 3, 2023
2 parents 37a0aa4 + 70db37a commit 60fb645
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### 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))
- Integrated generated `dangling_indices client` APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility ([#511](https://github.com/opensearch-project/opensearch-py/pull/511))
- Integrated generated `nodes client` APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility ([#514](https://github.com/opensearch-project/opensearch-py/pull/514))
### 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))
Expand All @@ -17,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Dependencies
- Bumps `sphinx` from <7.1 to <7.3
- Bumps `urllib3` from >=1.21.1, <2 to >=1.21.1 ([#466](https://github.com/opensearch-project/opensearch-py/pull/466))
- Bumps `urllib3` from >=1.21.1 to >=1.26.9 ([#518](https://github.com/opensearch-project/opensearch-py/pull/518))

## [2.3.1]
### Added
Expand Down
44 changes: 30 additions & 14 deletions opensearchpy/_async/client/dangling_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,37 @@
# 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 DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
)
async def delete_dangling_index(self, index_uuid, params=None, headers=None):
"""
Deletes the specified dangling index
Deletes the specified dangling index.
:arg index_uuid: The UUID of the 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
the dangling index.
: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 index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
Expand All @@ -55,19 +68,22 @@ async def delete_dangling_index(self, index_uuid, params=None, headers=None):
)

@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
)
async def import_dangling_index(self, index_uuid, params=None, headers=None):
"""
Imports the specified dangling index
Imports the specified dangling index.
:arg index_uuid: The UUID of the 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
the dangling index.
: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 index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
Expand Down
13 changes: 11 additions & 2 deletions opensearchpy/_async/client/dangling_indices.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 @@ -34,8 +43,8 @@ class DanglingIndicesClient(NamespacedClient):
index_uuid: Any,
*,
accept_data_loss: 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 All @@ -55,8 +64,8 @@ class DanglingIndicesClient(NamespacedClient):
index_uuid: Any,
*,
accept_data_loss: 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
44 changes: 30 additions & 14 deletions opensearchpy/client/dangling_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,37 @@
# 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 DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
)
def delete_dangling_index(self, index_uuid, params=None, headers=None):
"""
Deletes the specified dangling index
Deletes the specified dangling index.
:arg index_uuid: The UUID of the 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
the dangling index.
: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 index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
Expand All @@ -55,19 +68,22 @@ def delete_dangling_index(self, index_uuid, params=None, headers=None):
)

@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
)
def import_dangling_index(self, index_uuid, params=None, headers=None):
"""
Imports the specified dangling index
Imports the specified dangling index.
:arg index_uuid: The UUID of the 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
the dangling index.
: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 index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
Expand Down
13 changes: 11 additions & 2 deletions opensearchpy/client/dangling_indices.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 @@ -34,8 +43,8 @@ class DanglingIndicesClient(NamespacedClient):
index_uuid: Any,
*,
accept_data_loss: 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 All @@ -55,8 +64,8 @@ class DanglingIndicesClient(NamespacedClient):
index_uuid: Any,
*,
accept_data_loss: 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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if package == module_dir or package.startswith(module_dir + ".")
]
install_requires = [
"urllib3>=1.21.1",
"urllib3>=1.26.9",
"requests>=2.4.0, <3.0.0",
"six",
"python-dateutil",
Expand Down
7 changes: 7 additions & 0 deletions utils/generate-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ def read_modules():

for m in params:
A = dict(type=m["schema"]["type"], description=m["description"])

if "default" in m["schema"]:
A.update({"default": m["schema"]["default"]})

if "enum" in m["schema"]:
A.update({"type": "enum"})
A.update({"options": m["schema"]["enum"]})
Expand All @@ -508,6 +512,9 @@ def read_modules():
if "description" in n:
B.update({"description": n["description"]})

if "x-enum-options" in n["schema"]:
B.update({"options": n["schema"]["x-enum-options"]})

deprecated_new = {}
if "deprecated" in n:
B.update({"deprecated": n["deprecated"]})
Expand Down
3 changes: 2 additions & 1 deletion utils/templates/base
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

{% for p, info in api.params %}
{% filter wordwrap(72, wrapstring="\n ") %}
:arg {{ p }}{% if info.deprecated %} (Deprecated: {{ info['deprecation_message'][:-1] }}){% endif %}: {{ info.description }}{% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %}{% if info.default %} Default: {{ info.default }}{% endif %}
:arg {{ p }}{% if info.deprecated %} (Deprecated: {{ info['deprecation_message'][:-1] }}){% endif %}: {{ info.description }}{% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %}
{% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %} (default: false){% else %} (default: {{ info.default }}){% endif %}{% endif %}{% endif %}
{% endfilter %}

{% endfor %}
Expand Down

0 comments on commit 60fb645

Please sign in to comment.