Integrated generated 'nodes' client APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility (#514)

Signed-off-by: saimedhi <[email protected]>
Signed-off-by: Sai Medhini Reddy Maryada <[email protected]>
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
This commit is contained in:
Sai Medhini Reddy Maryada
2023-10-03 15:00:49 -07:00
committed by GitHub
co-authored by Daniel Doubrovkine
parent 1a47e6fa1f
commit 80b96812a7
5 changed files with 143 additions and 114 deletions
+1
View File
@@ -9,6 +9,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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 `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 `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 `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
- 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)) - 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 ### Removed
+62 -56
View File
@@ -25,6 +25,16 @@
# under the License. # 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 NamespacedClient, _make_path, query_params from .utils import NamespacedClient, _make_path, query_params
@@ -37,12 +47,12 @@ class NodesClient(NamespacedClient):
Reloads secure settings. Reloads secure settings.
:arg body: An object containing the password for the :arg body: An object containing the password for the opensearch
opensearch keystore keystore
:arg node_id: A comma-separated list of node IDs to span the :arg node_id: Comma-separated list of node IDs to span the
reload/reinit call. Should stay empty because reloading usually involves reload/reinit call. Should stay empty because reloading usually involves
all cluster nodes. all cluster nodes.
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return await self.transport.perform_request( return await self.transport.perform_request(
"POST", "POST",
@@ -58,16 +68,16 @@ class NodesClient(NamespacedClient):
Returns information about nodes in the cluster. Returns information about nodes in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: A comma-separated list of metrics you wish :arg metric: Comma-separated list of metrics you wish returned.
returned. Leave empty to return all. Valid choices: settings, os, Leave empty to return all. Valid choices: settings, os, process, jvm,
process, jvm, thread_pool, transport, http, plugins, ingest thread_pool, transport, http, plugins, ingest
:arg flat_settings: Return settings in flat format (default: :arg flat_settings: Return settings in flat format. (default:
false) false)
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return await self.transport.perform_request( return await self.transport.perform_request(
"GET", _make_path("_nodes", node_id, metric), params=params, headers=headers "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers
@@ -79,7 +89,6 @@ class NodesClient(NamespacedClient):
"fields", "fields",
"groups", "groups",
"include_segment_file_sizes", "include_segment_file_sizes",
"include_unloaded_segments",
"level", "level",
"timeout", "timeout",
"types", "types",
@@ -91,37 +100,34 @@ class NodesClient(NamespacedClient):
Returns statistical information about nodes in the cluster. Returns statistical information about nodes in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: Limit the information returned to the specified :arg metric: Limit the information returned to the specified
metrics Valid choices: _all, breaker, fs, http, indices, jvm, os, metrics. Valid choices: _all, breaker, fs, http, indices, jvm, os,
process, thread_pool, transport, discovery, indexing_pressure process, thread_pool, transport, discovery, indexing_pressure
:arg index_metric: Limit the information returned for `indices` :arg index_metric: Limit the information returned for `indices`
metric to the specific index metrics. Isn't used if `indices` (or `all`) metric to the specific index metrics. Isn't used if `indices` (or `all`)
metric isn't specified. Valid choices: _all, completion, docs, metric isn't specified. Valid choices: _all, store, indexing, get,
fielddata, query_cache, flush, get, indexing, merge, request_cache, search, merge, flush, refresh, query_cache, fielddata, docs, warmer,
refresh, search, segments, store, warmer, suggest completion, segments, translog, suggest, request_cache, recovery
:arg completion_fields: A comma-separated list of fields for :arg completion_fields: Comma-separated list of fields for
`fielddata` and `suggest` index metric (supports wildcards) `fielddata` and `suggest` index metric (supports wildcards).
:arg fielddata_fields: A comma-separated list of fields for :arg fielddata_fields: Comma-separated list of fields for
`fielddata` index metric (supports wildcards) `fielddata` index metric (supports wildcards).
:arg fields: A comma-separated list of fields for `fielddata` :arg fields: Comma-separated list of fields for `fielddata` and
and `completion` index metric (supports wildcards) `completion` index metric (supports wildcards).
:arg groups: A comma-separated list of search groups for :arg groups: Comma-separated list of search groups for `search`
`search` index metric index metric.
:arg include_segment_file_sizes: Whether to report the :arg include_segment_file_sizes: Whether to report the
aggregated disk usage of each one of the Lucene index files (only aggregated disk usage of each one of the Lucene index files (only
applies if segment stats are requested) applies if segment stats are requested). (default: false)
:arg include_unloaded_segments: If set to true segment stats
will include stats for segments that are not currently loaded into
memory
:arg level: Return indices stats aggregated at index, node or :arg level: Return indices stats aggregated at index, node or
shard level Valid choices: indices, node, shards Default: node shard level. Valid choices: indices, node, shards
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
:arg types: A comma-separated list of document types for the :arg types: Comma-separated list of document types for the
`indexing` index metric `indexing` index metric.
""" """
return await self.transport.perform_request( return await self.transport.perform_request(
"GET", "GET",
@@ -138,21 +144,21 @@ class NodesClient(NamespacedClient):
Returns information about hot threads on each node in the cluster. Returns information about hot threads on each node in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg doc_type: The type to sample (default: cpu) Valid choices: :arg doc_type: The type to sample. Valid choices: cpu, wait,
cpu, wait, block block
:arg ignore_idle_threads: Don't show threads that are in known- :arg ignore_idle_threads: Don't show threads that are in known-
idle places, such as waiting on a socket select or pulling from an empty idle places, such as waiting on a socket select or pulling from an empty
task queue (default: true) task queue. (default: True)
:arg interval: The interval for the second sampling of threads :arg interval: The interval for the second sampling of threads.
:arg snapshots: Number of samples of thread stacktrace (default: :arg snapshots: Number of samples of thread stacktrace.
10) (default: 10)
:arg threads: Specify the number of threads to provide :arg threads: Specify the number of threads to provide
information for (default: 3) information for. (default: 3)
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
# type is a reserved word so it cannot be used, use doc_type instead # type is a reserved word so it cannot be used, use doc_type instead
if "doc_type" in params: if "doc_type" in params:
@@ -171,13 +177,13 @@ class NodesClient(NamespacedClient):
Returns low-level information about REST actions usage on nodes. Returns low-level information about REST actions usage on nodes.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: Limit the information returned to the specified :arg metric: Limit the information returned to the specified
metrics Valid choices: _all, rest_actions metrics. Valid choices: _all, rest_actions
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return await self.transport.perform_request( return await self.transport.perform_request(
"GET", "GET",
+9 -1
View File
@@ -24,6 +24,15 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # 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 typing import Any, Collection, MutableMapping, Optional, Tuple, Union
from .utils import NamespacedClient from .utils import NamespacedClient
@@ -79,7 +88,6 @@ class NodesClient(NamespacedClient):
fields: Optional[Any] = ..., fields: Optional[Any] = ...,
groups: Optional[Any] = ..., groups: Optional[Any] = ...,
include_segment_file_sizes: Optional[Any] = ..., include_segment_file_sizes: Optional[Any] = ...,
include_unloaded_segments: Optional[Any] = ...,
level: Optional[Any] = ..., level: Optional[Any] = ...,
timeout: Optional[Any] = ..., timeout: Optional[Any] = ...,
types: Optional[Any] = ..., types: Optional[Any] = ...,
+62 -56
View File
@@ -25,6 +25,16 @@
# under the License. # 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 NamespacedClient, _make_path, query_params from .utils import NamespacedClient, _make_path, query_params
@@ -37,12 +47,12 @@ class NodesClient(NamespacedClient):
Reloads secure settings. Reloads secure settings.
:arg body: An object containing the password for the :arg body: An object containing the password for the opensearch
opensearch keystore keystore
:arg node_id: A comma-separated list of node IDs to span the :arg node_id: Comma-separated list of node IDs to span the
reload/reinit call. Should stay empty because reloading usually involves reload/reinit call. Should stay empty because reloading usually involves
all cluster nodes. all cluster nodes.
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return self.transport.perform_request( return self.transport.perform_request(
"POST", "POST",
@@ -58,16 +68,16 @@ class NodesClient(NamespacedClient):
Returns information about nodes in the cluster. Returns information about nodes in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: A comma-separated list of metrics you wish :arg metric: Comma-separated list of metrics you wish returned.
returned. Leave empty to return all. Valid choices: settings, os, Leave empty to return all. Valid choices: settings, os, process, jvm,
process, jvm, thread_pool, transport, http, plugins, ingest thread_pool, transport, http, plugins, ingest
:arg flat_settings: Return settings in flat format (default: :arg flat_settings: Return settings in flat format. (default:
false) false)
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return self.transport.perform_request( return self.transport.perform_request(
"GET", _make_path("_nodes", node_id, metric), params=params, headers=headers "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers
@@ -79,7 +89,6 @@ class NodesClient(NamespacedClient):
"fields", "fields",
"groups", "groups",
"include_segment_file_sizes", "include_segment_file_sizes",
"include_unloaded_segments",
"level", "level",
"timeout", "timeout",
"types", "types",
@@ -91,37 +100,34 @@ class NodesClient(NamespacedClient):
Returns statistical information about nodes in the cluster. Returns statistical information about nodes in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: Limit the information returned to the specified :arg metric: Limit the information returned to the specified
metrics Valid choices: _all, breaker, fs, http, indices, jvm, os, metrics. Valid choices: _all, breaker, fs, http, indices, jvm, os,
process, thread_pool, transport, discovery, indexing_pressure process, thread_pool, transport, discovery, indexing_pressure
:arg index_metric: Limit the information returned for `indices` :arg index_metric: Limit the information returned for `indices`
metric to the specific index metrics. Isn't used if `indices` (or `all`) metric to the specific index metrics. Isn't used if `indices` (or `all`)
metric isn't specified. Valid choices: _all, completion, docs, metric isn't specified. Valid choices: _all, store, indexing, get,
fielddata, query_cache, flush, get, indexing, merge, request_cache, search, merge, flush, refresh, query_cache, fielddata, docs, warmer,
refresh, search, segments, store, warmer, suggest completion, segments, translog, suggest, request_cache, recovery
:arg completion_fields: A comma-separated list of fields for :arg completion_fields: Comma-separated list of fields for
`fielddata` and `suggest` index metric (supports wildcards) `fielddata` and `suggest` index metric (supports wildcards).
:arg fielddata_fields: A comma-separated list of fields for :arg fielddata_fields: Comma-separated list of fields for
`fielddata` index metric (supports wildcards) `fielddata` index metric (supports wildcards).
:arg fields: A comma-separated list of fields for `fielddata` :arg fields: Comma-separated list of fields for `fielddata` and
and `completion` index metric (supports wildcards) `completion` index metric (supports wildcards).
:arg groups: A comma-separated list of search groups for :arg groups: Comma-separated list of search groups for `search`
`search` index metric index metric.
:arg include_segment_file_sizes: Whether to report the :arg include_segment_file_sizes: Whether to report the
aggregated disk usage of each one of the Lucene index files (only aggregated disk usage of each one of the Lucene index files (only
applies if segment stats are requested) applies if segment stats are requested). (default: false)
:arg include_unloaded_segments: If set to true segment stats
will include stats for segments that are not currently loaded into
memory
:arg level: Return indices stats aggregated at index, node or :arg level: Return indices stats aggregated at index, node or
shard level Valid choices: indices, node, shards Default: node shard level. Valid choices: indices, node, shards
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
:arg types: A comma-separated list of document types for the :arg types: Comma-separated list of document types for the
`indexing` index metric `indexing` index metric.
""" """
return self.transport.perform_request( return self.transport.perform_request(
"GET", "GET",
@@ -138,21 +144,21 @@ class NodesClient(NamespacedClient):
Returns information about hot threads on each node in the cluster. Returns information about hot threads on each node in the cluster.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg doc_type: The type to sample (default: cpu) Valid choices: :arg doc_type: The type to sample. Valid choices: cpu, wait,
cpu, wait, block block
:arg ignore_idle_threads: Don't show threads that are in known- :arg ignore_idle_threads: Don't show threads that are in known-
idle places, such as waiting on a socket select or pulling from an empty idle places, such as waiting on a socket select or pulling from an empty
task queue (default: true) task queue. (default: True)
:arg interval: The interval for the second sampling of threads :arg interval: The interval for the second sampling of threads.
:arg snapshots: Number of samples of thread stacktrace (default: :arg snapshots: Number of samples of thread stacktrace.
10) (default: 10)
:arg threads: Specify the number of threads to provide :arg threads: Specify the number of threads to provide
information for (default: 3) information for. (default: 3)
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
# type is a reserved word so it cannot be used, use doc_type instead # type is a reserved word so it cannot be used, use doc_type instead
if "doc_type" in params: if "doc_type" in params:
@@ -171,13 +177,13 @@ class NodesClient(NamespacedClient):
Returns low-level information about REST actions usage on nodes. Returns low-level information about REST actions usage on nodes.
:arg node_id: A comma-separated list of node IDs or names to :arg node_id: Comma-separated list of node IDs or names to limit
limit the returned information; use `_local` to return information from the returned information; use `_local` to return information from the
the node you're connecting to, leave empty to get information from all node you're connecting to, leave empty to get information from all
nodes nodes.
:arg metric: Limit the information returned to the specified :arg metric: Limit the information returned to the specified
metrics Valid choices: _all, rest_actions metrics. Valid choices: _all, rest_actions
:arg timeout: Explicit operation timeout :arg timeout: Operation timeout.
""" """
return self.transport.perform_request( return self.transport.perform_request(
"GET", "GET",
+9 -1
View File
@@ -24,6 +24,15 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # 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 typing import Any, Collection, MutableMapping, Optional, Tuple, Union
from .utils import NamespacedClient from .utils import NamespacedClient
@@ -79,7 +88,6 @@ class NodesClient(NamespacedClient):
fields: Optional[Any] = ..., fields: Optional[Any] = ...,
groups: Optional[Any] = ..., groups: Optional[Any] = ...,
include_segment_file_sizes: Optional[Any] = ..., include_segment_file_sizes: Optional[Any] = ...,
include_unloaded_segments: Optional[Any] = ...,
level: Optional[Any] = ..., level: Optional[Any] = ...,
timeout: Optional[Any] = ..., timeout: Optional[Any] = ...,
types: Optional[Any] = ..., types: Optional[Any] = ...,