Code generated using native OpenAPI specification (#724)

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

---------

Signed-off-by: saimedhi <saimedhi@amazon.com>
This commit is contained in:
Sai Medhini Reddy Maryada
2024-04-17 16:22:14 -07:00
committed by GitHub
parent 0e28f5ffe9
commit b47edf906e
32 changed files with 11079 additions and 3117 deletions
+2
View File
@@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- Added support for Python 3.12 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
- Added service time metrics ([#716](https://github.com/opensearch-project/opensearch-py/pull/716))
- Added `search_pipeline` APIs and `notifications` plugin APIs ([#724](https://github.com/opensearch-project/opensearch-py/pull/724))
### Changed
### Deprecated
### Removed
@@ -12,6 +13,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@29faff0](https://github.com/opensearch-project/opensearch-api-specification/commit/29faff0709b2557acfd4c3c7e053a2c313413633)
### Security
### Dependencies
- Bumps `aiohttp` from >=3,<4 to >=3.9.2,<4 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+482 -118
View File
@@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient):
@query_params(
"awareness_attribute",
"cluster_manager_timeout",
"error_trace",
"expand_wildcards",
"filter_path",
"human",
"level",
"local",
"master_timeout",
"pretty",
"source",
"timeout",
"wait_for_active_shards",
"wait_for_events",
@@ -65,36 +70,63 @@ class ClusterClient(NamespacedClient):
Returns basic information about the health of the cluster.
:arg index: Limit the information returned to specific indicies.
:arg index: Comma-separated list of data streams, indices, and
index aliases used to limit the request. Wildcard expressions (*) are
supported. To target all data streams and indices in a cluster, omit
this parameter or use `_all` or `*`.
:arg awareness_attribute: The awareness attribute for which the
health is required.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg level: Specify the level of detail for returned
information. Valid choices are cluster, indices, shards,
awareness_attributes.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg level: Can be one of cluster, indices or shards. Controls
the details level of the health information returned. Valid choices are
cluster, indices, shards, awareness_attributes.
:arg local: If true, the request retrieves information from the
local node only. Defaults to false, which means information is retrieved
from the master 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.
:arg wait_for_active_shards: Wait until the specified number of
shards is active.
:arg wait_for_events: Wait until all currently queued events
with the given priority are processed. Valid choices are immediate,
urgent, high, normal, low, languid.
:arg wait_for_no_initializing_shards: Whether to wait until
there are no initializing shards in the cluster.
:arg wait_for_no_relocating_shards: Whether to wait until there
are no relocating shards in the cluster.
:arg wait_for_nodes: Wait until the specified number of nodes is
available.
:arg wait_for_status: Wait until cluster is in a specific state.
Valid choices are green, yellow, red.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_active_shards: A number controlling to how many
active shards to wait for, all to wait for all shards in the cluster to
be active, or 0 to not wait. Valid choices are all, index-setting.
:arg wait_for_events: Can be one of immediate, urgent, high,
normal, low, languid. Wait until all currently queued events with the
given priority are processed. Valid choices are immediate, urgent, high,
normal, low, languid.
:arg wait_for_no_initializing_shards: A boolean value which
controls whether to wait (until the timeout provided) for the cluster to
have no shard initializations. Defaults to false, which means it will
not wait for initializing shards.
:arg wait_for_no_relocating_shards: A boolean value which
controls whether to wait (until the timeout provided) for the cluster to
have no shard relocations. Defaults to false, which means it will not
wait for relocating shards.
:arg wait_for_nodes: The request waits until the specified
number N of nodes is available. It also accepts >=N, <=N, >N and <N.
Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N)
notation.
:arg wait_for_status: One of green, yellow or red. Will wait
(until the timeout provided) until the status of the cluster changes to
the one provided or better, i.e. green > yellow > red. By default, will
not wait for any status. Valid choices are green, yellow, red.
"""
return await self.transport.perform_request(
"GET",
@@ -103,7 +135,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
async def pending_tasks(
self,
params: Any = None,
@@ -116,11 +157,23 @@ class ClusterClient(NamespacedClient):
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If `true`, the request retrieves information from
the local node only.If `false`, information is retrieved from the master
node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_cluster/pending_tasks", params=params, headers=headers
@@ -129,11 +182,16 @@ class ClusterClient(NamespacedClient):
@query_params(
"allow_no_indices",
"cluster_manager_timeout",
"error_trace",
"expand_wildcards",
"filter_path",
"flat_settings",
"human",
"ignore_unavailable",
"local",
"master_timeout",
"pretty",
"source",
"wait_for_metadata_version",
"wait_for_timeout",
)
@@ -149,31 +207,40 @@ class ClusterClient(NamespacedClient):
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, blocks, metadata, nodes, routing_table,
routing_nodes, master_node, cluster_manager_node, version.
:arg index: Comma-separated list of indices; use `_all` or empty
string to perform the operation on all indices.
metrics
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified).
string or when no indices have been specified)
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed).
should be ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_metadata_version: Wait for the metadata version to
be equal or greater than the specified metadata version.
be equal or greater than the specified metadata version
:arg wait_for_timeout: The maximum time to wait for
wait_for_metadata_version before timing out.
wait_for_metadata_version before timing out
"""
if index and metric in SKIP_IN_PATH:
metric = "_all"
@@ -185,7 +252,15 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("flat_settings", "timeout")
@query_params(
"error_trace",
"filter_path",
"flat_settings",
"human",
"pretty",
"source",
"timeout",
)
async def stats(
self,
node_id: Any = None,
@@ -196,13 +271,23 @@ class ClusterClient(NamespacedClient):
Returns high-level overview of cluster statistics.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg timeout: Operation timeout.
:arg node_id: Comma-separated list of node filters used to limit
returned information. Defaults to all nodes in the cluster.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If `true`, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for each node to respond.If a node
does not respond before its timeout expires, the response does not
include its stats.However, timed out nodes are included in the
responses `_nodes.failed` property. Defaults to no timeout.
"""
return await self.transport.perform_request(
"GET",
@@ -218,10 +303,15 @@ class ClusterClient(NamespacedClient):
@query_params(
"cluster_manager_timeout",
"dry_run",
"error_trace",
"explain",
"filter_path",
"human",
"master_timeout",
"metric",
"pretty",
"retry_failed",
"source",
"timeout",
)
async def reroute(
@@ -238,18 +328,31 @@ class ClusterClient(NamespacedClient):
`cancel`, `allocate`)
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg dry_run: Simulate the operation only and return the
resulting state.
:arg explain: Return an explanation of why the commands can or
cannot be executed.
:arg dry_run: If true, then the request simulates the operation
only and returns the resulting state.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg explain: If true, then the response contains an explanation
of why the commands can or cannot be executed.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg metric: Limit the information returned to the specified
metrics. Defaults to all but metadata.
:arg retry_failed: Retries allocation of shards that are blocked
due to too many subsequent allocation failures.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg metric: Limits the information returned to the specified
metrics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg retry_failed: If true, then retries allocation of shards
that are blocked due to too many subsequent allocation failures.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"POST", "/_cluster/reroute", params=params, headers=headers, body=body
@@ -257,9 +360,14 @@ class ClusterClient(NamespacedClient):
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"flat_settings",
"human",
"include_defaults",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def get_settings(
@@ -273,21 +381,41 @@ class ClusterClient(NamespacedClient):
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg include_defaults: Whether to return all default clusters
setting. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If `true`, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg include_defaults: If `true`, returns default cluster
settings from the local 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.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"GET", "/_cluster/settings", params=params, headers=headers
)
@query_params(
"cluster_manager_timeout", "flat_settings", "master_timeout", "timeout"
"cluster_manager_timeout",
"error_trace",
"filter_path",
"flat_settings",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def put_settings(
self,
@@ -303,12 +431,22 @@ class ClusterClient(NamespacedClient):
or `persistent` (survives cluster restart).
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false)
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -317,7 +455,7 @@ class ClusterClient(NamespacedClient):
"PUT", "/_cluster/settings", params=params, headers=headers, body=body
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def remote_info(
self,
params: Any = None,
@@ -326,12 +464,31 @@ class ClusterClient(NamespacedClient):
"""
Returns the information about configured remote clusters.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_remote/info", params=params, headers=headers
)
@query_params("include_disk_info", "include_yes_decisions")
@query_params(
"error_trace",
"filter_path",
"human",
"include_disk_info",
"include_yes_decisions",
"pretty",
"source",
)
async def allocation_explain(
self,
body: Any = None,
@@ -344,10 +501,20 @@ class ClusterClient(NamespacedClient):
:arg body: The index, shard, and primary flag to explain. Empty
means 'explain the first unassigned shard'
:arg include_disk_info: Return information about disk usage and
shard sizes. Default is false.
:arg include_yes_decisions: Return 'YES' decisions in
explanation. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg include_disk_info: If true, returns information about disk
usage and shard sizes.
:arg include_yes_decisions: If true, returns YES decisions in
explanation.
:arg pretty: Whether to pretty format the returned JSON
response.
: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",
@@ -357,7 +524,16 @@ class ClusterClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def delete_component_template(
self,
name: Any,
@@ -368,13 +544,27 @@ class ClusterClient(NamespacedClient):
Deletes a component template.
:arg name: The name of the template.
:arg name: Name of the component template to delete. Wildcard
(*) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")
@@ -386,7 +576,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
async def get_component_template(
self,
name: Any = None,
@@ -397,14 +596,27 @@ class ClusterClient(NamespacedClient):
Returns one or more component templates.
:arg name: The Comma-separated names of the component templates.
:arg name: Name of the component template to retrieve. Wildcard
(`*`) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If `true`, the request retrieves information from
the local node only.If `false`, information is retrieved from the master
node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
@@ -413,7 +625,17 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "create", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"create",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def put_component_template(
self,
name: Any,
@@ -425,15 +647,35 @@ class ClusterClient(NamespacedClient):
Creates or updates a component template.
:arg name: The name of the template.
:arg name: Name of the component template to create. Opensearch
includes the following built-in component templates: `logs-mappings`;
'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-
mapping`; `synthetics-settings`. Opensearch Agent uses these templates
to configure backing indices for its data streams. If you use Opensearch
Agent and want to overwrite one of these templates, set the `version`
for your replacement template higher than the current version. If you
dont use Opensearch Agent and want to disable all built-in component
and index templates, set `stack.templates.enabled` to `false` using the
cluster update settings API.
:arg body: The template definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg create: Whether the index template should only be added if
new or can also replace an existing one. Default is false.
:arg create: If `true`, this request cannot replace or update
existing component templates.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Operation timeout.
"""
for param in (name, body):
@@ -448,7 +690,16 @@ class ClusterClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
async def exists_component_template(
self,
name: Any,
@@ -459,14 +710,27 @@ class ClusterClient(NamespacedClient):
Returns information about whether a particular component template exist.
:arg name: The name of the template.
:arg name: Name of the component template to check existence of.
Wildcard (*) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If true, the request retrieves information from the
local node only.Defaults to false, which means information is retrieved
from the master node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response isreceived before the timeout
expires, the request fails and returns anerror.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")
@@ -478,7 +742,9 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("wait_for_removal")
@query_params(
"error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal"
)
async def delete_voting_config_exclusions(
self,
params: Any = None,
@@ -488,9 +754,22 @@ class ClusterClient(NamespacedClient):
Clears cluster voting config exclusions.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_removal: Specifies whether to wait for all
excluded nodes to be removed from the cluster before clearing the voting
configuration exclusions list. Default is True.
excluded nodes to be removed from thecluster before clearing the voting
configuration exclusions list.Defaults to true, meaning that all
excluded nodes must be removed fromthe cluster before this API takes any
action. If set to false then thevoting configuration exclusions list is
cleared even if some excludednodes are still in the cluster.
"""
return await self.transport.perform_request(
"DELETE",
@@ -499,7 +778,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("node_ids", "node_names", "timeout")
@query_params(
"error_trace",
"filter_path",
"human",
"node_ids",
"node_names",
"pretty",
"source",
"timeout",
)
async def post_voting_config_exclusions(
self,
params: Any = None,
@@ -509,19 +797,33 @@ class ClusterClient(NamespacedClient):
Updates the cluster voting config exclusions by node ids or node names.
:arg node_ids: Comma-separated list of the persistent ids of the
nodes to exclude from the voting configuration. If specified, you may
not also specify ?node_names.
:arg node_names: Comma-separated list of the names of the nodes
to exclude from the voting configuration. If specified, you may not also
specify ?node_ids.
:arg timeout: Operation timeout.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg node_ids: A comma-separated list of the persistent ids of
the nodes to excludefrom the voting configuration. If specified, you may
not also specify node_names.
:arg node_names: A comma-separated list of the names of the
nodes to exclude from thevoting configuration. If specified, you may not
also specify node_ids.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: When adding a voting configuration exclusion, the
API waits for thespecified nodes to be excluded from the voting
configuration beforereturning. If the timeout expires before the
appropriate conditionis satisfied, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"POST", "/_cluster/voting_config_exclusions", params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_decommission_awareness(
self,
params: Any = None,
@@ -530,12 +832,23 @@ class ClusterClient(NamespacedClient):
"""
Delete any existing decommission.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE", "/_cluster/decommission/awareness", params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_weighted_routing(
self,
params: Any = None,
@@ -544,6 +857,17 @@ class ClusterClient(NamespacedClient):
"""
Delete weighted shard routing weights.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE",
@@ -552,7 +876,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_decommission_awareness(
self,
awareness_attribute_name: Any,
@@ -564,6 +888,16 @@ class ClusterClient(NamespacedClient):
:arg awareness_attribute_name: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if awareness_attribute_name in SKIP_IN_PATH:
raise ValueError(
@@ -583,7 +917,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_weighted_routing(
self,
attribute: Any,
@@ -595,6 +929,16 @@ class ClusterClient(NamespacedClient):
:arg attribute: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if attribute in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'attribute'.")
@@ -606,7 +950,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def put_decommission_awareness(
self,
awareness_attribute_name: Any,
@@ -620,6 +964,16 @@ class ClusterClient(NamespacedClient):
:arg awareness_attribute_name: Awareness attribute name.
:arg awareness_attribute_value: Awareness attribute value.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (awareness_attribute_name, awareness_attribute_value):
if param in SKIP_IN_PATH:
@@ -638,7 +992,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def put_weighted_routing(
self,
attribute: Any,
@@ -650,6 +1004,16 @@ class ClusterClient(NamespacedClient):
:arg attribute: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if attribute in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'attribute'.")
+60 -13
View File
@@ -41,7 +41,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
"accept_data_loss",
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def delete_dangling_index(
self,
@@ -53,15 +61,25 @@ class DanglingIndicesClient(NamespacedClient):
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.
the dangling index
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
@@ -74,7 +92,15 @@ class DanglingIndicesClient(NamespacedClient):
)
@query_params(
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
"accept_data_loss",
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def import_dangling_index(
self,
@@ -86,15 +112,25 @@ class DanglingIndicesClient(NamespacedClient):
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.
the dangling index
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
@@ -103,7 +139,7 @@ class DanglingIndicesClient(NamespacedClient):
"POST", _make_path("_dangling", index_uuid), params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def list_dangling_indices(
self,
params: Any = None,
@@ -112,6 +148,17 @@ class DanglingIndicesClient(NamespacedClient):
"""
Returns all dangling indices.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_dangling", params=params, headers=headers
File diff suppressed because it is too large Load Diff
+108 -20
View File
@@ -40,7 +40,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IngestClient(NamespacedClient):
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
async def get_pipeline(
self,
id: Any = None,
@@ -51,19 +59,40 @@ class IngestClient(NamespacedClient):
Returns a pipeline.
:arg id: Comma-separated list of pipeline ids. Wildcards
supported.
:arg id: Comma-separated list of pipeline IDs to retrieve.
Wildcard (`*`) expressions are supported. To get all ingest pipelines,
omit this parameter or use `*`.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def put_pipeline(
self,
id: Any,
@@ -75,14 +104,27 @@ class IngestClient(NamespacedClient):
Creates or updates a pipeline.
:arg id: Pipeline ID.
:arg id: ID of the ingest pipeline to create or update.
:arg body: The ingest definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
for param in (id, body):
if param in SKIP_IN_PATH:
@@ -96,7 +138,16 @@ class IngestClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def delete_pipeline(
self,
id: Any,
@@ -107,13 +158,28 @@ class IngestClient(NamespacedClient):
Deletes a pipeline.
:arg id: Pipeline ID.
:arg id: Pipeline ID or wildcard expression of pipeline IDs used
to limit the request. To delete all ingest pipelines in a cluster, use a
value of `*`.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
@@ -125,7 +191,7 @@ class IngestClient(NamespacedClient):
headers=headers,
)
@query_params("verbose")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose")
async def simulate(
self,
body: Any,
@@ -138,9 +204,20 @@ class IngestClient(NamespacedClient):
:arg body: The simulate definition
:arg id: Pipeline ID.
:arg verbose: Verbose mode. Display data output for each
processor in executed pipeline. Default is false.
:arg id: Pipeline to test. If you dont specify a `pipeline` in
the request body, this parameter is required.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg verbose: If `true`, the response includes output data for
each processor in the executed pipeline.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -153,7 +230,7 @@ class IngestClient(NamespacedClient):
body=body,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def processor_grok(
self,
params: Any = None,
@@ -162,6 +239,17 @@ class IngestClient(NamespacedClient):
"""
Returns a list of the built-in patterns.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_ingest/processor/grok", params=params, headers=headers
+124 -52
View File
@@ -40,7 +40,7 @@ from .utils import NamespacedClient, _make_path, query_params
class NodesClient(NamespacedClient):
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
async def reload_secure_settings(
self,
body: Any = None,
@@ -54,10 +54,21 @@ class NodesClient(NamespacedClient):
:arg body: An object containing the password for the opensearch
keystore
:arg node_id: Comma-separated list of node IDs to span the
reload/reinit call. Should stay empty because reloading usually involves
all cluster nodes.
:arg timeout: Operation timeout.
:arg node_id: The names of particular nodes in the cluster to
target.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"POST",
@@ -67,7 +78,15 @@ class NodesClient(NamespacedClient):
body=body,
)
@query_params("flat_settings", "timeout")
@query_params(
"error_trace",
"filter_path",
"flat_settings",
"human",
"pretty",
"source",
"timeout",
)
async def info(
self,
node_id: Any = None,
@@ -79,16 +98,24 @@ class NodesClient(NamespacedClient):
Returns information about nodes in the cluster.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg metric: Comma-separated list of metrics you wish returned.
Leave empty to return all. Valid choices are settings, os, process, jvm,
thread_pool, transport, http, plugins, ingest.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg timeout: Operation timeout.
:arg node_id: Comma-separated list of node IDs or names used to
limit returned information.
:arg metric: Limits the information returned to the specific
metrics. Supports a comma-separated list, such as http,ingest.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If true, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"GET", _make_path("_nodes", node_id, metric), params=params, headers=headers
@@ -96,11 +123,16 @@ class NodesClient(NamespacedClient):
@query_params(
"completion_fields",
"error_trace",
"fielddata_fields",
"fields",
"filter_path",
"groups",
"human",
"include_segment_file_sizes",
"level",
"pretty",
"source",
"timeout",
"types",
)
@@ -116,35 +148,42 @@ class NodesClient(NamespacedClient):
Returns statistical information about nodes in the cluster.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg node_id: Comma-separated list of node IDs or names used to
limit returned information.
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os,
process, thread_pool, transport, discovery, indexing_pressure,
search_pipeline.
:arg index_metric: Limit the information returned for `indices`
metric to the specific index metrics. Isn't used if `indices` (or `all`)
metric isn't specified. Valid choices are _all, store, indexing, get,
search, merge, flush, refresh, query_cache, fielddata, docs, warmer,
completion, segments, translog, suggest, request_cache, recovery.
:arg completion_fields: Comma-separated list of fields for
`fielddata` and `suggest` index metric (supports wildcards).
:arg fielddata_fields: Comma-separated list of fields for
`fielddata` index metric (supports wildcards).
:arg fields: Comma-separated list of fields for `fielddata` and
`completion` index metric (supports wildcards).
:arg groups: Comma-separated list of search groups for `search`
index metric.
:arg include_segment_file_sizes: Whether to report the
metrics
:arg index_metric: Limit the information returned for indices
metric to the specific index metrics. It can be used only if indices (or
all) metric is specified.
:arg completion_fields: Comma-separated list or wildcard
expressions of fields to include in fielddata and suggest statistics.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg fielddata_fields: Comma-separated list or wildcard
expressions of fields to include in fielddata statistics.
:arg fields: Comma-separated list or wildcard expressions of
fields to include in the statistics.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg groups: Comma-separated list of search groups to include in
the search statistics.
:arg human: Whether to return human readable values for
statistics.
:arg include_segment_file_sizes: If true, the call reports the
aggregated disk usage of each one of the Lucene index files (only
applies if segment stats are requested). Default is false.
:arg level: Return indices stats aggregated at index, node or
shard level. Valid choices are indices, node, shards.
:arg timeout: Operation timeout.
:arg types: Comma-separated list of document types for the
`indexing` index metric.
applies if segment stats are requested).
:arg level: Indicates whether statistics are aggregated at the
cluster, index, or shard level. Valid choices are cluster, indices,
shards.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg types: A comma-separated list of document types for the
indexing index metric.
"""
return await self.transport.perform_request(
"GET",
@@ -154,7 +193,17 @@ class NodesClient(NamespacedClient):
)
@query_params(
"doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout"
"doc_type",
"error_trace",
"filter_path",
"human",
"ignore_idle_threads",
"interval",
"pretty",
"snapshots",
"source",
"threads",
"timeout",
)
async def hot_threads(
self,
@@ -172,12 +221,22 @@ class NodesClient(NamespacedClient):
nodes.
:arg doc_type: The type to sample. Valid choices are cpu, wait,
block.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
: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
task queue. Default is True.
:arg interval: The interval for the second sampling of threads.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg snapshots: Number of samples of thread stacktrace. Default
is 10.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg threads: Specify the number of threads to provide
information for. Default is 3.
:arg timeout: Operation timeout.
@@ -193,7 +252,7 @@ class NodesClient(NamespacedClient):
headers=headers,
)
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
async def usage(
self,
node_id: Any = None,
@@ -205,13 +264,26 @@ class NodesClient(NamespacedClient):
Returns low-level information about REST actions usage on nodes.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, rest_actions.
:arg timeout: Operation timeout.
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
the node you're connecting to, leave empty to get information from all
nodes
:arg metric: Limits the information returned to the specific
metrics. A comma-separated list of the following options: `_all`,
`rest_actions`.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return await self.transport.perform_request(
"GET",
+2
View File
@@ -13,6 +13,7 @@ from typing import Any
from ..plugins.alerting import AlertingClient
from ..plugins.index_management import IndexManagementClient
from ..plugins.knn import KnnClient
from ..plugins.notifications import NotificationsClient
from .client import Client
from .utils import NamespacedClient
@@ -23,6 +24,7 @@ class PluginsClient(NamespacedClient):
def __init__(self, client: Client) -> None:
super(PluginsClient, self).__init__(client)
self.notifications = NotificationsClient(client)
self.knn = KnnClient(client)
# self.query_workbench = QueryWorkbenchClient(client)
# self.reporting = ReportingClient(client)
+19 -1
View File
@@ -22,7 +22,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, query_params
class RemoteStoreClient(NamespacedClient):
@query_params("cluster_manager_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"pretty",
"source",
"wait_for_completion",
)
async def restore(
self,
body: Any,
@@ -36,6 +44,16 @@ class RemoteStoreClient(NamespacedClient):
:arg body: Comma-separated list of index IDs
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
"""
@@ -0,0 +1,90 @@
# 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 .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SearchPipelineClient(NamespacedClient):
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def create(
self,
pipeline: Any,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or replaces the specified search pipeline.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (pipeline, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return await self.transport.perform_request(
"PUT",
_make_path("_search", "pipeline", pipeline),
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get(
self,
pipeline: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Retrieves information about a specified search pipeline.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if pipeline in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'pipeline'.")
return await self.transport.perform_request(
"GET",
_make_path("_search", "pipeline", pipeline),
params=params,
headers=headers,
)
File diff suppressed because it is too large Load Diff
+282 -65
View File
@@ -40,7 +40,16 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SnapshotClient(NamespacedClient):
@query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"wait_for_completion",
)
async def create(
self,
repository: Any,
@@ -53,16 +62,29 @@ class SnapshotClient(NamespacedClient):
Creates a snapshot in a repository.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: Repository for the snapshot.
:arg snapshot: Name of the snapshot. Must be unique in the
repository.
:arg body: The snapshot definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: If `true`, the request returns a
response when the snapshot is complete. If `false`, the request returns
a response when the snapshot initializes.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -76,7 +98,15 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
async def delete(
self,
repository: Any,
@@ -88,13 +118,23 @@ class SnapshotClient(NamespacedClient):
Deletes a snapshot.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -108,7 +148,15 @@ class SnapshotClient(NamespacedClient):
)
@query_params(
"cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose"
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"ignore_unavailable",
"master_timeout",
"pretty",
"source",
"verbose",
)
async def get(
self,
@@ -121,18 +169,35 @@ class SnapshotClient(NamespacedClient):
Returns information about a snapshot.
:arg repository: Repository name.
:arg snapshot: Comma-separated list of snapshot names.
:arg repository: Comma-separated list of snapshot repository
names used to limit the request. Wildcard (*) expressions are supported.
:arg snapshot: Comma-separated list of snapshot names to
retrieve. Also accepts wildcards (*). - To get information about all
snapshots in a registered repository, use a wildcard (*) or _all. - To
get information about any snapshots that are currently running, use
_current.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If false, the request returns an error
for any snapshots that are unavailable.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg verbose: Whether to show verbose snapshot info or only show
the basic info found in the repository index blob.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg verbose: If true, returns additional information about each
snapshot such as the version of Opensearch which took the snapshot, the
start and end times of the snapshot, and the number of shards
snapshotted.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -145,7 +210,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def delete_repository(
self,
repository: Any,
@@ -160,10 +234,20 @@ class SnapshotClient(NamespacedClient):
Wildcard (`*`) patterns are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -175,7 +259,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
async def get_repository(
self,
repository: Any = None,
@@ -186,20 +279,40 @@ class SnapshotClient(NamespacedClient):
Returns information about a repository.
:arg repository: Comma-separated list of repository names.
:arg repository: A comma-separated list of repository names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", _make_path("_snapshot", repository), params=params, headers=headers
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
"verify",
)
async def create_repository(
self,
repository: Any,
@@ -211,15 +324,25 @@ class SnapshotClient(NamespacedClient):
Creates a repository.
:arg repository: Repository name.
:arg repository: A repository name
:arg body: The repository definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
:arg verify: Whether to verify the repository after creation.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
:arg verify: Whether to verify the repository after creation
"""
for param in (repository, body):
if param in SKIP_IN_PATH:
@@ -233,7 +356,16 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"wait_for_completion",
)
async def restore(
self,
repository: Any,
@@ -246,16 +378,26 @@ class SnapshotClient(NamespacedClient):
Restores a snapshot.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: A repository name
:arg snapshot: A snapshot name
:arg body: Details of what to restore
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
operation has completed before returning
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -269,7 +411,16 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"ignore_unavailable",
"master_timeout",
"pretty",
"source",
)
async def status(
self,
repository: Any = None,
@@ -281,16 +432,26 @@ class SnapshotClient(NamespacedClient):
Returns information about the status of a snapshot.
:arg repository: Repository name.
:arg snapshot: Comma-separated list of snapshot names.
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown. Default is false.
thrown
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
@@ -299,7 +460,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def verify_repository(
self,
repository: Any,
@@ -310,13 +480,23 @@ class SnapshotClient(NamespacedClient):
Verifies a repository.
:arg repository: Repository name.
:arg repository: A repository name
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -328,7 +508,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
async def cleanup_repository(
self,
repository: Any,
@@ -339,13 +528,23 @@ class SnapshotClient(NamespacedClient):
Removes stale data from repository.
:arg repository: Repository name.
:arg repository: Snapshot repository to clean up.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -357,7 +556,15 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
async def clone(
self,
repository: Any,
@@ -371,15 +578,25 @@ class SnapshotClient(NamespacedClient):
Clones indices from one snapshot into another snapshot in the same repository.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg target_snapshot: The name of the cloned snapshot to create.
:arg repository: A repository name
:arg snapshot: The name of the snapshot to clone from
:arg target_snapshot: The name of the cloned snapshot to create
:arg body: The snapshot clone definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (repository, snapshot, target_snapshot, body):
if param in SKIP_IN_PATH:
+84 -30
View File
@@ -44,9 +44,14 @@ class TasksClient(NamespacedClient):
@query_params(
"actions",
"detailed",
"error_trace",
"filter_path",
"group_by",
"human",
"nodes",
"parent_task_id",
"pretty",
"source",
"timeout",
"wait_for_completion",
)
@@ -59,27 +64,50 @@ class TasksClient(NamespacedClient):
Returns a list of tasks.
:arg actions: Comma-separated list of actions that should be
returned. Leave empty to return all.
:arg detailed: Return detailed task information. Default is
false.
:arg group_by: Group tasks by nodes or parent/child
relationships. Valid choices are nodes, parents, none.
:arg actions: Comma-separated list or wildcard expression of
actions used to limit the request.
:arg detailed: If `true`, the response includes detailed
information about shard recoveries.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg group_by: Key used to group tasks in the response. Valid
choices are nodes, parents, none.
:arg human: Whether to return human readable values for
statistics.
:arg nodes: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg parent_task_id: Return tasks with specified parent task id
(node_id:task_number). Set to -1 to return all.
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg parent_task_id: Parent task ID used to limit returned
information. To return all tasks, omit this parameter or use a value of
`-1`.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_completion: If `true`, the request blocks until
the operation is complete.
"""
return await self.transport.perform_request(
"GET", "/_tasks", params=params, headers=headers
)
@query_params("actions", "nodes", "parent_task_id", "wait_for_completion")
@query_params(
"actions",
"error_trace",
"filter_path",
"human",
"nodes",
"parent_task_id",
"pretty",
"source",
"wait_for_completion",
)
async def cancel(
self,
task_id: Any = None,
@@ -90,18 +118,25 @@ class TasksClient(NamespacedClient):
Cancels a task, if it can be cancelled through an API.
:arg task_id: Cancel the task with specified task id
(node_id:task_number).
:arg actions: Comma-separated list of actions that should be
cancelled. Leave empty to cancel all.
:arg nodes: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg parent_task_id: Cancel tasks with specified parent task id
(node_id:task_number). Set to -1 to cancel all.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg task_id: ID of the task.
:arg actions: Comma-separated list or wildcard expression of
actions used to limit the request.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg nodes: Comma-separated list of node IDs or names used to
limit the request.
:arg parent_task_id: Parent task ID used to limit the tasks.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should the request block until the
cancellation of the task and its descendant tasks is completed. Defaults
to false
"""
return await self.transport.perform_request(
"POST",
@@ -110,7 +145,15 @@ class TasksClient(NamespacedClient):
headers=headers,
)
@query_params("timeout", "wait_for_completion")
@query_params(
"error_trace",
"filter_path",
"human",
"pretty",
"source",
"timeout",
"wait_for_completion",
)
async def get(
self,
task_id: Any = None,
@@ -121,11 +164,22 @@ class TasksClient(NamespacedClient):
Returns information about a task.
:arg task_id: Return the task with specified id
(node_id:task_number).
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg task_id: ID of the task.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_completion: If `true`, the request blocks until
the task has completed.
"""
if task_id in SKIP_IN_PATH:
warnings.warn(
+73 -6
View File
@@ -22,7 +22,7 @@ from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_par
class KnnClient(NamespacedClient):
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_model(
self,
model_id: Any,
@@ -34,6 +34,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -45,7 +55,7 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_model(
self,
model_id: Any,
@@ -57,6 +67,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -81,15 +101,19 @@ class KnnClient(NamespacedClient):
"default_operator",
"df",
"docvalue_fields",
"error_trace",
"expand_wildcards",
"explain",
"filter_path",
"from_",
"human",
"ignore_throttled",
"ignore_unavailable",
"lenient",
"max_concurrent_shard_requests",
"pre_filter_shard_size",
"preference",
"pretty",
"q",
"request_cache",
"rest_total_hits_as_int",
@@ -99,6 +123,7 @@ class KnnClient(NamespacedClient):
"seq_no_primary_term",
"size",
"sort",
"source",
"stats",
"stored_fields",
"suggest_field",
@@ -151,12 +176,18 @@ class KnnClient(NamespacedClient):
given in the query string.
:arg docvalue_fields: Comma-separated list of fields to return
as the docvalue representation of a field for each hit.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg explain: Specify whether to return detailed information
about score computation as part of a hit.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset. Default is 0.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_throttled: Whether specified concrete, expanded or
aliased indices should be ignored when throttled.
:arg ignore_unavailable: Whether specified concrete indices
@@ -176,6 +207,8 @@ class KnnClient(NamespacedClient):
and the query are disjoint.
:arg preference: Specify the node or shard the operation should
be performed on. Default is random.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg q: Query in the Lucene query string syntax.
:arg request_cache: Specify if request cache should be used for
this request or not, defaults to index level setting.
@@ -191,6 +224,8 @@ class KnnClient(NamespacedClient):
number and primary term of the last modification of each hit.
:arg size: Number of hits to return. Default is 10.
:arg sort: Comma-separated list of <field>:<direction> pairs.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg stats: Specific 'tag' of the request for logging and
statistical purposes.
:arg stored_fields: Comma-separated list of stored fields to
@@ -226,7 +261,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
async def stats(
self,
node_id: Any = None,
@@ -254,6 +289,16 @@ class KnnClient(NamespacedClient):
model_index_status, indexing_from_model_degraded, training_requests,
training_errors, training_memory_usage,
training_memory_usage_percentage.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Operation timeout.
"""
return await self.transport.perform_request(
@@ -263,7 +308,9 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params("preference")
@query_params(
"error_trace", "filter_path", "human", "preference", "pretty", "source"
)
async def train_model(
self,
body: Any,
@@ -277,7 +324,17 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg preference: Preferred node to execute training.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -290,7 +347,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def warmup(
self,
index: Any,
@@ -299,11 +356,21 @@ class KnnClient(NamespacedClient):
) -> Any:
"""
Preloads native library files into memory, reducing initial search latency for
specified indexes
specified indexes.
:arg index: Comma-separated list of indices; use `_all` or empty
string to perform the operation on all indices.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
@@ -0,0 +1,326 @@
# 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 SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class NotificationsClient(NamespacedClient):
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def create_config(
self,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Create channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return await self.transport.perform_request(
"POST",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete a channel configuration.
:arg config_id: The ID of the channel configuration to delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"DELETE",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"config_id",
"config_id_list",
"error_trace",
"filter_path",
"human",
"pretty",
"source",
)
async def delete_configs(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete multiple channel configurations.
:arg config_id: The ID of the channel configuration to delete.
:arg config_id_list: A comma-separated list of channel IDs to
delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE", "/_plugins/_notifications/configs", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get a specific channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"chime.url",
"chime.url.keyword",
"config_type",
"created_time_ms",
"description",
"description.keyword",
"email.email_account_id",
"email.email_group_id_list",
"email.recipient_list.recipient",
"email.recipient_list.recipient.keyword",
"email_group.recipient_list.recipient",
"email_group.recipient_list.recipient.keyword",
"error_trace",
"filter_path",
"human",
"is_enabled",
"last_updated_time_ms",
"microsoft_teams.url",
"microsoft_teams.url.keyword",
"name",
"name.keyword",
"pretty",
"query",
"ses_account.from_address",
"ses_account.from_address.keyword",
"ses_account.region",
"ses_account.role_arn",
"ses_account.role_arn.keyword",
"slack.url",
"slack.url.keyword",
"smtp_account.from_address",
"smtp_account.from_address.keyword",
"smtp_account.host",
"smtp_account.host.keyword",
"smtp_account.method",
"sns.role_arn",
"sns.role_arn.keyword",
"sns.topic_arn",
"sns.topic_arn.keyword",
"source",
"text_query",
"webhook.url",
"webhook.url.keyword",
)
async def get_configs(
self,
body: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get multiple channel configurations with filtering.
:arg config_type: Type of notification configuration. Valid
choices are slack, chime, microsoft_teams, webhook, email, sns,
ses_account, smtp_account, email_group.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def list_features(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
List supported channel configurations.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_plugins/_notifications/features", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def send_test(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Send a test notification.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "feature", "test", config_id),
params=params,
headers=headers,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def update_config(
self,
config_id: Any,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Update channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (config_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return await self.transport.perform_request(
"PUT",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
body=body,
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+482 -118
View File
@@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient):
@query_params(
"awareness_attribute",
"cluster_manager_timeout",
"error_trace",
"expand_wildcards",
"filter_path",
"human",
"level",
"local",
"master_timeout",
"pretty",
"source",
"timeout",
"wait_for_active_shards",
"wait_for_events",
@@ -65,36 +70,63 @@ class ClusterClient(NamespacedClient):
Returns basic information about the health of the cluster.
:arg index: Limit the information returned to specific indicies.
:arg index: Comma-separated list of data streams, indices, and
index aliases used to limit the request. Wildcard expressions (*) are
supported. To target all data streams and indices in a cluster, omit
this parameter or use `_all` or `*`.
:arg awareness_attribute: The awareness attribute for which the
health is required.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg level: Specify the level of detail for returned
information. Valid choices are cluster, indices, shards,
awareness_attributes.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg level: Can be one of cluster, indices or shards. Controls
the details level of the health information returned. Valid choices are
cluster, indices, shards, awareness_attributes.
:arg local: If true, the request retrieves information from the
local node only. Defaults to false, which means information is retrieved
from the master 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.
:arg wait_for_active_shards: Wait until the specified number of
shards is active.
:arg wait_for_events: Wait until all currently queued events
with the given priority are processed. Valid choices are immediate,
urgent, high, normal, low, languid.
:arg wait_for_no_initializing_shards: Whether to wait until
there are no initializing shards in the cluster.
:arg wait_for_no_relocating_shards: Whether to wait until there
are no relocating shards in the cluster.
:arg wait_for_nodes: Wait until the specified number of nodes is
available.
:arg wait_for_status: Wait until cluster is in a specific state.
Valid choices are green, yellow, red.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_active_shards: A number controlling to how many
active shards to wait for, all to wait for all shards in the cluster to
be active, or 0 to not wait. Valid choices are all, index-setting.
:arg wait_for_events: Can be one of immediate, urgent, high,
normal, low, languid. Wait until all currently queued events with the
given priority are processed. Valid choices are immediate, urgent, high,
normal, low, languid.
:arg wait_for_no_initializing_shards: A boolean value which
controls whether to wait (until the timeout provided) for the cluster to
have no shard initializations. Defaults to false, which means it will
not wait for initializing shards.
:arg wait_for_no_relocating_shards: A boolean value which
controls whether to wait (until the timeout provided) for the cluster to
have no shard relocations. Defaults to false, which means it will not
wait for relocating shards.
:arg wait_for_nodes: The request waits until the specified
number N of nodes is available. It also accepts >=N, <=N, >N and <N.
Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N)
notation.
:arg wait_for_status: One of green, yellow or red. Will wait
(until the timeout provided) until the status of the cluster changes to
the one provided or better, i.e. green > yellow > red. By default, will
not wait for any status. Valid choices are green, yellow, red.
"""
return self.transport.perform_request(
"GET",
@@ -103,7 +135,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
def pending_tasks(
self,
params: Any = None,
@@ -116,11 +157,23 @@ class ClusterClient(NamespacedClient):
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If `true`, the request retrieves information from
the local node only.If `false`, information is retrieved from the master
node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_cluster/pending_tasks", params=params, headers=headers
@@ -129,11 +182,16 @@ class ClusterClient(NamespacedClient):
@query_params(
"allow_no_indices",
"cluster_manager_timeout",
"error_trace",
"expand_wildcards",
"filter_path",
"flat_settings",
"human",
"ignore_unavailable",
"local",
"master_timeout",
"pretty",
"source",
"wait_for_metadata_version",
"wait_for_timeout",
)
@@ -149,31 +207,40 @@ class ClusterClient(NamespacedClient):
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, blocks, metadata, nodes, routing_table,
routing_nodes, master_node, cluster_manager_node, version.
:arg index: Comma-separated list of indices; use `_all` or empty
string to perform the operation on all indices.
metrics
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified).
string or when no indices have been specified)
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed).
should be ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_metadata_version: Wait for the metadata version to
be equal or greater than the specified metadata version.
be equal or greater than the specified metadata version
:arg wait_for_timeout: The maximum time to wait for
wait_for_metadata_version before timing out.
wait_for_metadata_version before timing out
"""
if index and metric in SKIP_IN_PATH:
metric = "_all"
@@ -185,7 +252,15 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("flat_settings", "timeout")
@query_params(
"error_trace",
"filter_path",
"flat_settings",
"human",
"pretty",
"source",
"timeout",
)
def stats(
self,
node_id: Any = None,
@@ -196,13 +271,23 @@ class ClusterClient(NamespacedClient):
Returns high-level overview of cluster statistics.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg timeout: Operation timeout.
:arg node_id: Comma-separated list of node filters used to limit
returned information. Defaults to all nodes in the cluster.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If `true`, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for each node to respond.If a node
does not respond before its timeout expires, the response does not
include its stats.However, timed out nodes are included in the
responses `_nodes.failed` property. Defaults to no timeout.
"""
return self.transport.perform_request(
"GET",
@@ -218,10 +303,15 @@ class ClusterClient(NamespacedClient):
@query_params(
"cluster_manager_timeout",
"dry_run",
"error_trace",
"explain",
"filter_path",
"human",
"master_timeout",
"metric",
"pretty",
"retry_failed",
"source",
"timeout",
)
def reroute(
@@ -238,18 +328,31 @@ class ClusterClient(NamespacedClient):
`cancel`, `allocate`)
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg dry_run: Simulate the operation only and return the
resulting state.
:arg explain: Return an explanation of why the commands can or
cannot be executed.
:arg dry_run: If true, then the request simulates the operation
only and returns the resulting state.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg explain: If true, then the response contains an explanation
of why the commands can or cannot be executed.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg metric: Limit the information returned to the specified
metrics. Defaults to all but metadata.
:arg retry_failed: Retries allocation of shards that are blocked
due to too many subsequent allocation failures.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg metric: Limits the information returned to the specified
metrics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg retry_failed: If true, then retries allocation of shards
that are blocked due to too many subsequent allocation failures.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"POST", "/_cluster/reroute", params=params, headers=headers, body=body
@@ -257,9 +360,14 @@ class ClusterClient(NamespacedClient):
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"flat_settings",
"human",
"include_defaults",
"master_timeout",
"pretty",
"source",
"timeout",
)
def get_settings(
@@ -273,21 +381,41 @@ class ClusterClient(NamespacedClient):
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg include_defaults: Whether to return all default clusters
setting. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If `true`, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg include_defaults: If `true`, returns default cluster
settings from the local 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.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"GET", "/_cluster/settings", params=params, headers=headers
)
@query_params(
"cluster_manager_timeout", "flat_settings", "master_timeout", "timeout"
"cluster_manager_timeout",
"error_trace",
"filter_path",
"flat_settings",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def put_settings(
self,
@@ -303,12 +431,22 @@ class ClusterClient(NamespacedClient):
or `persistent` (survives cluster restart).
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false)
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -317,7 +455,7 @@ class ClusterClient(NamespacedClient):
"PUT", "/_cluster/settings", params=params, headers=headers, body=body
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def remote_info(
self,
params: Any = None,
@@ -326,12 +464,31 @@ class ClusterClient(NamespacedClient):
"""
Returns the information about configured remote clusters.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_remote/info", params=params, headers=headers
)
@query_params("include_disk_info", "include_yes_decisions")
@query_params(
"error_trace",
"filter_path",
"human",
"include_disk_info",
"include_yes_decisions",
"pretty",
"source",
)
def allocation_explain(
self,
body: Any = None,
@@ -344,10 +501,20 @@ class ClusterClient(NamespacedClient):
:arg body: The index, shard, and primary flag to explain. Empty
means 'explain the first unassigned shard'
:arg include_disk_info: Return information about disk usage and
shard sizes. Default is false.
:arg include_yes_decisions: Return 'YES' decisions in
explanation. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg include_disk_info: If true, returns information about disk
usage and shard sizes.
:arg include_yes_decisions: If true, returns YES decisions in
explanation.
:arg pretty: Whether to pretty format the returned JSON
response.
: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",
@@ -357,7 +524,16 @@ class ClusterClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def delete_component_template(
self,
name: Any,
@@ -368,13 +544,27 @@ class ClusterClient(NamespacedClient):
Deletes a component template.
:arg name: The name of the template.
:arg name: Name of the component template to delete. Wildcard
(*) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")
@@ -386,7 +576,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
def get_component_template(
self,
name: Any = None,
@@ -397,14 +596,27 @@ class ClusterClient(NamespacedClient):
Returns one or more component templates.
:arg name: The Comma-separated names of the component templates.
:arg name: Name of the component template to retrieve. Wildcard
(`*`) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If `true`, the request retrieves information from
the local node only.If `false`, information is retrieved from the master
node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
@@ -413,7 +625,17 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "create", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"create",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def put_component_template(
self,
name: Any,
@@ -425,15 +647,35 @@ class ClusterClient(NamespacedClient):
Creates or updates a component template.
:arg name: The name of the template.
:arg name: Name of the component template to create. Opensearch
includes the following built-in component templates: `logs-mappings`;
'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-
mapping`; `synthetics-settings`. Opensearch Agent uses these templates
to configure backing indices for its data streams. If you use Opensearch
Agent and want to overwrite one of these templates, set the `version`
for your replacement template higher than the current version. If you
dont use Opensearch Agent and want to disable all built-in component
and index templates, set `stack.templates.enabled` to `false` using the
cluster update settings API.
:arg body: The template definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg create: Whether the index template should only be added if
new or can also replace an existing one. Default is false.
:arg create: If `true`, this request cannot replace or update
existing component templates.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Operation timeout.
"""
for param in (name, body):
@@ -448,7 +690,16 @@ class ClusterClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
def exists_component_template(
self,
name: Any,
@@ -459,14 +710,27 @@ class ClusterClient(NamespacedClient):
Returns information about whether a particular component template exist.
:arg name: The name of the template.
:arg name: Name of the component template to check existence of.
Wildcard (*) expressions are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: If true, the request retrieves information from the
local node only.Defaults to false, which means information is retrieved
from the master node.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response isreceived before the timeout
expires, the request fails and returns anerror.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")
@@ -478,7 +742,9 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("wait_for_removal")
@query_params(
"error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal"
)
def delete_voting_config_exclusions(
self,
params: Any = None,
@@ -488,9 +754,22 @@ class ClusterClient(NamespacedClient):
Clears cluster voting config exclusions.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_removal: Specifies whether to wait for all
excluded nodes to be removed from the cluster before clearing the voting
configuration exclusions list. Default is True.
excluded nodes to be removed from thecluster before clearing the voting
configuration exclusions list.Defaults to true, meaning that all
excluded nodes must be removed fromthe cluster before this API takes any
action. If set to false then thevoting configuration exclusions list is
cleared even if some excludednodes are still in the cluster.
"""
return self.transport.perform_request(
"DELETE",
@@ -499,7 +778,16 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params("node_ids", "node_names", "timeout")
@query_params(
"error_trace",
"filter_path",
"human",
"node_ids",
"node_names",
"pretty",
"source",
"timeout",
)
def post_voting_config_exclusions(
self,
params: Any = None,
@@ -509,19 +797,33 @@ class ClusterClient(NamespacedClient):
Updates the cluster voting config exclusions by node ids or node names.
:arg node_ids: Comma-separated list of the persistent ids of the
nodes to exclude from the voting configuration. If specified, you may
not also specify ?node_names.
:arg node_names: Comma-separated list of the names of the nodes
to exclude from the voting configuration. If specified, you may not also
specify ?node_ids.
:arg timeout: Operation timeout.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg node_ids: A comma-separated list of the persistent ids of
the nodes to excludefrom the voting configuration. If specified, you may
not also specify node_names.
:arg node_names: A comma-separated list of the names of the
nodes to exclude from thevoting configuration. If specified, you may not
also specify node_ids.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: When adding a voting configuration exclusion, the
API waits for thespecified nodes to be excluded from the voting
configuration beforereturning. If the timeout expires before the
appropriate conditionis satisfied, the request fails and returns an
error.
"""
return self.transport.perform_request(
"POST", "/_cluster/voting_config_exclusions", params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def delete_decommission_awareness(
self,
params: Any = None,
@@ -530,12 +832,23 @@ class ClusterClient(NamespacedClient):
"""
Delete any existing decommission.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE", "/_cluster/decommission/awareness", params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def delete_weighted_routing(
self,
params: Any = None,
@@ -544,6 +857,17 @@ class ClusterClient(NamespacedClient):
"""
Delete weighted shard routing weights.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE",
@@ -552,7 +876,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def get_decommission_awareness(
self,
awareness_attribute_name: Any,
@@ -564,6 +888,16 @@ class ClusterClient(NamespacedClient):
:arg awareness_attribute_name: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if awareness_attribute_name in SKIP_IN_PATH:
raise ValueError(
@@ -583,7 +917,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def get_weighted_routing(
self,
attribute: Any,
@@ -595,6 +929,16 @@ class ClusterClient(NamespacedClient):
:arg attribute: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if attribute in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'attribute'.")
@@ -606,7 +950,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def put_decommission_awareness(
self,
awareness_attribute_name: Any,
@@ -620,6 +964,16 @@ class ClusterClient(NamespacedClient):
:arg awareness_attribute_name: Awareness attribute name.
:arg awareness_attribute_value: Awareness attribute value.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (awareness_attribute_name, awareness_attribute_value):
if param in SKIP_IN_PATH:
@@ -638,7 +992,7 @@ class ClusterClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def put_weighted_routing(
self,
attribute: Any,
@@ -650,6 +1004,16 @@ class ClusterClient(NamespacedClient):
:arg attribute: Awareness attribute name.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if attribute in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'attribute'.")
+60 -13
View File
@@ -41,7 +41,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
"accept_data_loss",
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def delete_dangling_index(
self,
@@ -53,15 +61,25 @@ class DanglingIndicesClient(NamespacedClient):
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.
the dangling index
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
@@ -74,7 +92,15 @@ class DanglingIndicesClient(NamespacedClient):
)
@query_params(
"accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout"
"accept_data_loss",
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def import_dangling_index(
self,
@@ -86,15 +112,25 @@ class DanglingIndicesClient(NamespacedClient):
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.
the dangling index
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if index_uuid in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index_uuid'.")
@@ -103,7 +139,7 @@ class DanglingIndicesClient(NamespacedClient):
"POST", _make_path("_dangling", index_uuid), params=params, headers=headers
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def list_dangling_indices(
self,
params: Any = None,
@@ -112,6 +148,17 @@ class DanglingIndicesClient(NamespacedClient):
"""
Returns all dangling indices.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_dangling", params=params, headers=headers
File diff suppressed because it is too large Load Diff
+108 -20
View File
@@ -40,7 +40,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IngestClient(NamespacedClient):
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
def get_pipeline(
self,
id: Any = None,
@@ -51,19 +59,40 @@ class IngestClient(NamespacedClient):
Returns a pipeline.
:arg id: Comma-separated list of pipeline ids. Wildcards
supported.
:arg id: Comma-separated list of pipeline IDs to retrieve.
Wildcard (`*`) expressions are supported. To get all ingest pipelines,
omit this parameter or use `*`.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def put_pipeline(
self,
id: Any,
@@ -75,14 +104,27 @@ class IngestClient(NamespacedClient):
Creates or updates a pipeline.
:arg id: Pipeline ID.
:arg id: ID of the ingest pipeline to create or update.
:arg body: The ingest definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
for param in (id, body):
if param in SKIP_IN_PATH:
@@ -96,7 +138,16 @@ class IngestClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def delete_pipeline(
self,
id: Any,
@@ -107,13 +158,28 @@ class IngestClient(NamespacedClient):
Deletes a pipeline.
:arg id: Pipeline ID.
:arg id: Pipeline ID or wildcard expression of pipeline IDs used
to limit the request. To delete all ingest pipelines in a cluster, use a
value of `*`.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
@@ -125,7 +191,7 @@ class IngestClient(NamespacedClient):
headers=headers,
)
@query_params("verbose")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose")
def simulate(
self,
body: Any,
@@ -138,9 +204,20 @@ class IngestClient(NamespacedClient):
:arg body: The simulate definition
:arg id: Pipeline ID.
:arg verbose: Verbose mode. Display data output for each
processor in executed pipeline. Default is false.
:arg id: Pipeline to test. If you dont specify a `pipeline` in
the request body, this parameter is required.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg verbose: If `true`, the response includes output data for
each processor in the executed pipeline.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -153,7 +230,7 @@ class IngestClient(NamespacedClient):
body=body,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def processor_grok(
self,
params: Any = None,
@@ -162,6 +239,17 @@ class IngestClient(NamespacedClient):
"""
Returns a list of the built-in patterns.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_ingest/processor/grok", params=params, headers=headers
+124 -52
View File
@@ -40,7 +40,7 @@ from .utils import NamespacedClient, _make_path, query_params
class NodesClient(NamespacedClient):
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
def reload_secure_settings(
self,
body: Any = None,
@@ -54,10 +54,21 @@ class NodesClient(NamespacedClient):
:arg body: An object containing the password for the opensearch
keystore
:arg node_id: Comma-separated list of node IDs to span the
reload/reinit call. Should stay empty because reloading usually involves
all cluster nodes.
:arg timeout: Operation timeout.
:arg node_id: The names of particular nodes in the cluster to
target.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"POST",
@@ -67,7 +78,15 @@ class NodesClient(NamespacedClient):
body=body,
)
@query_params("flat_settings", "timeout")
@query_params(
"error_trace",
"filter_path",
"flat_settings",
"human",
"pretty",
"source",
"timeout",
)
def info(
self,
node_id: Any = None,
@@ -79,16 +98,24 @@ class NodesClient(NamespacedClient):
Returns information about nodes in the cluster.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg metric: Comma-separated list of metrics you wish returned.
Leave empty to return all. Valid choices are settings, os, process, jvm,
thread_pool, transport, http, plugins, ingest.
:arg flat_settings: Return settings in flat format. Default is
false.
:arg timeout: Operation timeout.
:arg node_id: Comma-separated list of node IDs or names used to
limit returned information.
:arg metric: Limits the information returned to the specific
metrics. Supports a comma-separated list, such as http,ingest.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: If true, returns settings in flat format.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"GET", _make_path("_nodes", node_id, metric), params=params, headers=headers
@@ -96,11 +123,16 @@ class NodesClient(NamespacedClient):
@query_params(
"completion_fields",
"error_trace",
"fielddata_fields",
"fields",
"filter_path",
"groups",
"human",
"include_segment_file_sizes",
"level",
"pretty",
"source",
"timeout",
"types",
)
@@ -116,35 +148,42 @@ class NodesClient(NamespacedClient):
Returns statistical information about nodes in the cluster.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg node_id: Comma-separated list of node IDs or names used to
limit returned information.
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os,
process, thread_pool, transport, discovery, indexing_pressure,
search_pipeline.
:arg index_metric: Limit the information returned for `indices`
metric to the specific index metrics. Isn't used if `indices` (or `all`)
metric isn't specified. Valid choices are _all, store, indexing, get,
search, merge, flush, refresh, query_cache, fielddata, docs, warmer,
completion, segments, translog, suggest, request_cache, recovery.
:arg completion_fields: Comma-separated list of fields for
`fielddata` and `suggest` index metric (supports wildcards).
:arg fielddata_fields: Comma-separated list of fields for
`fielddata` index metric (supports wildcards).
:arg fields: Comma-separated list of fields for `fielddata` and
`completion` index metric (supports wildcards).
:arg groups: Comma-separated list of search groups for `search`
index metric.
:arg include_segment_file_sizes: Whether to report the
metrics
:arg index_metric: Limit the information returned for indices
metric to the specific index metrics. It can be used only if indices (or
all) metric is specified.
:arg completion_fields: Comma-separated list or wildcard
expressions of fields to include in fielddata and suggest statistics.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg fielddata_fields: Comma-separated list or wildcard
expressions of fields to include in fielddata statistics.
:arg fields: Comma-separated list or wildcard expressions of
fields to include in the statistics.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg groups: Comma-separated list of search groups to include in
the search statistics.
:arg human: Whether to return human readable values for
statistics.
:arg include_segment_file_sizes: If true, the call reports the
aggregated disk usage of each one of the Lucene index files (only
applies if segment stats are requested). Default is false.
:arg level: Return indices stats aggregated at index, node or
shard level. Valid choices are indices, node, shards.
:arg timeout: Operation timeout.
:arg types: Comma-separated list of document types for the
`indexing` index metric.
applies if segment stats are requested).
:arg level: Indicates whether statistics are aggregated at the
cluster, index, or shard level. Valid choices are cluster, indices,
shards.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg types: A comma-separated list of document types for the
indexing index metric.
"""
return self.transport.perform_request(
"GET",
@@ -154,7 +193,17 @@ class NodesClient(NamespacedClient):
)
@query_params(
"doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout"
"doc_type",
"error_trace",
"filter_path",
"human",
"ignore_idle_threads",
"interval",
"pretty",
"snapshots",
"source",
"threads",
"timeout",
)
def hot_threads(
self,
@@ -172,12 +221,22 @@ class NodesClient(NamespacedClient):
nodes.
:arg doc_type: The type to sample. Valid choices are cpu, wait,
block.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
: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
task queue. Default is True.
:arg interval: The interval for the second sampling of threads.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg snapshots: Number of samples of thread stacktrace. Default
is 10.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg threads: Specify the number of threads to provide
information for. Default is 3.
:arg timeout: Operation timeout.
@@ -193,7 +252,7 @@ class NodesClient(NamespacedClient):
headers=headers,
)
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
def usage(
self,
node_id: Any = None,
@@ -205,13 +264,26 @@ class NodesClient(NamespacedClient):
Returns low-level information about REST actions usage on nodes.
:arg node_id: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg metric: Limit the information returned to the specified
metrics. Valid choices are _all, rest_actions.
:arg timeout: Operation timeout.
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
the node you're connecting to, leave empty to get information from all
nodes
:arg metric: Limits the information returned to the specific
metrics. A comma-separated list of the following options: `_all`,
`rest_actions`.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
"""
return self.transport.perform_request(
"GET",
+2
View File
@@ -13,6 +13,7 @@ from typing import Any
from ..plugins.alerting import AlertingClient
from ..plugins.index_management import IndexManagementClient
from ..plugins.knn import KnnClient
from ..plugins.notifications import NotificationsClient
from .client import Client
from .utils import NamespacedClient
@@ -23,6 +24,7 @@ class PluginsClient(NamespacedClient):
def __init__(self, client: Client) -> None:
super(PluginsClient, self).__init__(client)
self.notifications = NotificationsClient(client)
self.knn = KnnClient(client)
# self.query_workbench = QueryWorkbenchClient(client)
# self.reporting = ReportingClient(client)
+19 -1
View File
@@ -22,7 +22,15 @@ from .utils import SKIP_IN_PATH, NamespacedClient, query_params
class RemoteStoreClient(NamespacedClient):
@query_params("cluster_manager_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"pretty",
"source",
"wait_for_completion",
)
def restore(
self,
body: Any,
@@ -36,6 +44,16 @@ class RemoteStoreClient(NamespacedClient):
:arg body: Comma-separated list of index IDs
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
"""
+90
View File
@@ -0,0 +1,90 @@
# 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 .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SearchPipelineClient(NamespacedClient):
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def create(
self,
pipeline: Any,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Creates or replaces the specified search pipeline.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (pipeline, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_search", "pipeline", pipeline),
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def get(
self,
pipeline: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Retrieves information about a specified search pipeline.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if pipeline in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'pipeline'.")
return self.transport.perform_request(
"GET",
_make_path("_search", "pipeline", pipeline),
params=params,
headers=headers,
)
File diff suppressed because it is too large Load Diff
+282 -65
View File
@@ -40,7 +40,16 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SnapshotClient(NamespacedClient):
@query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"wait_for_completion",
)
def create(
self,
repository: Any,
@@ -53,16 +62,29 @@ class SnapshotClient(NamespacedClient):
Creates a snapshot in a repository.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: Repository for the snapshot.
:arg snapshot: Name of the snapshot. Must be unique in the
repository.
:arg body: The snapshot definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: If `true`, the request returns a
response when the snapshot is complete. If `false`, the request returns
a response when the snapshot initializes.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -76,7 +98,15 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
def delete(
self,
repository: Any,
@@ -88,13 +118,23 @@ class SnapshotClient(NamespacedClient):
Deletes a snapshot.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -108,7 +148,15 @@ class SnapshotClient(NamespacedClient):
)
@query_params(
"cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose"
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"ignore_unavailable",
"master_timeout",
"pretty",
"source",
"verbose",
)
def get(
self,
@@ -121,18 +169,35 @@ class SnapshotClient(NamespacedClient):
Returns information about a snapshot.
:arg repository: Repository name.
:arg snapshot: Comma-separated list of snapshot names.
:arg repository: Comma-separated list of snapshot repository
names used to limit the request. Wildcard (*) expressions are supported.
:arg snapshot: Comma-separated list of snapshot names to
retrieve. Also accepts wildcards (*). - To get information about all
snapshots in a registered repository, use a wildcard (*) or _all. - To
get information about any snapshots that are currently running, use
_current.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown. Default is false.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If false, the request returns an error
for any snapshots that are unavailable.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg verbose: Whether to show verbose snapshot info or only show
the basic info found in the repository index blob.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node. If no response is received before the timeout
expires, the request fails and returns an error.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg verbose: If true, returns additional information about each
snapshot such as the version of Opensearch which took the snapshot, the
start and end times of the snapshot, and the number of shards
snapshotted.
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -145,7 +210,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def delete_repository(
self,
repository: Any,
@@ -160,10 +234,20 @@ class SnapshotClient(NamespacedClient):
Wildcard (`*`) patterns are supported.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -175,7 +259,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "local", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"local",
"master_timeout",
"pretty",
"source",
)
def get_repository(
self,
repository: Any = None,
@@ -186,20 +279,40 @@ class SnapshotClient(NamespacedClient):
Returns information about a repository.
:arg repository: Comma-separated list of repository names.
:arg repository: A comma-separated list of repository names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node. Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", _make_path("_snapshot", repository), params=params, headers=headers
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
"verify",
)
def create_repository(
self,
repository: Any,
@@ -211,15 +324,25 @@ class SnapshotClient(NamespacedClient):
Creates a repository.
:arg repository: Repository name.
:arg repository: A repository name
:arg body: The repository definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
:arg verify: Whether to verify the repository after creation.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
:arg verify: Whether to verify the repository after creation
"""
for param in (repository, body):
if param in SKIP_IN_PATH:
@@ -233,7 +356,16 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"wait_for_completion",
)
def restore(
self,
repository: Any,
@@ -246,16 +378,26 @@ class SnapshotClient(NamespacedClient):
Restores a snapshot.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg repository: A repository name
:arg snapshot: A snapshot name
:arg body: Details of what to restore
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
operation has completed before returning
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
@@ -269,7 +411,16 @@ class SnapshotClient(NamespacedClient):
body=body,
)
@query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"ignore_unavailable",
"master_timeout",
"pretty",
"source",
)
def status(
self,
repository: Any = None,
@@ -281,16 +432,26 @@ class SnapshotClient(NamespacedClient):
Returns information about the status of a snapshot.
:arg repository: Repository name.
:arg snapshot: Comma-separated list of snapshot names.
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown. Default is false.
thrown
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
@@ -299,7 +460,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def verify_repository(
self,
repository: Any,
@@ -310,13 +480,23 @@ class SnapshotClient(NamespacedClient):
Verifies a repository.
:arg repository: Repository name.
:arg repository: A repository name
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -328,7 +508,16 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout", "timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
"timeout",
)
def cleanup_repository(
self,
repository: Any,
@@ -339,13 +528,23 @@ class SnapshotClient(NamespacedClient):
Removes stale data from repository.
:arg repository: Repository name.
:arg repository: Snapshot repository to clean up.
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
:arg timeout: Operation timeout.
use 'cluster_manager_timeout' instead.): Period to wait for a connection
to the master node.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
@@ -357,7 +556,15 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("cluster_manager_timeout", "master_timeout")
@query_params(
"cluster_manager_timeout",
"error_trace",
"filter_path",
"human",
"master_timeout",
"pretty",
"source",
)
def clone(
self,
repository: Any,
@@ -371,15 +578,25 @@ class SnapshotClient(NamespacedClient):
Clones indices from one snapshot into another snapshot in the same repository.
:arg repository: Repository name.
:arg snapshot: Snapshot name.
:arg target_snapshot: The name of the cloned snapshot to create.
:arg repository: A repository name
:arg snapshot: The name of the snapshot to clone from
:arg target_snapshot: The name of the cloned snapshot to create
:arg body: The snapshot clone definition
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Operation timeout for
connection to master node.
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (repository, snapshot, target_snapshot, body):
if param in SKIP_IN_PATH:
+84 -30
View File
@@ -44,9 +44,14 @@ class TasksClient(NamespacedClient):
@query_params(
"actions",
"detailed",
"error_trace",
"filter_path",
"group_by",
"human",
"nodes",
"parent_task_id",
"pretty",
"source",
"timeout",
"wait_for_completion",
)
@@ -59,27 +64,50 @@ class TasksClient(NamespacedClient):
Returns a list of tasks.
:arg actions: Comma-separated list of actions that should be
returned. Leave empty to return all.
:arg detailed: Return detailed task information. Default is
false.
:arg group_by: Group tasks by nodes or parent/child
relationships. Valid choices are nodes, parents, none.
:arg actions: Comma-separated list or wildcard expression of
actions used to limit the request.
:arg detailed: If `true`, the response includes detailed
information about shard recoveries.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg group_by: Key used to group tasks in the response. Valid
choices are nodes, parents, none.
:arg human: Whether to return human readable values for
statistics.
:arg nodes: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg parent_task_id: Return tasks with specified parent task id
(node_id:task_number). Set to -1 to return all.
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg parent_task_id: Parent task ID used to limit returned
information. To return all tasks, omit this parameter or use a value of
`-1`.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response. If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_completion: If `true`, the request blocks until
the operation is complete.
"""
return self.transport.perform_request(
"GET", "/_tasks", params=params, headers=headers
)
@query_params("actions", "nodes", "parent_task_id", "wait_for_completion")
@query_params(
"actions",
"error_trace",
"filter_path",
"human",
"nodes",
"parent_task_id",
"pretty",
"source",
"wait_for_completion",
)
def cancel(
self,
task_id: Any = None,
@@ -90,18 +118,25 @@ class TasksClient(NamespacedClient):
Cancels a task, if it can be cancelled through an API.
:arg task_id: Cancel the task with specified task id
(node_id:task_number).
:arg actions: Comma-separated list of actions that should be
cancelled. Leave empty to cancel all.
:arg nodes: Comma-separated list of node IDs or names to limit
the returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes.
:arg parent_task_id: Cancel tasks with specified parent task id
(node_id:task_number). Set to -1 to cancel all.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg task_id: ID of the task.
:arg actions: Comma-separated list or wildcard expression of
actions used to limit the request.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg nodes: Comma-separated list of node IDs or names used to
limit the request.
:arg parent_task_id: Parent task ID used to limit the tasks.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg wait_for_completion: Should the request block until the
cancellation of the task and its descendant tasks is completed. Defaults
to false
"""
return self.transport.perform_request(
"POST",
@@ -110,7 +145,15 @@ class TasksClient(NamespacedClient):
headers=headers,
)
@query_params("timeout", "wait_for_completion")
@query_params(
"error_trace",
"filter_path",
"human",
"pretty",
"source",
"timeout",
"wait_for_completion",
)
def get(
self,
task_id: Any = None,
@@ -121,11 +164,22 @@ class TasksClient(NamespacedClient):
Returns information about a task.
:arg task_id: Return the task with specified id
(node_id:task_number).
:arg timeout: Operation timeout.
:arg wait_for_completion: Should this request wait until the
operation has completed before returning. Default is false.
:arg task_id: ID of the task.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Period to wait for a response.If no response is
received before the timeout expires, the request fails and returns an
error.
:arg wait_for_completion: If `true`, the request blocks until
the task has completed.
"""
if task_id in SKIP_IN_PATH:
warnings.warn(
+73 -6
View File
@@ -22,7 +22,7 @@ from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_par
class KnnClient(NamespacedClient):
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def delete_model(
self,
model_id: Any,
@@ -34,6 +34,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -45,7 +55,7 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def get_model(
self,
model_id: Any,
@@ -57,6 +67,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -81,15 +101,19 @@ class KnnClient(NamespacedClient):
"default_operator",
"df",
"docvalue_fields",
"error_trace",
"expand_wildcards",
"explain",
"filter_path",
"from_",
"human",
"ignore_throttled",
"ignore_unavailable",
"lenient",
"max_concurrent_shard_requests",
"pre_filter_shard_size",
"preference",
"pretty",
"q",
"request_cache",
"rest_total_hits_as_int",
@@ -99,6 +123,7 @@ class KnnClient(NamespacedClient):
"seq_no_primary_term",
"size",
"sort",
"source",
"stats",
"stored_fields",
"suggest_field",
@@ -151,12 +176,18 @@ class KnnClient(NamespacedClient):
given in the query string.
:arg docvalue_fields: Comma-separated list of fields to return
as the docvalue representation of a field for each hit.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg explain: Specify whether to return detailed information
about score computation as part of a hit.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset. Default is 0.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_throttled: Whether specified concrete, expanded or
aliased indices should be ignored when throttled.
:arg ignore_unavailable: Whether specified concrete indices
@@ -176,6 +207,8 @@ class KnnClient(NamespacedClient):
and the query are disjoint.
:arg preference: Specify the node or shard the operation should
be performed on. Default is random.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg q: Query in the Lucene query string syntax.
:arg request_cache: Specify if request cache should be used for
this request or not, defaults to index level setting.
@@ -191,6 +224,8 @@ class KnnClient(NamespacedClient):
number and primary term of the last modification of each hit.
:arg size: Number of hits to return. Default is 10.
:arg sort: Comma-separated list of <field>:<direction> pairs.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg stats: Specific 'tag' of the request for logging and
statistical purposes.
:arg stored_fields: Comma-separated list of stored fields to
@@ -226,7 +261,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
def stats(
self,
node_id: Any = None,
@@ -254,6 +289,16 @@ class KnnClient(NamespacedClient):
model_index_status, indexing_from_model_degraded, training_requests,
training_errors, training_memory_usage,
training_memory_usage_percentage.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Operation timeout.
"""
return self.transport.perform_request(
@@ -263,7 +308,9 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params("preference")
@query_params(
"error_trace", "filter_path", "human", "preference", "pretty", "source"
)
def train_model(
self,
body: Any,
@@ -277,7 +324,17 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg preference: Preferred node to execute training.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -290,7 +347,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def warmup(
self,
index: Any,
@@ -299,11 +356,21 @@ class KnnClient(NamespacedClient):
) -> Any:
"""
Preloads native library files into memory, reducing initial search latency for
specified indexes
specified indexes.
:arg index: Comma-separated list of indices; use `_all` or empty
string to perform the operation on all indices.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
+326
View File
@@ -0,0 +1,326 @@
# 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 SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class NotificationsClient(NamespacedClient):
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def create_config(
self,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Create channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def delete_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete a channel configuration.
:arg config_id: The ID of the channel configuration to delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return self.transport.perform_request(
"DELETE",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"config_id",
"config_id_list",
"error_trace",
"filter_path",
"human",
"pretty",
"source",
)
def delete_configs(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete multiple channel configurations.
:arg config_id: The ID of the channel configuration to delete.
:arg config_id_list: A comma-separated list of channel IDs to
delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"DELETE", "/_plugins/_notifications/configs", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def get_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get a specific channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"chime.url",
"chime.url.keyword",
"config_type",
"created_time_ms",
"description",
"description.keyword",
"email.email_account_id",
"email.email_group_id_list",
"email.recipient_list.recipient",
"email.recipient_list.recipient.keyword",
"email_group.recipient_list.recipient",
"email_group.recipient_list.recipient.keyword",
"error_trace",
"filter_path",
"human",
"is_enabled",
"last_updated_time_ms",
"microsoft_teams.url",
"microsoft_teams.url.keyword",
"name",
"name.keyword",
"pretty",
"query",
"ses_account.from_address",
"ses_account.from_address.keyword",
"ses_account.region",
"ses_account.role_arn",
"ses_account.role_arn.keyword",
"slack.url",
"slack.url.keyword",
"smtp_account.from_address",
"smtp_account.from_address.keyword",
"smtp_account.host",
"smtp_account.host.keyword",
"smtp_account.method",
"sns.role_arn",
"sns.role_arn.keyword",
"sns.topic_arn",
"sns.topic_arn.keyword",
"source",
"text_query",
"webhook.url",
"webhook.url.keyword",
)
def get_configs(
self,
body: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get multiple channel configurations with filtering.
:arg config_type: Type of notification configuration. Valid
choices are slack, chime, microsoft_teams, webhook, email, sns,
ses_account, smtp_account, email_group.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def list_features(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
List supported channel configurations.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
: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(
"GET", "/_plugins/_notifications/features", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def send_test(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Send a test notification.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "feature", "test", config_id),
params=params,
headers=headers,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
def update_config(
self,
config_id: Any,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Update channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (config_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
body=body,
)
+1 -1
View File
@@ -22,7 +22,7 @@
{% for p, info in api.params %}
{% if info.description %}
{% filter wordwrap(72, wrapstring="\n ") %}
:arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values: " not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %}
:arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values" not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %}
{% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %}
{% endfilter %}