remove all code related to xpack features
Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
This commit is contained in:
@@ -30,39 +30,17 @@ from __future__ import unicode_literals
|
||||
import logging
|
||||
|
||||
from ..transport import AsyncTransport, TransportError
|
||||
from .async_search import AsyncSearchClient
|
||||
from .autoscaling import AutoscalingClient
|
||||
from .cat import CatClient
|
||||
from .ccr import CcrClient
|
||||
from .cluster import ClusterClient
|
||||
from .dangling_indices import DanglingIndicesClient
|
||||
from .data_frame import Data_FrameClient
|
||||
from .enrich import EnrichClient
|
||||
from .eql import EqlClient
|
||||
from .features import FeaturesClient
|
||||
from .fleet import FleetClient
|
||||
from .graph import GraphClient
|
||||
from .ilm import IlmClient
|
||||
from .indices import IndicesClient
|
||||
from .ingest import IngestClient
|
||||
from .license import LicenseClient
|
||||
from .logstash import LogstashClient
|
||||
from .ml import MlClient
|
||||
from .monitoring import MonitoringClient
|
||||
from .nodes import NodesClient
|
||||
from .remote import RemoteClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
from .ssl import SslClient
|
||||
from .tasks import TasksClient
|
||||
from .text_structure import TextStructureClient
|
||||
from .transform import TransformClient
|
||||
from .utils import SKIP_IN_PATH, _bulk_body, _make_path, _normalize_hosts, query_params
|
||||
from .watcher import WatcherClient
|
||||
|
||||
logger = logging.getLogger("elasticsearch")
|
||||
|
||||
@@ -210,8 +188,6 @@ class AsyncElasticsearch(object):
|
||||
self.transport = transport_class(_normalize_hosts(hosts), **kwargs)
|
||||
|
||||
# namespaced clients for compatibility with API names
|
||||
self.async_search = AsyncSearchClient(self)
|
||||
self.autoscaling = AutoscalingClient(self)
|
||||
self.cat = CatClient(self)
|
||||
self.cluster = ClusterClient(self)
|
||||
self.dangling_indices = DanglingIndicesClient(self)
|
||||
@@ -222,27 +198,7 @@ class AsyncElasticsearch(object):
|
||||
self.snapshot = SnapshotClient(self)
|
||||
self.tasks = TasksClient(self)
|
||||
|
||||
self.ccr = CcrClient(self)
|
||||
self.data_frame = Data_FrameClient(self)
|
||||
self.enrich = EnrichClient(self)
|
||||
self.eql = EqlClient(self)
|
||||
self.features = FeaturesClient(self)
|
||||
self.fleet = FleetClient(self)
|
||||
self.graph = GraphClient(self)
|
||||
self.ilm = IlmClient(self)
|
||||
self.license = LicenseClient(self)
|
||||
self.logstash = LogstashClient(self)
|
||||
self.ml = MlClient(self)
|
||||
self.monitoring = MonitoringClient(self)
|
||||
self.searchable_snapshots = SearchableSnapshotsClient(self)
|
||||
self.security = SecurityClient(self)
|
||||
self.slm = SlmClient(self)
|
||||
self.shutdown = ShutdownClient(self)
|
||||
self.sql = SqlClient(self)
|
||||
self.ssl = SslClient(self)
|
||||
self.text_structure = TextStructureClient(self)
|
||||
self.transform = TransformClient(self)
|
||||
self.watcher = WatcherClient(self)
|
||||
|
||||
def __repr__(self):
|
||||
try:
|
||||
|
||||
@@ -31,44 +31,22 @@ import logging
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Type, Union
|
||||
|
||||
from ..transport import AsyncTransport
|
||||
from .async_search import AsyncSearchClient
|
||||
from .autoscaling import AutoscalingClient
|
||||
from .cat import CatClient
|
||||
from .ccr import CcrClient
|
||||
from .cluster import ClusterClient
|
||||
from .dangling_indices import DanglingIndicesClient
|
||||
from .enrich import EnrichClient
|
||||
from .eql import EqlClient
|
||||
from .features import FeaturesClient
|
||||
from .graph import GraphClient
|
||||
from .ilm import IlmClient
|
||||
from .indices import IndicesClient
|
||||
from .ingest import IngestClient
|
||||
from .license import LicenseClient
|
||||
from .logstash import LogstashClient
|
||||
from .ml import MlClient
|
||||
from .monitoring import MonitoringClient
|
||||
from .nodes import NodesClient
|
||||
from .remote import RemoteClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
from .ssl import SslClient
|
||||
from .tasks import TasksClient
|
||||
from .text_structure import TextStructureClient
|
||||
from .transform import TransformClient
|
||||
from .watcher import WatcherClient
|
||||
|
||||
logger: logging.Logger
|
||||
|
||||
class AsyncElasticsearch(object):
|
||||
transport: AsyncTransport
|
||||
|
||||
async_search: AsyncSearchClient
|
||||
autoscaling: AutoscalingClient
|
||||
cat: CatClient
|
||||
cluster: ClusterClient
|
||||
features: FeaturesClient
|
||||
@@ -78,26 +56,6 @@ class AsyncElasticsearch(object):
|
||||
remote: RemoteClient
|
||||
snapshot: SnapshotClient
|
||||
tasks: TasksClient
|
||||
|
||||
ccr: CcrClient
|
||||
dangling_indices: DanglingIndicesClient
|
||||
enrich: EnrichClient
|
||||
eql: EqlClient
|
||||
graph: GraphClient
|
||||
ilm: IlmClient
|
||||
license: LicenseClient
|
||||
logstash: LogstashClient
|
||||
ml: MlClient
|
||||
monitoring: MonitoringClient
|
||||
searchable_snapshots: SearchableSnapshotsClient
|
||||
security: SecurityClient
|
||||
shutdown: ShutdownClient
|
||||
slm: SlmClient
|
||||
sql: SqlClient
|
||||
ssl: SslClient
|
||||
transform: TransformClient
|
||||
text_structure: TextStructureClient
|
||||
watcher: WatcherClient
|
||||
def __init__(
|
||||
self,
|
||||
hosts: Any = ...,
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class AsyncSearchClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async search by ID. If the search is still running, the search
|
||||
request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE", _make_path("_async_search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("keep_alive", "typed_keys", "wait_for_completion_timeout")
|
||||
async def get(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the results of a previously submitted async search request given its
|
||||
ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg keep_alive: Specify the time interval in which the results
|
||||
(partial or final) for this search will be available
|
||||
:arg typed_keys: Specify whether aggregation and suggester names
|
||||
should be prefixed by their respective types in the response
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_async_search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"_source",
|
||||
"_source_excludes",
|
||||
"_source_includes",
|
||||
"allow_no_indices",
|
||||
"allow_partial_search_results",
|
||||
"analyze_wildcard",
|
||||
"analyzer",
|
||||
"batched_reduce_size",
|
||||
"default_operator",
|
||||
"df",
|
||||
"docvalue_fields",
|
||||
"expand_wildcards",
|
||||
"explain",
|
||||
"from_",
|
||||
"ignore_throttled",
|
||||
"ignore_unavailable",
|
||||
"keep_alive",
|
||||
"keep_on_completion",
|
||||
"lenient",
|
||||
"max_concurrent_shard_requests",
|
||||
"preference",
|
||||
"q",
|
||||
"request_cache",
|
||||
"routing",
|
||||
"search_type",
|
||||
"seq_no_primary_term",
|
||||
"size",
|
||||
"sort",
|
||||
"stats",
|
||||
"stored_fields",
|
||||
"suggest_field",
|
||||
"suggest_mode",
|
||||
"suggest_size",
|
||||
"suggest_text",
|
||||
"terminate_after",
|
||||
"timeout",
|
||||
"track_scores",
|
||||
"track_total_hits",
|
||||
"typed_keys",
|
||||
"version",
|
||||
"wait_for_completion_timeout",
|
||||
)
|
||||
async def submit(self, body=None, index=None, params=None, headers=None):
|
||||
"""
|
||||
Executes a search request asynchronously.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg body: The search definition using the Query DSL
|
||||
:arg index: A comma-separated list of index names to search; use
|
||||
`_all` or empty string to perform the operation on all indices
|
||||
:arg _source: True or false to return the _source field or not,
|
||||
or a list of fields to return
|
||||
:arg _source_excludes: A list of fields to exclude from the
|
||||
returned _source field
|
||||
:arg _source_includes: A list of fields to extract and return
|
||||
from the _source field
|
||||
: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)
|
||||
:arg allow_partial_search_results: Indicate if an error should
|
||||
be returned if there is a partial search failure or timeout Default:
|
||||
True
|
||||
:arg analyze_wildcard: Specify whether wildcard and prefix
|
||||
queries should be analyzed (default: false)
|
||||
:arg analyzer: The analyzer to use for the query string
|
||||
:arg batched_reduce_size: The number of shard results that
|
||||
should be reduced at once on the coordinating node. This value should be
|
||||
used as the granularity at which progress results will be made
|
||||
available. Default: 5
|
||||
:arg default_operator: The default operator for query string
|
||||
query (AND or OR) Valid choices: AND, OR Default: OR
|
||||
:arg df: The field to use as default where no field prefix is
|
||||
given in the query string
|
||||
:arg docvalue_fields: A comma-separated list of fields to return
|
||||
as the docvalue representation of a field for each hit
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg explain: Specify whether to return detailed information
|
||||
about score computation as part of a hit
|
||||
:arg from_: Starting offset (default: 0)
|
||||
:arg ignore_throttled: Whether specified concrete, expanded or
|
||||
aliased indices should be ignored when throttled
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg keep_on_completion: Control whether the response should be
|
||||
stored in the cluster if it completed within the provided
|
||||
[wait_for_completion] time (default: false)
|
||||
:arg lenient: Specify whether format-based query failures (such
|
||||
as providing text to a numeric field) should be ignored
|
||||
:arg max_concurrent_shard_requests: The number of concurrent
|
||||
shard requests per node this search executes concurrently. This value
|
||||
should be used to limit the impact of the search on the cluster in order
|
||||
to limit the number of concurrent shard requests Default: 5
|
||||
:arg preference: Specify the node or shard the operation should
|
||||
be performed on (default: random)
|
||||
: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 true
|
||||
:arg routing: A comma-separated list of specific routing values
|
||||
:arg search_type: Search operation type Valid choices:
|
||||
query_then_fetch, dfs_query_then_fetch
|
||||
:arg seq_no_primary_term: Specify whether to return sequence
|
||||
number and primary term of the last modification of each hit
|
||||
:arg size: Number of hits to return (default: 10)
|
||||
:arg sort: A comma-separated list of <field>:<direction> pairs
|
||||
:arg stats: Specific 'tag' of the request for logging and
|
||||
statistical purposes
|
||||
:arg stored_fields: A comma-separated list of stored fields to
|
||||
return as part of a hit
|
||||
:arg suggest_field: Specify which field to use for suggestions
|
||||
:arg suggest_mode: Specify suggest mode Valid choices: missing,
|
||||
popular, always Default: missing
|
||||
:arg suggest_size: How many suggestions to return in response
|
||||
:arg suggest_text: The source text for which the suggestions
|
||||
should be returned
|
||||
:arg terminate_after: The maximum number of documents to collect
|
||||
for each shard, upon reaching which the query execution will terminate
|
||||
early.
|
||||
:arg timeout: Explicit operation timeout
|
||||
:arg track_scores: Whether to calculate and return scores even
|
||||
if they are not used for sorting
|
||||
:arg track_total_hits: Indicate if the number of documents that
|
||||
match the query should be tracked
|
||||
:arg typed_keys: Specify whether aggregation and suggester names
|
||||
should be prefixed by their respective types in the response
|
||||
:arg version: Specify whether to return document version as part
|
||||
of a hit
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response Default: 1s
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_async_search"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the status of a previously submitted async search request given its
|
||||
ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_async_search", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class AsyncSearchClient(NamespacedClient):
|
||||
async def delete(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
typed_keys: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def submit(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
index: Optional[Any] = ...,
|
||||
_source: Optional[Any] = ...,
|
||||
_source_excludes: Optional[Any] = ...,
|
||||
_source_includes: Optional[Any] = ...,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
allow_partial_search_results: Optional[Any] = ...,
|
||||
analyze_wildcard: Optional[Any] = ...,
|
||||
analyzer: Optional[Any] = ...,
|
||||
batched_reduce_size: Optional[Any] = ...,
|
||||
default_operator: Optional[Any] = ...,
|
||||
df: Optional[Any] = ...,
|
||||
docvalue_fields: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
explain: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
ignore_throttled: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
keep_on_completion: Optional[Any] = ...,
|
||||
lenient: Optional[Any] = ...,
|
||||
max_concurrent_shard_requests: Optional[Any] = ...,
|
||||
preference: Optional[Any] = ...,
|
||||
q: Optional[Any] = ...,
|
||||
request_cache: Optional[Any] = ...,
|
||||
routing: Optional[Any] = ...,
|
||||
search_type: Optional[Any] = ...,
|
||||
seq_no_primary_term: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
sort: Optional[Any] = ...,
|
||||
stats: Optional[Any] = ...,
|
||||
stored_fields: Optional[Any] = ...,
|
||||
suggest_field: Optional[Any] = ...,
|
||||
suggest_mode: Optional[Any] = ...,
|
||||
suggest_size: Optional[Any] = ...,
|
||||
suggest_text: Optional[Any] = ...,
|
||||
terminate_after: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
track_scores: Optional[Any] = ...,
|
||||
track_total_hits: Optional[Any] = ...,
|
||||
typed_keys: Optional[Any] = ...,
|
||||
version: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,105 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class AutoscalingClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_autoscaling_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-delete-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_autoscaling_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-get-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_autoscaling_policy(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-put-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
:arg body: the specification of the autoscaling policy
|
||||
"""
|
||||
for param in (name, 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("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_autoscaling_capacity(self, params=None, headers=None):
|
||||
"""
|
||||
Gets the current autoscaling capacity based on the configured autoscaling
|
||||
policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not
|
||||
supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-get-autoscaling-capacity.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_autoscaling/capacity", params=params, headers=headers
|
||||
)
|
||||
@@ -1,99 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class AutoscalingClient(NamespacedClient):
|
||||
async def delete_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_autoscaling_capacity(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,294 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class CcrClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes auto-follow patterns.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-delete-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("wait_for_active_shards")
|
||||
async def follow(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new follower index configured to follow the referenced leader index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-put-follow.html>`_
|
||||
|
||||
:arg index: The name of the follower index
|
||||
:arg body: The name of the leader index and other optional ccr
|
||||
related parameters
|
||||
:arg wait_for_active_shards: Sets the number of shard copies
|
||||
that must be active before returning. Defaults to 0. Set to `all` for
|
||||
all shard copies, otherwise set to any non-negative value less than or
|
||||
equal to the total number of copies for the shard (number of replicas +
|
||||
1) Default: 0
|
||||
"""
|
||||
for param in (index, 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(index, "_ccr", "follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def follow_info(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about all follower indices, including parameters and
|
||||
status for each follower index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-follow-info.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index patterns; use `_all`
|
||||
to perform the operation on all indices
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ccr", "info"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def follow_stats(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves follower stats. return shard-level stats about the following tasks
|
||||
associated with each shard for the specified indices.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-follow-stats.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index patterns; use `_all`
|
||||
to perform the operation on all indices
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ccr", "stats"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def forget_follower(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Removes the follower retention leases from the leader.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-forget-follower.html>`_
|
||||
|
||||
:arg index: the name of the leader index for which specified
|
||||
follower retention leases should be removed
|
||||
:arg body: the name and UUID of the follower index, the name of
|
||||
the cluster containing the follower index, and the alias from the
|
||||
perspective of that cluster for the remote cluster containing the leader
|
||||
index
|
||||
"""
|
||||
for param in (index, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "forget_follower"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_auto_follow_pattern(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Gets configured auto-follow patterns. Returns the specified auto-follow pattern
|
||||
collection.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def pause_follow(self, index, params=None, headers=None):
|
||||
"""
|
||||
Pauses a follower index. The follower index will not fetch any additional
|
||||
operations from the leader index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-pause-follow.html>`_
|
||||
|
||||
:arg index: The name of the follower index that should pause
|
||||
following its leader index.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "pause_follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_auto_follow_pattern(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new named collection of auto-follow patterns against a specified
|
||||
remote cluster. Newly created indices on the remote cluster matching any of the
|
||||
specified patterns will be automatically configured as follower indices.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-put-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
:arg body: The specification of the auto follow pattern
|
||||
"""
|
||||
for param in (name, 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("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def resume_follow(self, index, body=None, params=None, headers=None):
|
||||
"""
|
||||
Resumes a follower index that has been paused
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-resume-follow.html>`_
|
||||
|
||||
:arg index: The name of the follow index to resume following.
|
||||
:arg body: The name of the leader index and other optional ccr
|
||||
related parameters
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "resume_follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def stats(self, params=None, headers=None):
|
||||
"""
|
||||
Gets all stats related to cross-cluster replication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-stats.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_ccr/stats", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def unfollow(self, index, params=None, headers=None):
|
||||
"""
|
||||
Stops the following task associated with a follower index and removes index
|
||||
metadata and settings associated with cross-cluster replication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-unfollow.html>`_
|
||||
|
||||
:arg index: The name of the follower index that should be turned
|
||||
into a regular index.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "unfollow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def pause_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Pauses an auto-follow pattern
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-pause-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern that should pause
|
||||
discovering new indices to follow.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ccr", "auto_follow", name, "pause"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def resume_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Resumes an auto-follow pattern that has been paused
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-resume-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern to resume
|
||||
discovering new indices to follow.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ccr", "auto_follow", name, "resume"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,256 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class CcrClient(NamespacedClient):
|
||||
async def delete_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
wait_for_active_shards: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def follow_info(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def follow_stats(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def forget_follower(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_auto_follow_pattern(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def pause_follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def resume_follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def unfollow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def pause_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def resume_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,164 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class Data_FrameClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_data_frame_transform(
|
||||
self, transform_id, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to delete
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("from_", "size")
|
||||
async def get_data_frame_transform(
|
||||
self, transform_id=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id or comma delimited list of id expressions of
|
||||
the transforms to get, '_all' or '*' implies get all transforms
|
||||
:arg from_: skips a number of transform configs, defaults to 0
|
||||
:arg size: specifies a max number of transforms to get, defaults to 100
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_data_frame_transform_stats(
|
||||
self, transform_id=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-data-frame-transform-stats.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform for which to get stats.
|
||||
'_all' or '*' implies all transforms
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def preview_data_frame_transform(self, body, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/preview-data-frame-transform.html>`_
|
||||
|
||||
:arg body: The definition for the data_frame transform to preview
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_data_frame/transforms/_preview",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_data_frame_transform(
|
||||
self, transform_id, body, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the new transform.
|
||||
:arg body: The data frame transform definition
|
||||
"""
|
||||
for param in (transform_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("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("timeout")
|
||||
async def start_data_frame_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to start
|
||||
:arg timeout: Controls the time to wait for the transform to start
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_start"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("timeout", "wait_for_completion")
|
||||
async def stop_data_frame_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/stop-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to stop
|
||||
:arg timeout: Controls the time to wait until the transform has stopped.
|
||||
Default to 30 seconds
|
||||
:arg wait_for_completion: Whether to wait for the transform to fully
|
||||
stop before returning or not. Default to false
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_stop"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class Data_FrameClient(NamespacedClient):
|
||||
async def delete_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_data_frame_transform(
|
||||
self,
|
||||
*,
|
||||
transform_id: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_data_frame_transform_stats(
|
||||
self,
|
||||
transform_id: Optional[Any],
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def preview_data_frame_transform(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def start_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stop_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,116 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class EnrichClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing enrich policy and its enrich index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_enrich", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("wait_for_completion")
|
||||
async def execute_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Creates the enrich index for an existing enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/execute-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
:arg wait_for_completion: Should the request should block until
|
||||
the execution is complete. Default: True
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_enrich", "policy", name, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_policy(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Gets information about an enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: A comma-separated list of enrich policy names
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_enrich", "policy", name), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_policy(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
:arg body: The enrich policy to register
|
||||
"""
|
||||
for param in (name, 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("_enrich", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def stats(self, params=None, headers=None):
|
||||
"""
|
||||
Gets enrich coordinator statistics and information about enrich policies that
|
||||
are currently executing.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/enrich-stats-api.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_enrich/_stats", params=params, headers=headers
|
||||
)
|
||||
@@ -1,117 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class EnrichClient(NamespacedClient):
|
||||
async def delete_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def execute_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_policy(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,117 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class EqlClient(NamespacedClient):
|
||||
@query_params("keep_alive", "keep_on_completion", "wait_for_completion_timeout")
|
||||
async def search(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Returns results matching a query expressed in Event Query Language (EQL)
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg index: The name of the index to scope the operation
|
||||
:arg body: Eql request body. Use the `query` to limit the query
|
||||
scope.
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg keep_on_completion: Control whether the response should be
|
||||
stored in the cluster if it completed within the provided
|
||||
[wait_for_completion] time (default: false)
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
for param in (index, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_eql", "search"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def delete(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async EQL search by ID. If the search is still running, the search
|
||||
request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE", _make_path("_eql", "search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("keep_alive", "wait_for_completion_timeout")
|
||||
async def get(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns async results from previously executed Event Query Language (EQL)
|
||||
search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_eql", "search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the status of a previously submitted async or stored Event Query
|
||||
Language (EQL) search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_eql", "search", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,105 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class EqlClient(NamespacedClient):
|
||||
async def search(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
keep_on_completion: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,59 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class FleetClient(NamespacedClient):
|
||||
@query_params("checkpoints", "timeout", "wait_for_advance", "wait_for_index")
|
||||
async def global_checkpoints(self, index, params=None, headers=None):
|
||||
"""
|
||||
Returns the current global checkpoints for an index. This API is design for
|
||||
internal use by the fleet server project.
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: The name of the index.
|
||||
:arg checkpoints: Comma separated list of checkpoints
|
||||
:arg timeout: Timeout to wait for global checkpoint to advance
|
||||
Default: 30s
|
||||
:arg wait_for_advance: Whether to wait for the global checkpoint
|
||||
to advance past the specified current checkpoints Default: false
|
||||
:arg wait_for_index: Whether to wait for the target index to
|
||||
exist and all primary shards be active Default: false
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_fleet", "global_checkpoints"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class FleetClient(NamespacedClient):
|
||||
async def global_checkpoints(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
checkpoints: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_advance: Optional[Any] = ...,
|
||||
wait_for_index: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,56 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class GraphClient(NamespacedClient):
|
||||
@query_params("routing", "timeout")
|
||||
async def explore(self, index, body=None, doc_type=None, params=None, headers=None):
|
||||
"""
|
||||
Explore extracted and summarized information about the documents and terms in
|
||||
an index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/graph-explore-api.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index names to search; use
|
||||
`_all` or empty string to perform the operation on all indices
|
||||
:arg body: Graph Query DSL
|
||||
:arg doc_type: A comma-separated list of document types to
|
||||
search; leave empty to perform the operation on all types
|
||||
:arg routing: Specific routing value
|
||||
:arg timeout: Explicit operation timeout
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, doc_type, "_graph", "explore"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class GraphClient(NamespacedClient):
|
||||
async def explore(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
doc_type: Optional[Any] = ...,
|
||||
routing: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,217 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class IlmClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_lifecycle(self, policy, params=None, headers=None):
|
||||
"""
|
||||
Deletes the specified lifecycle policy definition. A currently used policy
|
||||
cannot be deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-delete-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
"""
|
||||
if policy in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_ilm", "policy", policy),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("only_errors", "only_managed")
|
||||
async def explain_lifecycle(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the index's current lifecycle state, such as the
|
||||
currently executing phase, action, and step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-explain-lifecycle.html>`_
|
||||
|
||||
:arg index: The name of the index to explain
|
||||
:arg only_errors: filters the indices included in the response
|
||||
to ones in an ILM error state, implies only_managed
|
||||
:arg only_managed: filters the indices included in the response
|
||||
to ones managed by ILM
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ilm", "explain"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_lifecycle(self, policy=None, params=None, headers=None):
|
||||
"""
|
||||
Returns the specified policy definition. Includes the policy version and last
|
||||
modified date.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-get-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_ilm", "policy", policy), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the current index lifecycle management (ILM) status.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-get-status.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_ilm/status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def move_to_step(self, index, body=None, params=None, headers=None):
|
||||
"""
|
||||
Manually moves an index into the specified step and executes that step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-move-to-step.html>`_
|
||||
|
||||
:arg index: The name of the index whose lifecycle step is to
|
||||
change
|
||||
:arg body: The new lifecycle step to move to
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ilm", "move", index),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_lifecycle(self, policy, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates a lifecycle policy
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-put-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
:arg body: The lifecycle policy definition to register
|
||||
"""
|
||||
if policy in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_ilm", "policy", policy),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def remove_policy(self, index, params=None, headers=None):
|
||||
"""
|
||||
Removes the assigned lifecycle policy and stops managing the specified index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-remove-policy.html>`_
|
||||
|
||||
:arg index: The name of the index to remove policy on
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", _make_path(index, "_ilm", "remove"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def retry(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retries executing the policy for an index that is in the ERROR step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-retry-policy.html>`_
|
||||
|
||||
:arg index: The name of the indices (comma-separated) whose
|
||||
failed lifecycle step is to be retry
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", _make_path(index, "_ilm", "retry"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def start(self, params=None, headers=None):
|
||||
"""
|
||||
Start the index lifecycle management (ILM) plugin.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-start.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_ilm/start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Halts all lifecycle management operations and stops the index lifecycle
|
||||
management (ILM) plugin
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-stop.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_ilm/stop", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("dry_run")
|
||||
async def migrate_to_data_tiers(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Migrates the indices and ILM policies away from custom node attribute
|
||||
allocation routing to data tiers routing
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-migrate-to-data-tiers.html>`_
|
||||
|
||||
:arg body: Optionally specify a legacy index template name to
|
||||
delete and optionally specify a node attribute name used for index shard
|
||||
routing (defaults to "data")
|
||||
:arg dry_run: If set to true it will simulate the migration,
|
||||
providing a way to retrieve the ILM policies and indices that need to be
|
||||
migrated. The default is false
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_ilm/migrate_to_data_tiers",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,220 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class IlmClient(NamespacedClient):
|
||||
async def delete_lifecycle(
|
||||
self,
|
||||
policy: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def explain_lifecycle(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
only_errors: Optional[Any] = ...,
|
||||
only_managed: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_lifecycle(
|
||||
self,
|
||||
*,
|
||||
policy: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def move_to_step(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_lifecycle(
|
||||
self,
|
||||
policy: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def remove_policy(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def retry(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def migrate_to_data_tiers(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
dry_run: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,127 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import NamespacedClient, query_params
|
||||
|
||||
|
||||
class LicenseClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete(self, params=None, headers=None):
|
||||
"""
|
||||
Deletes licensing information for the cluster
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-license.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"DELETE", "/_license", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("accept_enterprise", "local")
|
||||
async def get(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves licensing information for the cluster
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-license.html>`_
|
||||
|
||||
:arg accept_enterprise: If the active license is an enterprise
|
||||
license, return type as 'enterprise' (default: false)
|
||||
:arg local: Return local information, do not retrieve the state
|
||||
from master node (default: false)
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_license", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_basic_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the status of the basic license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-basic-status.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_license/basic_status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_trial_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the status of the trial license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-trial-status.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_license/trial_status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("acknowledge")
|
||||
async def post(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Updates the license for the cluster.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/update-license.html>`_
|
||||
|
||||
:arg body: licenses to be installed
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"PUT", "/_license", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("acknowledge")
|
||||
async def post_start_basic(self, params=None, headers=None):
|
||||
"""
|
||||
Starts an indefinite basic license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-basic.html>`_
|
||||
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_license/start_basic", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("acknowledge", "doc_type")
|
||||
async def post_start_trial(self, params=None, headers=None):
|
||||
"""
|
||||
starts a limited time trial license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-trial.html>`_
|
||||
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
:arg doc_type: The type of trial license to generate (default:
|
||||
"trial")
|
||||
"""
|
||||
# type is a reserved word so it cannot be used, use doc_type instead
|
||||
if "doc_type" in params:
|
||||
params["type"] = params.pop("doc_type")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_license/start_trial", params=params, headers=headers
|
||||
)
|
||||
@@ -1,150 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class LicenseClient(NamespacedClient):
|
||||
async def delete(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
accept_enterprise: Optional[Any] = ...,
|
||||
local: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_basic_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_trial_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def post(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def post_start_basic(
|
||||
self,
|
||||
*,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def post_start_trial(
|
||||
self,
|
||||
*,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
doc_type: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,89 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class LogstashClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_pipeline(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes Logstash Pipelines used by Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-delete-pipeline.html>`_
|
||||
|
||||
:arg id: The ID of the Pipeline
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_pipeline(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves Logstash Pipelines used by Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-get-pipeline.html>`_
|
||||
|
||||
:arg id: A comma-separated list of Pipeline IDs
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_pipeline(self, id, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates Logstash Pipelines used for Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-put-pipeline.html>`_
|
||||
|
||||
:arg id: The ID of the Pipeline
|
||||
:arg body: The Pipeline to add or update
|
||||
"""
|
||||
for param in (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("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,83 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class LogstashClient(NamespacedClient):
|
||||
async def delete_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,62 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
|
||||
|
||||
|
||||
class MonitoringClient(NamespacedClient):
|
||||
@query_params("interval", "system_api_version", "system_id")
|
||||
async def bulk(self, body, doc_type=None, params=None, headers=None):
|
||||
"""
|
||||
Used by the monitoring features to send monitoring data.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/monitor-elasticsearch-cluster.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg body: The operation definition and data (action-data
|
||||
pairs), separated by newlines
|
||||
:arg doc_type: Default document type for items which don't
|
||||
provide one
|
||||
:arg interval: Collection interval (e.g., '10s' or '10000ms') of
|
||||
the payload
|
||||
:arg system_api_version: API Version of the monitored system
|
||||
:arg system_id: Identifier of the monitored system
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
body = _bulk_body(self.transport.serializer, body)
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_monitoring", doc_type, "bulk"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class MonitoringClient(NamespacedClient):
|
||||
async def bulk(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
doc_type: Optional[Any] = ...,
|
||||
interval: Optional[Any] = ...,
|
||||
system_api_version: Optional[Any] = ...,
|
||||
system_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,166 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SearchableSnapshotsClient(NamespacedClient):
|
||||
@query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable")
|
||||
async def clear_cache(self, index=None, params=None, headers=None):
|
||||
"""
|
||||
Clear the cache of searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index name to limit the
|
||||
operation
|
||||
: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)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, none, all Default: open
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_searchable_snapshots", "cache", "clear"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("master_timeout", "storage", "wait_for_completion")
|
||||
async def mount(self, repository, snapshot, body, params=None, headers=None):
|
||||
"""
|
||||
Mount a snapshot as a searchable index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-api-mount-snapshot.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg repository: The name of the repository containing the
|
||||
snapshot of the index to mount
|
||||
:arg snapshot: The name of the snapshot of the index to mount
|
||||
:arg body: The restore configuration for mounting the snapshot
|
||||
as searchable
|
||||
:arg master_timeout: Explicit operation timeout for connection
|
||||
to master node
|
||||
:arg storage: Selects the kind of local storage used to
|
||||
accelerate searches. Experimental, and defaults to `full_copy`
|
||||
:arg wait_for_completion: Should this request wait until the
|
||||
operation has completed before returning
|
||||
"""
|
||||
for param in (repository, snapshot, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_snapshot", repository, snapshot, "_mount"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def repository_stats(self, repository, params=None, headers=None):
|
||||
"""
|
||||
DEPRECATED: This API is replaced by the Repositories Metering API.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg repository: The repository for which to get the stats for
|
||||
"""
|
||||
if repository in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'repository'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_snapshot", repository, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("level")
|
||||
async def stats(self, index=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve shard-level statistics about searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index names
|
||||
:arg level: Return stats aggregated at cluster, index or shard
|
||||
level Valid choices: cluster, indices, shards Default: indices
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_searchable_snapshots", "stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def cache_stats(self, node_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve node-level cache statistics about searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
: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
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_searchable_snapshots", node_id, "cache", "stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,125 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SearchableSnapshotsClient(NamespacedClient):
|
||||
async def clear_cache(
|
||||
self,
|
||||
*,
|
||||
index: Optional[Any] = ...,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def mount(
|
||||
self,
|
||||
repository: Any,
|
||||
snapshot: Any,
|
||||
*,
|
||||
body: Any,
|
||||
master_timeout: Optional[Any] = ...,
|
||||
storage: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def repository_stats(
|
||||
self,
|
||||
repository: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stats(
|
||||
self,
|
||||
*,
|
||||
index: Optional[Any] = ...,
|
||||
level: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def cache_stats(
|
||||
self,
|
||||
*,
|
||||
node_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,890 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SecurityClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def authenticate(self, params=None, headers=None):
|
||||
"""
|
||||
Enables authentication as a user and retrieve information about the
|
||||
authenticated user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-authenticate.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_security/_authenticate", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def change_password(self, body, username=None, params=None, headers=None):
|
||||
"""
|
||||
Changes the passwords of users in the native realm and built-in users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-change-password.html>`_
|
||||
|
||||
:arg body: the new password for the user
|
||||
:arg username: The username of the user to change the password
|
||||
for
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_password"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("usernames")
|
||||
async def clear_cached_realms(self, realms, params=None, headers=None):
|
||||
"""
|
||||
Evicts users from the user cache. Can completely clear the cache or evict
|
||||
specific users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-cache.html>`_
|
||||
|
||||
:arg realms: Comma-separated list of realms to clear
|
||||
:arg usernames: Comma-separated list of usernames to clear from
|
||||
the cache
|
||||
"""
|
||||
if realms in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'realms'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "realm", realms, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def clear_cached_roles(self, name, params=None, headers=None):
|
||||
"""
|
||||
Evicts roles from the native role cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-role-cache.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "role", name, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def create_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates an API key for access without requiring basic authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to create an API key
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT", "/_security/api_key", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def delete_privileges(self, application, name, params=None, headers=None):
|
||||
"""
|
||||
Removes application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-privilege.html>`_
|
||||
|
||||
:arg application: Application name
|
||||
:arg name: Privilege name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (application, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "privilege", application, name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def delete_role(self, name, params=None, headers=None):
|
||||
"""
|
||||
Removes roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-role.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "role", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def delete_role_mapping(self, name, params=None, headers=None):
|
||||
"""
|
||||
Removes role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-role-mapping.html>`_
|
||||
|
||||
:arg name: Role-mapping name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def delete_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Deletes users from the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-user.html>`_
|
||||
|
||||
:arg username: username
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def disable_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Disables users in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-disable-user.html>`_
|
||||
|
||||
:arg username: The username of the user to disable
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_disable"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def enable_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Enables users in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-enable-user.html>`_
|
||||
|
||||
:arg username: The username of the user to enable
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_enable"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("id", "name", "owner", "realm_name", "username")
|
||||
async def get_api_key(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information for one or more API keys.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-api-key.html>`_
|
||||
|
||||
:arg id: API key id of the API key to be retrieved
|
||||
:arg name: API key name of the API key to be retrieved
|
||||
:arg owner: flag to query API keys owned by the currently
|
||||
authenticated user
|
||||
:arg realm_name: realm name of the user who created this API key
|
||||
to be retrieved
|
||||
:arg username: user name of the user who created this API key to
|
||||
be retrieved
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_security/api_key", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_privileges(
|
||||
self, application=None, name=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Retrieves application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-privileges.html>`_
|
||||
|
||||
:arg application: Application name
|
||||
:arg name: Privilege name
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "privilege", application, name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_role(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-role.html>`_
|
||||
|
||||
:arg name: A comma-separated list of role names
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_security", "role", name), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_role_mapping(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-role-mapping.html>`_
|
||||
|
||||
:arg name: A comma-separated list of role-mapping names
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_token(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a bearer token for access without requiring basic authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-token.html>`_
|
||||
|
||||
:arg body: The token request to get
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_security/oauth2/token", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_user(self, username=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about users in the native realm and built-in users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-user.html>`_
|
||||
|
||||
:arg username: A comma-separated list of usernames
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_user_privileges(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves security privileges for the logged in user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-user-privileges.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_security/user/_privileges", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def has_privileges(self, body, user=None, params=None, headers=None):
|
||||
"""
|
||||
Determines whether the specified user has a specified list of privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-has-privileges.html>`_
|
||||
|
||||
:arg body: The privileges to test
|
||||
:arg user: Username
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "user", user, "_has_privileges"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def invalidate_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates one or more API keys.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-invalidate-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to invalidate API key(s)
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE", "/_security/api_key", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def invalidate_token(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates one or more access tokens or refresh tokens.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-invalidate-token.html>`_
|
||||
|
||||
:arg body: The token to invalidate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
"/_security/oauth2/token",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def put_privileges(self, body, params=None, headers=None):
|
||||
"""
|
||||
Adds or updates application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-privileges.html>`_
|
||||
|
||||
:arg body: The privilege(s) to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT", "/_security/privilege/", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def put_role(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-role.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
:arg body: The role to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (name, 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("_security", "role", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def put_role_mapping(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates and updates role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-role-mapping.html>`_
|
||||
|
||||
:arg name: Role-mapping name
|
||||
:arg body: The role mapping to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (name, 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("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def put_user(self, username, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates users in the native realm. These users are commonly referred
|
||||
to as native users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-user.html>`_
|
||||
|
||||
:arg username: The username of the User
|
||||
:arg body: The user to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (username, 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("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_builtin_privileges(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the list of cluster privileges and index privileges that are
|
||||
available in this version of Elasticsearch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-builtin-privileges.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_security/privilege/_builtin", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def clear_cached_privileges(self, application, params=None, headers=None):
|
||||
"""
|
||||
Evicts application privileges from the native application privileges cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-privilege-cache.html>`_
|
||||
|
||||
:arg application: A comma-separated list of application names
|
||||
"""
|
||||
if application in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'application'."
|
||||
)
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "privilege", application, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def clear_api_key_cache(self, ids, params=None, headers=None):
|
||||
"""
|
||||
Clear a subset or all entries from the API key cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-api-key-cache.html>`_
|
||||
|
||||
:arg ids: A comma-separated list of IDs of API keys to clear
|
||||
from the cache
|
||||
"""
|
||||
if ids in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'ids'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "api_key", ids, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def grant_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates an API key on behalf of another user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-grant-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to create an API key
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/api_key/grant",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def clear_cached_service_tokens(
|
||||
self, namespace, service, name, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Evicts tokens from the service account token caches.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-service-token-caches.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: A comma-separated list of service token names
|
||||
"""
|
||||
for param in (namespace, service, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(
|
||||
"_security",
|
||||
"service",
|
||||
namespace,
|
||||
service,
|
||||
"credential",
|
||||
"token",
|
||||
name,
|
||||
"_clear_cache",
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def create_service_token(
|
||||
self, namespace, service, name=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Creates a service account token for access without requiring basic
|
||||
authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-service-token.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: An identifier for the token name
|
||||
:arg refresh: If `true` then refresh the affected shards to make
|
||||
this operation visible to search, if `wait_for` (the default) then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (namespace, service):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path(
|
||||
"_security", "service", namespace, service, "credential", "token", name
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
async def delete_service_token(
|
||||
self, namespace, service, name, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Deletes a service account token.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-service-token.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: An identifier for the token name
|
||||
:arg refresh: If `true` then refresh the affected shards to make
|
||||
this operation visible to search, if `wait_for` (the default) then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (namespace, service, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path(
|
||||
"_security", "service", namespace, service, "credential", "token", name
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_service_accounts(
|
||||
self, namespace=None, service=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Retrieves information about service accounts.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-service-accounts.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "service", namespace, service),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_service_credentials(
|
||||
self, namespace, service, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Retrieves information of all service credentials for a service account.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-service-credentials.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
"""
|
||||
for param in (namespace, service):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "service", namespace, service, "credential"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_complete_logout(self, body, params=None, headers=None):
|
||||
"""
|
||||
Verifies the logout response sent from the SAML IdP
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-complete-logout.html>`_
|
||||
|
||||
:arg body: The logout response to verify
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/complete_logout",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_authenticate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Exchanges a SAML Response message for an Elasticsearch access token and refresh
|
||||
token pair
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-authenticate.html>`_
|
||||
|
||||
:arg body: The SAML response to authenticate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/authenticate",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_invalidate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Consumes a SAML LogoutRequest
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-invalidate.html>`_
|
||||
|
||||
:arg body: The LogoutRequest message
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/invalidate",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_logout(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates an access token and a refresh token that were generated via the
|
||||
SAML Authenticate API
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-logout.html>`_
|
||||
|
||||
:arg body: The tokens to invalidate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_security/saml/logout", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_prepare_authentication(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a SAML authentication request
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-prepare-authentication.html>`_
|
||||
|
||||
:arg body: The realm for which to create the authentication
|
||||
request, identified by either its name or the ACS URL
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_security/saml/prepare", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def saml_service_provider_metadata(
|
||||
self, realm_name, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-sp-metadata.html>`_
|
||||
|
||||
:arg realm_name: The name of the SAML realm to get the metadata
|
||||
for
|
||||
"""
|
||||
if realm_name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'realm_name'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "saml", "metadata", realm_name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,743 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SecurityClient(NamespacedClient):
|
||||
async def authenticate(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def change_password(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
username: Optional[Any] = ...,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def clear_cached_realms(
|
||||
self,
|
||||
realms: Any,
|
||||
*,
|
||||
usernames: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def clear_cached_roles(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def create_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_privileges(
|
||||
self,
|
||||
application: Any,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_role(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_role_mapping(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def disable_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def enable_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_api_key(
|
||||
self,
|
||||
*,
|
||||
id: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
owner: Optional[Any] = ...,
|
||||
realm_name: Optional[Any] = ...,
|
||||
username: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_privileges(
|
||||
self,
|
||||
*,
|
||||
application: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_role(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_role_mapping(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_token(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_user(
|
||||
self,
|
||||
*,
|
||||
username: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_user_privileges(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def has_privileges(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
user: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def invalidate_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def invalidate_token(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_privileges(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_role(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_role_mapping(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_builtin_privileges(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def clear_cached_privileges(
|
||||
self,
|
||||
application: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def clear_api_key_cache(
|
||||
self,
|
||||
ids: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def grant_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def clear_cached_service_tokens(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def create_service_token(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_service_token(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_service_accounts(
|
||||
self,
|
||||
*,
|
||||
namespace: Optional[Any] = ...,
|
||||
service: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_service_credentials(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_complete_logout(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_authenticate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_invalidate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_logout(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_prepare_authentication(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def saml_service_provider_metadata(
|
||||
self,
|
||||
realm_name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,103 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class ShutdownClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_node(self, node_id, params=None, headers=None):
|
||||
"""
|
||||
Removes a node from the shutdown list
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: The node id of node to be removed from the
|
||||
shutdown state
|
||||
"""
|
||||
if node_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'node_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_node(self, node_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve status of a node or nodes that are currently marked as shutting down
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: Which node for which to retrieve the shutdown
|
||||
status
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_node(self, node_id, body, params=None, headers=None):
|
||||
"""
|
||||
Adds a node to be shut down
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: The node id of node to be shut down
|
||||
:arg body: The shutdown type definition to register
|
||||
"""
|
||||
for param in (node_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("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,83 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class ShutdownClient(NamespacedClient):
|
||||
async def delete_node(
|
||||
self,
|
||||
node_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_node(
|
||||
self,
|
||||
*,
|
||||
node_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_node(
|
||||
self,
|
||||
node_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,166 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SlmClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def delete_lifecycle(self, policy_id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing snapshot lifecycle policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-delete-policy.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy to
|
||||
remove
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def execute_lifecycle(self, policy_id, params=None, headers=None):
|
||||
"""
|
||||
Immediately creates a snapshot according to the lifecycle policy, without
|
||||
waiting for the scheduled time.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-execute-lifecycle.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy to be
|
||||
executed
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_slm", "policy", policy_id, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def execute_retention(self, params=None, headers=None):
|
||||
"""
|
||||
Deletes any snapshots that are expired according to the policy's retention
|
||||
rules.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-execute-retention.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_slm/_execute_retention", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_lifecycle(self, policy_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves one or more snapshot lifecycle policy definitions and information
|
||||
about the latest snapshot attempts.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-policy.html>`_
|
||||
|
||||
:arg policy_id: Comma-separated list of snapshot lifecycle
|
||||
policies to retrieve
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_stats(self, params=None, headers=None):
|
||||
"""
|
||||
Returns global and policy-level statistics about actions taken by snapshot
|
||||
lifecycle management.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-stats.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_slm/stats", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def put_lifecycle(self, policy_id, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates or updates a snapshot lifecycle policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-put-policy.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy
|
||||
:arg body: The snapshot lifecycle policy definition to register
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the status of snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-status.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_slm/status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def start(self, params=None, headers=None):
|
||||
"""
|
||||
Turns on snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-start.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_slm/start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Turns off snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-stop.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_slm/stop", params=params, headers=headers
|
||||
)
|
||||
@@ -1,180 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SlmClient(NamespacedClient):
|
||||
async def delete_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def execute_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def execute_retention(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_lifecycle(
|
||||
self,
|
||||
*,
|
||||
policy_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SqlClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def clear_cursor(self, body, params=None, headers=None):
|
||||
"""
|
||||
Clears the SQL cursor
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-pagination.html>`_
|
||||
|
||||
:arg body: Specify the cursor value in the `cursor` element to
|
||||
clean the cursor.
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_sql/close", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("format")
|
||||
async def query(self, body, params=None, headers=None):
|
||||
"""
|
||||
Executes a SQL request
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-rest-overview.html>`_
|
||||
|
||||
:arg body: Use the `query` element to start a query. Use the
|
||||
`cursor` element to continue a query.
|
||||
:arg format: a short version of the Accept header, e.g. json,
|
||||
yaml
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_sql", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def translate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Translates SQL into Elasticsearch queries
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-translate.html>`_
|
||||
|
||||
:arg body: Specify the query in the `query` element.
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_sql/translate", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def delete_async(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async SQL search or a stored synchronous SQL search. If the search
|
||||
is still running, the API cancels it.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-async-sql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_sql", "async", "delete", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
|
||||
async def get_async(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the current status and available results for an async SQL search or
|
||||
stored synchronous SQL search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg delimiter: Separator for CSV results Default: ,
|
||||
:arg format: Short version of the Accept header, e.g. json, yaml
|
||||
:arg keep_alive: Retention period for the search and its results
|
||||
Default: 5d
|
||||
:arg wait_for_completion_timeout: Duration to wait for complete
|
||||
results
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_sql", "async", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_async_status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the current status of an async SQL search or a stored synchronous SQL
|
||||
search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-status-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_sql", "async", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,136 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SqlClient(NamespacedClient):
|
||||
async def clear_cursor(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def query(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
format: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def translate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_async(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_async(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
delimiter: Optional[Any] = ...,
|
||||
format: Optional[Any] = ...,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_async_status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,41 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import NamespacedClient, query_params
|
||||
|
||||
|
||||
class SslClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def certificates(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the X.509 certificates used to encrypt
|
||||
communications in the cluster.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-ssl.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET", "/_ssl/certificates", params=params, headers=headers
|
||||
)
|
||||
@@ -1,47 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SslClient(NamespacedClient):
|
||||
async def certificates(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,97 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, query_params
|
||||
|
||||
|
||||
class TextStructureClient(NamespacedClient):
|
||||
@query_params(
|
||||
"charset",
|
||||
"column_names",
|
||||
"delimiter",
|
||||
"explain",
|
||||
"format",
|
||||
"grok_pattern",
|
||||
"has_header_row",
|
||||
"line_merge_size_limit",
|
||||
"lines_to_sample",
|
||||
"quote",
|
||||
"should_trim_fields",
|
||||
"timeout",
|
||||
"timestamp_field",
|
||||
"timestamp_format",
|
||||
)
|
||||
async def find_structure(self, body, params=None, headers=None):
|
||||
"""
|
||||
Finds the structure of a text file. The text file must contain data that is
|
||||
suitable to be ingested into Elasticsearch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/find-structure.html>`_
|
||||
|
||||
:arg body: The contents of the file to be analyzed
|
||||
:arg charset: Optional parameter to specify the character set of
|
||||
the file
|
||||
:arg column_names: Optional parameter containing a comma
|
||||
separated list of the column names for a delimited file
|
||||
:arg delimiter: Optional parameter to specify the delimiter
|
||||
character for a delimited file - must be a single character
|
||||
:arg explain: Whether to include a commentary on how the
|
||||
structure was derived
|
||||
:arg format: Optional parameter to specify the high level file
|
||||
format Valid choices: ndjson, xml, delimited, semi_structured_text
|
||||
:arg grok_pattern: Optional parameter to specify the Grok
|
||||
pattern that should be used to extract fields from messages in a semi-
|
||||
structured text file
|
||||
:arg has_header_row: Optional parameter to specify whether a
|
||||
delimited file includes the column names in its first row
|
||||
:arg line_merge_size_limit: Maximum number of characters
|
||||
permitted in a single message when lines are merged to create messages.
|
||||
Default: 10000
|
||||
:arg lines_to_sample: How many lines of the file should be
|
||||
included in the analysis Default: 1000
|
||||
:arg quote: Optional parameter to specify the quote character
|
||||
for a delimited file - must be a single character
|
||||
:arg should_trim_fields: Optional parameter to specify whether
|
||||
the values between delimiters in a delimited file should have whitespace
|
||||
trimmed from them
|
||||
:arg timeout: Timeout after which the analysis will be aborted
|
||||
Default: 25s
|
||||
:arg timestamp_field: Optional parameter to specify the
|
||||
timestamp field in the file
|
||||
:arg timestamp_format: Optional parameter to specify the
|
||||
timestamp format in the file - may be either a Joda or Java time format
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
body = _bulk_body(self.transport.serializer, body)
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_text_structure/find_structure",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,61 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class TextStructureClient(NamespacedClient):
|
||||
async def find_structure(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
charset: Optional[Any] = ...,
|
||||
column_names: Optional[Any] = ...,
|
||||
delimiter: Optional[Any] = ...,
|
||||
explain: Optional[Any] = ...,
|
||||
format: Optional[Any] = ...,
|
||||
grok_pattern: Optional[Any] = ...,
|
||||
has_header_row: Optional[Any] = ...,
|
||||
line_merge_size_limit: Optional[Any] = ...,
|
||||
lines_to_sample: Optional[Any] = ...,
|
||||
quote: Optional[Any] = ...,
|
||||
should_trim_fields: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
timestamp_field: Optional[Any] = ...,
|
||||
timestamp_format: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,240 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class TransformClient(NamespacedClient):
|
||||
@query_params("force")
|
||||
async def delete_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to delete
|
||||
:arg force: When `true`, the transform is deleted regardless of
|
||||
its current state. The default value is `false`, meaning that the
|
||||
transform must be `stopped` before it can be deleted.
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("allow_no_match", "exclude_generated", "from_", "size")
|
||||
async def get_transform(self, transform_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves configuration information for transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-transform.html>`_
|
||||
|
||||
:arg transform_id: The id or comma delimited list of id
|
||||
expressions of the transforms to get, '_all' or '*' implies get all
|
||||
transforms
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg exclude_generated: Omits fields that are illegal to set on
|
||||
transform PUT
|
||||
:arg from_: skips a number of transform configs, defaults to 0
|
||||
:arg size: specifies a max number of transforms to get, defaults
|
||||
to 100
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("allow_no_match", "from_", "size")
|
||||
async def get_transform_stats(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves usage information for transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-transform-stats.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform for which to get
|
||||
stats. '_all' or '*' implies all transforms
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg from_: skips a number of transform stats, defaults to 0
|
||||
:arg size: specifies a max number of transform stats to get,
|
||||
defaults to 100
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_transform", transform_id, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def preview_transform(self, body, params=None, headers=None):
|
||||
"""
|
||||
Previews a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/preview-transform.html>`_
|
||||
|
||||
:arg body: The definition for the transform to preview
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_transform/_preview", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("defer_validation")
|
||||
async def put_transform(self, transform_id, body, params=None, headers=None):
|
||||
"""
|
||||
Instantiates a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the new transform.
|
||||
:arg body: The transform definition
|
||||
:arg defer_validation: If validations should be deferred until
|
||||
transform starts, defaults to false.
|
||||
"""
|
||||
for param in (transform_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("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("timeout")
|
||||
async def start_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Starts one or more transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to start
|
||||
:arg timeout: Controls the time to wait for the transform to
|
||||
start
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_start"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_match",
|
||||
"force",
|
||||
"timeout",
|
||||
"wait_for_checkpoint",
|
||||
"wait_for_completion",
|
||||
)
|
||||
async def stop_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Stops one or more transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/stop-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to stop
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg force: Whether to force stop a failed transform or not.
|
||||
Default to false
|
||||
:arg timeout: Controls the time to wait until the transform has
|
||||
stopped. Default to 30 seconds
|
||||
:arg wait_for_checkpoint: Whether to wait for the transform to
|
||||
reach a checkpoint before stopping. Default to false
|
||||
:arg wait_for_completion: Whether to wait for the transform to
|
||||
fully stop before returning or not. Default to false
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_stop"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("defer_validation")
|
||||
async def update_transform(self, transform_id, body, params=None, headers=None):
|
||||
"""
|
||||
Updates certain properties of a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/update-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform.
|
||||
:arg body: The update transform definition
|
||||
:arg defer_validation: If validations should be deferred until
|
||||
transform starts, defaults to false.
|
||||
"""
|
||||
for param in (transform_id, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_update"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,185 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class TransformClient(NamespacedClient):
|
||||
async def delete_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
force: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_transform(
|
||||
self,
|
||||
*,
|
||||
transform_id: Optional[Any] = ...,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
exclude_generated: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_transform_stats(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def preview_transform(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
defer_validation: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def start_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stop_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
force: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_checkpoint: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def update_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
defer_validation: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,229 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class WatcherClient(NamespacedClient):
|
||||
@query_params()
|
||||
async def ack_watch(self, watch_id, action_id=None, params=None, headers=None):
|
||||
"""
|
||||
Acknowledges a watch, manually throttling the execution of the watch's actions.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-ack-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
:arg action_id: A comma-separated list of the action ids to be
|
||||
acked
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_ack", action_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def activate_watch(self, watch_id, params=None, headers=None):
|
||||
"""
|
||||
Activates a currently inactive watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-activate-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_activate"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def deactivate_watch(self, watch_id, params=None, headers=None):
|
||||
"""
|
||||
Deactivates a currently active watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-deactivate-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_deactivate"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def delete_watch(self, id, params=None, headers=None):
|
||||
"""
|
||||
Removes a watch from Watcher.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-delete-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_watcher", "watch", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("debug")
|
||||
async def execute_watch(self, body=None, id=None, params=None, headers=None):
|
||||
"""
|
||||
Forces the execution of a stored watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-execute-watch.html>`_
|
||||
|
||||
:arg body: Execution control
|
||||
:arg id: Watch ID
|
||||
:arg debug: indicates whether the watch should execute in debug
|
||||
mode
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", id, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def get_watch(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves a watch by its ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-get-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET", _make_path("_watcher", "watch", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("active", "if_primary_term", "if_seq_no", "version")
|
||||
async def put_watch(self, id, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates a new watch, or updates an existing one.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-put-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
:arg body: The watch
|
||||
:arg active: Specify whether the watch is in/active by default
|
||||
:arg if_primary_term: only update the watch if the last
|
||||
operation that has changed the watch has the specified primary term
|
||||
:arg if_seq_no: only update the watch if the last operation that
|
||||
has changed the watch has the specified sequence number
|
||||
:arg version: Explicit version number for concurrency control
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def start(self, params=None, headers=None):
|
||||
"""
|
||||
Starts Watcher if it is not already running.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-start.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_watcher/_start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("emit_stacktraces")
|
||||
async def stats(self, metric=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the current Watcher metrics.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-stats.html>`_
|
||||
|
||||
:arg metric: Controls what additional stat metrics should be
|
||||
include in the response Valid choices: _all, queued_watches,
|
||||
current_watches, pending_watches
|
||||
:arg emit_stacktraces: Emits stack traces of currently running
|
||||
watches
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_watcher", "stats", metric),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Stops Watcher if it is running.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-stop.html>`_
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST", "/_watcher/_stop", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
async def query_watches(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves stored watches.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-query-watches.html>`_
|
||||
|
||||
:arg body: From, size, query, sort and search_after
|
||||
"""
|
||||
return await self.transport.perform_request(
|
||||
"POST",
|
||||
"/_watcher/_query/watches",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,225 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class WatcherClient(NamespacedClient):
|
||||
async def ack_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
action_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def activate_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def deactivate_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def delete_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def execute_watch(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
id: Optional[Any] = ...,
|
||||
debug: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def get_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def put_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
active: Optional[Any] = ...,
|
||||
if_primary_term: Optional[Any] = ...,
|
||||
if_seq_no: Optional[Any] = ...,
|
||||
version: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stats(
|
||||
self,
|
||||
*,
|
||||
metric: Optional[Any] = ...,
|
||||
emit_stacktraces: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def query_watches(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -30,39 +30,17 @@ from __future__ import unicode_literals
|
||||
import logging
|
||||
|
||||
from ..transport import Transport, TransportError
|
||||
from .async_search import AsyncSearchClient
|
||||
from .autoscaling import AutoscalingClient
|
||||
from .cat import CatClient
|
||||
from .ccr import CcrClient
|
||||
from .cluster import ClusterClient
|
||||
from .dangling_indices import DanglingIndicesClient
|
||||
from .data_frame import Data_FrameClient
|
||||
from .enrich import EnrichClient
|
||||
from .eql import EqlClient
|
||||
from .features import FeaturesClient
|
||||
from .fleet import FleetClient
|
||||
from .graph import GraphClient
|
||||
from .ilm import IlmClient
|
||||
from .indices import IndicesClient
|
||||
from .ingest import IngestClient
|
||||
from .license import LicenseClient
|
||||
from .logstash import LogstashClient
|
||||
from .ml import MlClient
|
||||
from .monitoring import MonitoringClient
|
||||
from .nodes import NodesClient
|
||||
from .remote import RemoteClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
from .ssl import SslClient
|
||||
from .tasks import TasksClient
|
||||
from .text_structure import TextStructureClient
|
||||
from .transform import TransformClient
|
||||
from .utils import SKIP_IN_PATH, _bulk_body, _make_path, _normalize_hosts, query_params
|
||||
from .watcher import WatcherClient
|
||||
|
||||
logger = logging.getLogger("elasticsearch")
|
||||
|
||||
@@ -210,8 +188,6 @@ class Elasticsearch(object):
|
||||
self.transport = transport_class(_normalize_hosts(hosts), **kwargs)
|
||||
|
||||
# namespaced clients for compatibility with API names
|
||||
self.async_search = AsyncSearchClient(self)
|
||||
self.autoscaling = AutoscalingClient(self)
|
||||
self.cat = CatClient(self)
|
||||
self.cluster = ClusterClient(self)
|
||||
self.dangling_indices = DanglingIndicesClient(self)
|
||||
@@ -222,27 +198,7 @@ class Elasticsearch(object):
|
||||
self.snapshot = SnapshotClient(self)
|
||||
self.tasks = TasksClient(self)
|
||||
|
||||
self.ccr = CcrClient(self)
|
||||
self.data_frame = Data_FrameClient(self)
|
||||
self.enrich = EnrichClient(self)
|
||||
self.eql = EqlClient(self)
|
||||
self.features = FeaturesClient(self)
|
||||
self.fleet = FleetClient(self)
|
||||
self.graph = GraphClient(self)
|
||||
self.ilm = IlmClient(self)
|
||||
self.license = LicenseClient(self)
|
||||
self.logstash = LogstashClient(self)
|
||||
self.ml = MlClient(self)
|
||||
self.monitoring = MonitoringClient(self)
|
||||
self.searchable_snapshots = SearchableSnapshotsClient(self)
|
||||
self.security = SecurityClient(self)
|
||||
self.slm = SlmClient(self)
|
||||
self.shutdown = ShutdownClient(self)
|
||||
self.sql = SqlClient(self)
|
||||
self.ssl = SslClient(self)
|
||||
self.text_structure = TextStructureClient(self)
|
||||
self.transform = TransformClient(self)
|
||||
self.watcher = WatcherClient(self)
|
||||
|
||||
def __repr__(self):
|
||||
try:
|
||||
|
||||
@@ -31,44 +31,22 @@ import logging
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Type, Union
|
||||
|
||||
from ..transport import Transport
|
||||
from .async_search import AsyncSearchClient
|
||||
from .autoscaling import AutoscalingClient
|
||||
from .cat import CatClient
|
||||
from .ccr import CcrClient
|
||||
from .cluster import ClusterClient
|
||||
from .dangling_indices import DanglingIndicesClient
|
||||
from .enrich import EnrichClient
|
||||
from .eql import EqlClient
|
||||
from .features import FeaturesClient
|
||||
from .graph import GraphClient
|
||||
from .ilm import IlmClient
|
||||
from .indices import IndicesClient
|
||||
from .ingest import IngestClient
|
||||
from .license import LicenseClient
|
||||
from .logstash import LogstashClient
|
||||
from .ml import MlClient
|
||||
from .monitoring import MonitoringClient
|
||||
from .nodes import NodesClient
|
||||
from .remote import RemoteClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
from .ssl import SslClient
|
||||
from .tasks import TasksClient
|
||||
from .text_structure import TextStructureClient
|
||||
from .transform import TransformClient
|
||||
from .watcher import WatcherClient
|
||||
|
||||
logger: logging.Logger
|
||||
|
||||
class Elasticsearch(object):
|
||||
transport: Transport
|
||||
|
||||
async_search: AsyncSearchClient
|
||||
autoscaling: AutoscalingClient
|
||||
cat: CatClient
|
||||
cluster: ClusterClient
|
||||
features: FeaturesClient
|
||||
@@ -78,26 +56,6 @@ class Elasticsearch(object):
|
||||
remote: RemoteClient
|
||||
snapshot: SnapshotClient
|
||||
tasks: TasksClient
|
||||
|
||||
ccr: CcrClient
|
||||
dangling_indices: DanglingIndicesClient
|
||||
enrich: EnrichClient
|
||||
eql: EqlClient
|
||||
graph: GraphClient
|
||||
ilm: IlmClient
|
||||
license: LicenseClient
|
||||
logstash: LogstashClient
|
||||
ml: MlClient
|
||||
monitoring: MonitoringClient
|
||||
searchable_snapshots: SearchableSnapshotsClient
|
||||
security: SecurityClient
|
||||
shutdown: ShutdownClient
|
||||
slm: SlmClient
|
||||
sql: SqlClient
|
||||
ssl: SslClient
|
||||
transform: TransformClient
|
||||
text_structure: TextStructureClient
|
||||
watcher: WatcherClient
|
||||
def __init__(
|
||||
self,
|
||||
hosts: Any = ...,
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class AsyncSearchClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async search by ID. If the search is still running, the search
|
||||
request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE", _make_path("_async_search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("keep_alive", "typed_keys", "wait_for_completion_timeout")
|
||||
def get(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the results of a previously submitted async search request given its
|
||||
ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg keep_alive: Specify the time interval in which the results
|
||||
(partial or final) for this search will be available
|
||||
:arg typed_keys: Specify whether aggregation and suggester names
|
||||
should be prefixed by their respective types in the response
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_async_search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"_source",
|
||||
"_source_excludes",
|
||||
"_source_includes",
|
||||
"allow_no_indices",
|
||||
"allow_partial_search_results",
|
||||
"analyze_wildcard",
|
||||
"analyzer",
|
||||
"batched_reduce_size",
|
||||
"default_operator",
|
||||
"df",
|
||||
"docvalue_fields",
|
||||
"expand_wildcards",
|
||||
"explain",
|
||||
"from_",
|
||||
"ignore_throttled",
|
||||
"ignore_unavailable",
|
||||
"keep_alive",
|
||||
"keep_on_completion",
|
||||
"lenient",
|
||||
"max_concurrent_shard_requests",
|
||||
"preference",
|
||||
"q",
|
||||
"request_cache",
|
||||
"routing",
|
||||
"search_type",
|
||||
"seq_no_primary_term",
|
||||
"size",
|
||||
"sort",
|
||||
"stats",
|
||||
"stored_fields",
|
||||
"suggest_field",
|
||||
"suggest_mode",
|
||||
"suggest_size",
|
||||
"suggest_text",
|
||||
"terminate_after",
|
||||
"timeout",
|
||||
"track_scores",
|
||||
"track_total_hits",
|
||||
"typed_keys",
|
||||
"version",
|
||||
"wait_for_completion_timeout",
|
||||
)
|
||||
def submit(self, body=None, index=None, params=None, headers=None):
|
||||
"""
|
||||
Executes a search request asynchronously.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg body: The search definition using the Query DSL
|
||||
:arg index: A comma-separated list of index names to search; use
|
||||
`_all` or empty string to perform the operation on all indices
|
||||
:arg _source: True or false to return the _source field or not,
|
||||
or a list of fields to return
|
||||
:arg _source_excludes: A list of fields to exclude from the
|
||||
returned _source field
|
||||
:arg _source_includes: A list of fields to extract and return
|
||||
from the _source field
|
||||
: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)
|
||||
:arg allow_partial_search_results: Indicate if an error should
|
||||
be returned if there is a partial search failure or timeout Default:
|
||||
True
|
||||
:arg analyze_wildcard: Specify whether wildcard and prefix
|
||||
queries should be analyzed (default: false)
|
||||
:arg analyzer: The analyzer to use for the query string
|
||||
:arg batched_reduce_size: The number of shard results that
|
||||
should be reduced at once on the coordinating node. This value should be
|
||||
used as the granularity at which progress results will be made
|
||||
available. Default: 5
|
||||
:arg default_operator: The default operator for query string
|
||||
query (AND or OR) Valid choices: AND, OR Default: OR
|
||||
:arg df: The field to use as default where no field prefix is
|
||||
given in the query string
|
||||
:arg docvalue_fields: A comma-separated list of fields to return
|
||||
as the docvalue representation of a field for each hit
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg explain: Specify whether to return detailed information
|
||||
about score computation as part of a hit
|
||||
:arg from_: Starting offset (default: 0)
|
||||
:arg ignore_throttled: Whether specified concrete, expanded or
|
||||
aliased indices should be ignored when throttled
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg keep_on_completion: Control whether the response should be
|
||||
stored in the cluster if it completed within the provided
|
||||
[wait_for_completion] time (default: false)
|
||||
:arg lenient: Specify whether format-based query failures (such
|
||||
as providing text to a numeric field) should be ignored
|
||||
:arg max_concurrent_shard_requests: The number of concurrent
|
||||
shard requests per node this search executes concurrently. This value
|
||||
should be used to limit the impact of the search on the cluster in order
|
||||
to limit the number of concurrent shard requests Default: 5
|
||||
:arg preference: Specify the node or shard the operation should
|
||||
be performed on (default: random)
|
||||
: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 true
|
||||
:arg routing: A comma-separated list of specific routing values
|
||||
:arg search_type: Search operation type Valid choices:
|
||||
query_then_fetch, dfs_query_then_fetch
|
||||
:arg seq_no_primary_term: Specify whether to return sequence
|
||||
number and primary term of the last modification of each hit
|
||||
:arg size: Number of hits to return (default: 10)
|
||||
:arg sort: A comma-separated list of <field>:<direction> pairs
|
||||
:arg stats: Specific 'tag' of the request for logging and
|
||||
statistical purposes
|
||||
:arg stored_fields: A comma-separated list of stored fields to
|
||||
return as part of a hit
|
||||
:arg suggest_field: Specify which field to use for suggestions
|
||||
:arg suggest_mode: Specify suggest mode Valid choices: missing,
|
||||
popular, always Default: missing
|
||||
:arg suggest_size: How many suggestions to return in response
|
||||
:arg suggest_text: The source text for which the suggestions
|
||||
should be returned
|
||||
:arg terminate_after: The maximum number of documents to collect
|
||||
for each shard, upon reaching which the query execution will terminate
|
||||
early.
|
||||
:arg timeout: Explicit operation timeout
|
||||
:arg track_scores: Whether to calculate and return scores even
|
||||
if they are not used for sorting
|
||||
:arg track_total_hits: Indicate if the number of documents that
|
||||
match the query should be tracked
|
||||
:arg typed_keys: Specify whether aggregation and suggester names
|
||||
should be prefixed by their respective types in the response
|
||||
:arg version: Specify whether to return document version as part
|
||||
of a hit
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response Default: 1s
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_async_search"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the status of a previously submitted async search request given its
|
||||
ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/async-search.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_async_search", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class AsyncSearchClient(NamespacedClient):
|
||||
def delete(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
typed_keys: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def submit(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
index: Optional[Any] = ...,
|
||||
_source: Optional[Any] = ...,
|
||||
_source_excludes: Optional[Any] = ...,
|
||||
_source_includes: Optional[Any] = ...,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
allow_partial_search_results: Optional[Any] = ...,
|
||||
analyze_wildcard: Optional[Any] = ...,
|
||||
analyzer: Optional[Any] = ...,
|
||||
batched_reduce_size: Optional[Any] = ...,
|
||||
default_operator: Optional[Any] = ...,
|
||||
df: Optional[Any] = ...,
|
||||
docvalue_fields: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
explain: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
ignore_throttled: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
keep_on_completion: Optional[Any] = ...,
|
||||
lenient: Optional[Any] = ...,
|
||||
max_concurrent_shard_requests: Optional[Any] = ...,
|
||||
preference: Optional[Any] = ...,
|
||||
q: Optional[Any] = ...,
|
||||
request_cache: Optional[Any] = ...,
|
||||
routing: Optional[Any] = ...,
|
||||
search_type: Optional[Any] = ...,
|
||||
seq_no_primary_term: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
sort: Optional[Any] = ...,
|
||||
stats: Optional[Any] = ...,
|
||||
stored_fields: Optional[Any] = ...,
|
||||
suggest_field: Optional[Any] = ...,
|
||||
suggest_mode: Optional[Any] = ...,
|
||||
suggest_size: Optional[Any] = ...,
|
||||
suggest_text: Optional[Any] = ...,
|
||||
terminate_after: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
track_scores: Optional[Any] = ...,
|
||||
track_total_hits: Optional[Any] = ...,
|
||||
typed_keys: Optional[Any] = ...,
|
||||
version: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,105 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class AutoscalingClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_autoscaling_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-delete-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_autoscaling_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-get-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_autoscaling_policy(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
||||
Direct use is not supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-put-autoscaling-policy.html>`_
|
||||
|
||||
:arg name: the name of the autoscaling policy
|
||||
:arg body: the specification of the autoscaling policy
|
||||
"""
|
||||
for param in (name, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_autoscaling", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_autoscaling_capacity(self, params=None, headers=None):
|
||||
"""
|
||||
Gets the current autoscaling capacity based on the configured autoscaling
|
||||
policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not
|
||||
supported.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-get-autoscaling-capacity.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_autoscaling/capacity", params=params, headers=headers
|
||||
)
|
||||
@@ -1,99 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class AutoscalingClient(NamespacedClient):
|
||||
def delete_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_autoscaling_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_autoscaling_capacity(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,294 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class CcrClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes auto-follow patterns.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-delete-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("wait_for_active_shards")
|
||||
def follow(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new follower index configured to follow the referenced leader index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-put-follow.html>`_
|
||||
|
||||
:arg index: The name of the follower index
|
||||
:arg body: The name of the leader index and other optional ccr
|
||||
related parameters
|
||||
:arg wait_for_active_shards: Sets the number of shard copies
|
||||
that must be active before returning. Defaults to 0. Set to `all` for
|
||||
all shard copies, otherwise set to any non-negative value less than or
|
||||
equal to the total number of copies for the shard (number of replicas +
|
||||
1) Default: 0
|
||||
"""
|
||||
for param in (index, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path(index, "_ccr", "follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def follow_info(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about all follower indices, including parameters and
|
||||
status for each follower index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-follow-info.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index patterns; use `_all`
|
||||
to perform the operation on all indices
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ccr", "info"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def follow_stats(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves follower stats. return shard-level stats about the following tasks
|
||||
associated with each shard for the specified indices.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-follow-stats.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index patterns; use `_all`
|
||||
to perform the operation on all indices
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ccr", "stats"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def forget_follower(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Removes the follower retention leases from the leader.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-forget-follower.html>`_
|
||||
|
||||
:arg index: the name of the leader index for which specified
|
||||
follower retention leases should be removed
|
||||
:arg body: the name and UUID of the follower index, the name of
|
||||
the cluster containing the follower index, and the alias from the
|
||||
perspective of that cluster for the remote cluster containing the leader
|
||||
index
|
||||
"""
|
||||
for param in (index, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "forget_follower"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_auto_follow_pattern(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Gets configured auto-follow patterns. Returns the specified auto-follow pattern
|
||||
collection.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def pause_follow(self, index, params=None, headers=None):
|
||||
"""
|
||||
Pauses a follower index. The follower index will not fetch any additional
|
||||
operations from the leader index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-pause-follow.html>`_
|
||||
|
||||
:arg index: The name of the follower index that should pause
|
||||
following its leader index.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "pause_follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_auto_follow_pattern(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new named collection of auto-follow patterns against a specified
|
||||
remote cluster. Newly created indices on the remote cluster matching any of the
|
||||
specified patterns will be automatically configured as follower indices.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-put-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern.
|
||||
:arg body: The specification of the auto follow pattern
|
||||
"""
|
||||
for param in (name, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_ccr", "auto_follow", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def resume_follow(self, index, body=None, params=None, headers=None):
|
||||
"""
|
||||
Resumes a follower index that has been paused
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-resume-follow.html>`_
|
||||
|
||||
:arg index: The name of the follow index to resume following.
|
||||
:arg body: The name of the leader index and other optional ccr
|
||||
related parameters
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "resume_follow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def stats(self, params=None, headers=None):
|
||||
"""
|
||||
Gets all stats related to cross-cluster replication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-get-stats.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_ccr/stats", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def unfollow(self, index, params=None, headers=None):
|
||||
"""
|
||||
Stops the following task associated with a follower index and removes index
|
||||
metadata and settings associated with cross-cluster replication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-post-unfollow.html>`_
|
||||
|
||||
:arg index: The name of the follower index that should be turned
|
||||
into a regular index.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_ccr", "unfollow"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def pause_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Pauses an auto-follow pattern
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-pause-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern that should pause
|
||||
discovering new indices to follow.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ccr", "auto_follow", name, "pause"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def resume_auto_follow_pattern(self, name, params=None, headers=None):
|
||||
"""
|
||||
Resumes an auto-follow pattern that has been paused
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ccr-resume-auto-follow-pattern.html>`_
|
||||
|
||||
:arg name: The name of the auto follow pattern to resume
|
||||
discovering new indices to follow.
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ccr", "auto_follow", name, "resume"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,256 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class CcrClient(NamespacedClient):
|
||||
def delete_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
wait_for_active_shards: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def follow_info(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def follow_stats(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def forget_follower(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_auto_follow_pattern(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def pause_follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def resume_follow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def unfollow(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def pause_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def resume_auto_follow_pattern(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,158 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class Data_FrameClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_data_frame_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to delete
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("from_", "size")
|
||||
def get_data_frame_transform(self, transform_id=None, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id or comma delimited list of id expressions of
|
||||
the transforms to get, '_all' or '*' implies get all transforms
|
||||
:arg from_: skips a number of transform configs, defaults to 0
|
||||
:arg size: specifies a max number of transforms to get, defaults to 100
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_data_frame_transform_stats(
|
||||
self, transform_id=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-data-frame-transform-stats.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform for which to get stats.
|
||||
'_all' or '*' implies all transforms
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def preview_data_frame_transform(self, body, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/preview-data-frame-transform.html>`_
|
||||
|
||||
:arg body: The definition for the data_frame transform to preview
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_data_frame/transforms/_preview",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_data_frame_transform(self, transform_id, body, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the new transform.
|
||||
:arg body: The data frame transform definition
|
||||
"""
|
||||
for param in (transform_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("_data_frame", "transforms", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("timeout")
|
||||
def start_data_frame_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to start
|
||||
:arg timeout: Controls the time to wait for the transform to start
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_start"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("timeout", "wait_for_completion")
|
||||
def stop_data_frame_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/stop-data-frame-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to stop
|
||||
:arg timeout: Controls the time to wait until the transform has stopped.
|
||||
Default to 30 seconds
|
||||
:arg wait_for_completion: Whether to wait for the transform to fully
|
||||
stop before returning or not. Default to false
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_data_frame", "transforms", transform_id, "_stop"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class Data_FrameClient(NamespacedClient):
|
||||
def delete_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_data_frame_transform(
|
||||
self,
|
||||
*,
|
||||
transform_id: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_data_frame_transform_stats(
|
||||
self,
|
||||
transform_id: Optional[Any],
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def preview_data_frame_transform(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def start_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stop_data_frame_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,116 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class EnrichClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing enrich policy and its enrich index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_enrich", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("wait_for_completion")
|
||||
def execute_policy(self, name, params=None, headers=None):
|
||||
"""
|
||||
Creates the enrich index for an existing enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/execute-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
:arg wait_for_completion: Should the request should block until
|
||||
the execution is complete. Default: True
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_enrich", "policy", name, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_policy(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Gets information about an enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: A comma-separated list of enrich policy names
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_enrich", "policy", name), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_policy(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a new enrich policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-enrich-policy-api.html>`_
|
||||
|
||||
:arg name: The name of the enrich policy
|
||||
:arg body: The enrich policy to register
|
||||
"""
|
||||
for param in (name, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_enrich", "policy", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def stats(self, params=None, headers=None):
|
||||
"""
|
||||
Gets enrich coordinator statistics and information about enrich policies that
|
||||
are currently executing.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/enrich-stats-api.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_enrich/_stats", params=params, headers=headers
|
||||
)
|
||||
@@ -1,117 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class EnrichClient(NamespacedClient):
|
||||
def delete_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def execute_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_policy(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_policy(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,117 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class EqlClient(NamespacedClient):
|
||||
@query_params("keep_alive", "keep_on_completion", "wait_for_completion_timeout")
|
||||
def search(self, index, body, params=None, headers=None):
|
||||
"""
|
||||
Returns results matching a query expressed in Event Query Language (EQL)
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg index: The name of the index to scope the operation
|
||||
:arg body: Eql request body. Use the `query` to limit the query
|
||||
scope.
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg keep_on_completion: Control whether the response should be
|
||||
stored in the cluster if it completed within the provided
|
||||
[wait_for_completion] time (default: false)
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
for param in (index, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_eql", "search"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def delete(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async EQL search by ID. If the search is still running, the search
|
||||
request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE", _make_path("_eql", "search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("keep_alive", "wait_for_completion_timeout")
|
||||
def get(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns async results from previously executed Event Query Language (EQL)
|
||||
search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg keep_alive: Update the time interval in which the results
|
||||
(partial or final) for this search will be available Default: 5d
|
||||
:arg wait_for_completion_timeout: Specify the time that the
|
||||
request should block waiting for the final response
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_eql", "search", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the status of a previously submitted async or stored Event Query
|
||||
Language (EQL) search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/eql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_eql", "search", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,105 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class EqlClient(NamespacedClient):
|
||||
def search(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Any,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
keep_on_completion: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,59 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class FleetClient(NamespacedClient):
|
||||
@query_params("checkpoints", "timeout", "wait_for_advance", "wait_for_index")
|
||||
def global_checkpoints(self, index, params=None, headers=None):
|
||||
"""
|
||||
Returns the current global checkpoints for an index. This API is design for
|
||||
internal use by the fleet server project.
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: The name of the index.
|
||||
:arg checkpoints: Comma separated list of checkpoints
|
||||
:arg timeout: Timeout to wait for global checkpoint to advance
|
||||
Default: 30s
|
||||
:arg wait_for_advance: Whether to wait for the global checkpoint
|
||||
to advance past the specified current checkpoints Default: false
|
||||
:arg wait_for_index: Whether to wait for the target index to
|
||||
exist and all primary shards be active Default: false
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_fleet", "global_checkpoints"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class FleetClient(NamespacedClient):
|
||||
def global_checkpoints(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
checkpoints: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_advance: Optional[Any] = ...,
|
||||
wait_for_index: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,56 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class GraphClient(NamespacedClient):
|
||||
@query_params("routing", "timeout")
|
||||
def explore(self, index, body=None, doc_type=None, params=None, headers=None):
|
||||
"""
|
||||
Explore extracted and summarized information about the documents and terms in
|
||||
an index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/graph-explore-api.html>`_
|
||||
|
||||
:arg index: A comma-separated list of index names to search; use
|
||||
`_all` or empty string to perform the operation on all indices
|
||||
:arg body: Graph Query DSL
|
||||
:arg doc_type: A comma-separated list of document types to
|
||||
search; leave empty to perform the operation on all types
|
||||
:arg routing: Specific routing value
|
||||
:arg timeout: Explicit operation timeout
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, doc_type, "_graph", "explore"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class GraphClient(NamespacedClient):
|
||||
def explore(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
doc_type: Optional[Any] = ...,
|
||||
routing: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,217 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class IlmClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_lifecycle(self, policy, params=None, headers=None):
|
||||
"""
|
||||
Deletes the specified lifecycle policy definition. A currently used policy
|
||||
cannot be deleted.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-delete-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
"""
|
||||
if policy in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_ilm", "policy", policy),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("only_errors", "only_managed")
|
||||
def explain_lifecycle(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the index's current lifecycle state, such as the
|
||||
currently executing phase, action, and step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-explain-lifecycle.html>`_
|
||||
|
||||
:arg index: The name of the index to explain
|
||||
:arg only_errors: filters the indices included in the response
|
||||
to ones in an ILM error state, implies only_managed
|
||||
:arg only_managed: filters the indices included in the response
|
||||
to ones managed by ILM
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path(index, "_ilm", "explain"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_lifecycle(self, policy=None, params=None, headers=None):
|
||||
"""
|
||||
Returns the specified policy definition. Includes the policy version and last
|
||||
modified date.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-get-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_ilm", "policy", policy), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the current index lifecycle management (ILM) status.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-get-status.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_ilm/status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def move_to_step(self, index, body=None, params=None, headers=None):
|
||||
"""
|
||||
Manually moves an index into the specified step and executes that step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-move-to-step.html>`_
|
||||
|
||||
:arg index: The name of the index whose lifecycle step is to
|
||||
change
|
||||
:arg body: The new lifecycle step to move to
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_ilm", "move", index),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_lifecycle(self, policy, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates a lifecycle policy
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-put-lifecycle.html>`_
|
||||
|
||||
:arg policy: The name of the index lifecycle policy
|
||||
:arg body: The lifecycle policy definition to register
|
||||
"""
|
||||
if policy in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_ilm", "policy", policy),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def remove_policy(self, index, params=None, headers=None):
|
||||
"""
|
||||
Removes the assigned lifecycle policy and stops managing the specified index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-remove-policy.html>`_
|
||||
|
||||
:arg index: The name of the index to remove policy on
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", _make_path(index, "_ilm", "remove"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def retry(self, index, params=None, headers=None):
|
||||
"""
|
||||
Retries executing the policy for an index that is in the ERROR step.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-retry-policy.html>`_
|
||||
|
||||
:arg index: The name of the indices (comma-separated) whose
|
||||
failed lifecycle step is to be retry
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", _make_path(index, "_ilm", "retry"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def start(self, params=None, headers=None):
|
||||
"""
|
||||
Start the index lifecycle management (ILM) plugin.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-start.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_ilm/start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Halts all lifecycle management operations and stops the index lifecycle
|
||||
management (ILM) plugin
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-stop.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_ilm/stop", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("dry_run")
|
||||
def migrate_to_data_tiers(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Migrates the indices and ILM policies away from custom node attribute
|
||||
allocation routing to data tiers routing
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ilm-migrate-to-data-tiers.html>`_
|
||||
|
||||
:arg body: Optionally specify a legacy index template name to
|
||||
delete and optionally specify a node attribute name used for index shard
|
||||
routing (defaults to "data")
|
||||
:arg dry_run: If set to true it will simulate the migration,
|
||||
providing a way to retrieve the ILM policies and indices that need to be
|
||||
migrated. The default is false
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_ilm/migrate_to_data_tiers",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,220 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class IlmClient(NamespacedClient):
|
||||
def delete_lifecycle(
|
||||
self,
|
||||
policy: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def explain_lifecycle(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
only_errors: Optional[Any] = ...,
|
||||
only_managed: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_lifecycle(
|
||||
self,
|
||||
*,
|
||||
policy: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def move_to_step(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_lifecycle(
|
||||
self,
|
||||
policy: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def remove_policy(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def retry(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def migrate_to_data_tiers(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
dry_run: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,127 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import NamespacedClient, query_params
|
||||
|
||||
|
||||
class LicenseClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete(self, params=None, headers=None):
|
||||
"""
|
||||
Deletes licensing information for the cluster
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-license.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"DELETE", "/_license", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("accept_enterprise", "local")
|
||||
def get(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves licensing information for the cluster
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-license.html>`_
|
||||
|
||||
:arg accept_enterprise: If the active license is an enterprise
|
||||
license, return type as 'enterprise' (default: false)
|
||||
:arg local: Return local information, do not retrieve the state
|
||||
from master node (default: false)
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_license", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_basic_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the status of the basic license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-basic-status.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_license/basic_status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_trial_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the status of the trial license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-trial-status.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_license/trial_status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("acknowledge")
|
||||
def post(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Updates the license for the cluster.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/update-license.html>`_
|
||||
|
||||
:arg body: licenses to be installed
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"PUT", "/_license", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("acknowledge")
|
||||
def post_start_basic(self, params=None, headers=None):
|
||||
"""
|
||||
Starts an indefinite basic license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-basic.html>`_
|
||||
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_license/start_basic", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("acknowledge", "doc_type")
|
||||
def post_start_trial(self, params=None, headers=None):
|
||||
"""
|
||||
starts a limited time trial license.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-trial.html>`_
|
||||
|
||||
:arg acknowledge: whether the user has acknowledged acknowledge
|
||||
messages (default: false)
|
||||
:arg doc_type: The type of trial license to generate (default:
|
||||
"trial")
|
||||
"""
|
||||
# type is a reserved word so it cannot be used, use doc_type instead
|
||||
if "doc_type" in params:
|
||||
params["type"] = params.pop("doc_type")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_license/start_trial", params=params, headers=headers
|
||||
)
|
||||
@@ -1,150 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class LicenseClient(NamespacedClient):
|
||||
def delete(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
accept_enterprise: Optional[Any] = ...,
|
||||
local: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_basic_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_trial_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def post(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def post_start_basic(
|
||||
self,
|
||||
*,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def post_start_trial(
|
||||
self,
|
||||
*,
|
||||
acknowledge: Optional[Any] = ...,
|
||||
doc_type: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,89 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class LogstashClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_pipeline(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes Logstash Pipelines used by Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-delete-pipeline.html>`_
|
||||
|
||||
:arg id: The ID of the Pipeline
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_pipeline(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves Logstash Pipelines used by Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-get-pipeline.html>`_
|
||||
|
||||
:arg id: A comma-separated list of Pipeline IDs
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_pipeline(self, id, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates Logstash Pipelines used for Central Management
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/logstash-api-put-pipeline.html>`_
|
||||
|
||||
:arg id: The ID of the Pipeline
|
||||
:arg body: The Pipeline to add or update
|
||||
"""
|
||||
for param in (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("_logstash", "pipeline", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,83 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class LogstashClient(NamespacedClient):
|
||||
def delete_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_pipeline(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,62 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
|
||||
|
||||
|
||||
class MonitoringClient(NamespacedClient):
|
||||
@query_params("interval", "system_api_version", "system_id")
|
||||
def bulk(self, body, doc_type=None, params=None, headers=None):
|
||||
"""
|
||||
Used by the monitoring features to send monitoring data.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/monitor-elasticsearch-cluster.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg body: The operation definition and data (action-data
|
||||
pairs), separated by newlines
|
||||
:arg doc_type: Default document type for items which don't
|
||||
provide one
|
||||
:arg interval: Collection interval (e.g., '10s' or '10000ms') of
|
||||
the payload
|
||||
:arg system_api_version: API Version of the monitored system
|
||||
:arg system_id: Identifier of the monitored system
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
body = _bulk_body(self.transport.serializer, body)
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_monitoring", doc_type, "bulk"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,52 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class MonitoringClient(NamespacedClient):
|
||||
def bulk(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
doc_type: Optional[Any] = ...,
|
||||
interval: Optional[Any] = ...,
|
||||
system_api_version: Optional[Any] = ...,
|
||||
system_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,166 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SearchableSnapshotsClient(NamespacedClient):
|
||||
@query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable")
|
||||
def clear_cache(self, index=None, params=None, headers=None):
|
||||
"""
|
||||
Clear the cache of searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index name to limit the
|
||||
operation
|
||||
: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)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, none, all Default: open
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(index, "_searchable_snapshots", "cache", "clear"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("master_timeout", "storage", "wait_for_completion")
|
||||
def mount(self, repository, snapshot, body, params=None, headers=None):
|
||||
"""
|
||||
Mount a snapshot as a searchable index.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-api-mount-snapshot.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg repository: The name of the repository containing the
|
||||
snapshot of the index to mount
|
||||
:arg snapshot: The name of the snapshot of the index to mount
|
||||
:arg body: The restore configuration for mounting the snapshot
|
||||
as searchable
|
||||
:arg master_timeout: Explicit operation timeout for connection
|
||||
to master node
|
||||
:arg storage: Selects the kind of local storage used to
|
||||
accelerate searches. Experimental, and defaults to `full_copy`
|
||||
:arg wait_for_completion: Should this request wait until the
|
||||
operation has completed before returning
|
||||
"""
|
||||
for param in (repository, snapshot, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_snapshot", repository, snapshot, "_mount"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def repository_stats(self, repository, params=None, headers=None):
|
||||
"""
|
||||
DEPRECATED: This API is replaced by the Repositories Metering API.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg repository: The repository for which to get the stats for
|
||||
"""
|
||||
if repository in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'repository'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_snapshot", repository, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("level")
|
||||
def stats(self, index=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve shard-level statistics about searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index names
|
||||
:arg level: Return stats aggregated at cluster, index or shard
|
||||
level Valid choices: cluster, indices, shards Default: indices
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_searchable_snapshots", "stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def cache_stats(self, node_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve node-level cache statistics about searchable snapshots.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
: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
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_searchable_snapshots", node_id, "cache", "stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,125 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SearchableSnapshotsClient(NamespacedClient):
|
||||
def clear_cache(
|
||||
self,
|
||||
*,
|
||||
index: Optional[Any] = ...,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def mount(
|
||||
self,
|
||||
repository: Any,
|
||||
snapshot: Any,
|
||||
*,
|
||||
body: Any,
|
||||
master_timeout: Optional[Any] = ...,
|
||||
storage: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def repository_stats(
|
||||
self,
|
||||
repository: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stats(
|
||||
self,
|
||||
*,
|
||||
index: Optional[Any] = ...,
|
||||
level: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def cache_stats(
|
||||
self,
|
||||
*,
|
||||
node_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,882 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SecurityClient(NamespacedClient):
|
||||
@query_params()
|
||||
def authenticate(self, params=None, headers=None):
|
||||
"""
|
||||
Enables authentication as a user and retrieve information about the
|
||||
authenticated user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-authenticate.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_security/_authenticate", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def change_password(self, body, username=None, params=None, headers=None):
|
||||
"""
|
||||
Changes the passwords of users in the native realm and built-in users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-change-password.html>`_
|
||||
|
||||
:arg body: the new password for the user
|
||||
:arg username: The username of the user to change the password
|
||||
for
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_password"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("usernames")
|
||||
def clear_cached_realms(self, realms, params=None, headers=None):
|
||||
"""
|
||||
Evicts users from the user cache. Can completely clear the cache or evict
|
||||
specific users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-cache.html>`_
|
||||
|
||||
:arg realms: Comma-separated list of realms to clear
|
||||
:arg usernames: Comma-separated list of usernames to clear from
|
||||
the cache
|
||||
"""
|
||||
if realms in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'realms'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "realm", realms, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def clear_cached_roles(self, name, params=None, headers=None):
|
||||
"""
|
||||
Evicts roles from the native role cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-role-cache.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "role", name, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def create_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates an API key for access without requiring basic authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to create an API key
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT", "/_security/api_key", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def delete_privileges(self, application, name, params=None, headers=None):
|
||||
"""
|
||||
Removes application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-privilege.html>`_
|
||||
|
||||
:arg application: Application name
|
||||
:arg name: Privilege name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (application, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "privilege", application, name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def delete_role(self, name, params=None, headers=None):
|
||||
"""
|
||||
Removes roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-role.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "role", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def delete_role_mapping(self, name, params=None, headers=None):
|
||||
"""
|
||||
Removes role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-role-mapping.html>`_
|
||||
|
||||
:arg name: Role-mapping name
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def delete_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Deletes users from the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-user.html>`_
|
||||
|
||||
:arg username: username
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def disable_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Disables users in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-disable-user.html>`_
|
||||
|
||||
:arg username: The username of the user to disable
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_disable"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def enable_user(self, username, params=None, headers=None):
|
||||
"""
|
||||
Enables users in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-enable-user.html>`_
|
||||
|
||||
:arg username: The username of the user to enable
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if username in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'username'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username, "_enable"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("id", "name", "owner", "realm_name", "username")
|
||||
def get_api_key(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information for one or more API keys.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-api-key.html>`_
|
||||
|
||||
:arg id: API key id of the API key to be retrieved
|
||||
:arg name: API key name of the API key to be retrieved
|
||||
:arg owner: flag to query API keys owned by the currently
|
||||
authenticated user
|
||||
:arg realm_name: realm name of the user who created this API key
|
||||
to be retrieved
|
||||
:arg username: user name of the user who created this API key to
|
||||
be retrieved
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_security/api_key", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_privileges(self, application=None, name=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-privileges.html>`_
|
||||
|
||||
:arg application: Application name
|
||||
:arg name: Privilege name
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "privilege", application, name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_role(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-role.html>`_
|
||||
|
||||
:arg name: A comma-separated list of role names
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_security", "role", name), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_role_mapping(self, name=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-role-mapping.html>`_
|
||||
|
||||
:arg name: A comma-separated list of role-mapping names
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_token(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a bearer token for access without requiring basic authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-token.html>`_
|
||||
|
||||
:arg body: The token request to get
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_security/oauth2/token", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_user(self, username=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about users in the native realm and built-in users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-user.html>`_
|
||||
|
||||
:arg username: A comma-separated list of usernames
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_user_privileges(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves security privileges for the logged in user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-user-privileges.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_security/user/_privileges", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def has_privileges(self, body, user=None, params=None, headers=None):
|
||||
"""
|
||||
Determines whether the specified user has a specified list of privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-has-privileges.html>`_
|
||||
|
||||
:arg body: The privileges to test
|
||||
:arg user: Username
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "user", user, "_has_privileges"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def invalidate_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates one or more API keys.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-invalidate-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to invalidate API key(s)
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE", "/_security/api_key", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def invalidate_token(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates one or more access tokens or refresh tokens.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-invalidate-token.html>`_
|
||||
|
||||
:arg body: The token to invalidate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
"/_security/oauth2/token",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def put_privileges(self, body, params=None, headers=None):
|
||||
"""
|
||||
Adds or updates application privileges.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-privileges.html>`_
|
||||
|
||||
:arg body: The privilege(s) to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT", "/_security/privilege/", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def put_role(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates roles in the native realm.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-role.html>`_
|
||||
|
||||
:arg name: Role name
|
||||
:arg body: The role to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (name, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "role", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def put_role_mapping(self, name, body, params=None, headers=None):
|
||||
"""
|
||||
Creates and updates role mappings.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-role-mapping.html>`_
|
||||
|
||||
:arg name: Role-mapping name
|
||||
:arg body: The role mapping to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (name, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "role_mapping", name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def put_user(self, username, body, params=None, headers=None):
|
||||
"""
|
||||
Adds and updates users in the native realm. These users are commonly referred
|
||||
to as native users.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-put-user.html>`_
|
||||
|
||||
:arg username: The username of the User
|
||||
:arg body: The user to add
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (username, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_security", "user", username),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_builtin_privileges(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the list of cluster privileges and index privileges that are
|
||||
available in this version of Elasticsearch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-builtin-privileges.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_security/privilege/_builtin", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def clear_cached_privileges(self, application, params=None, headers=None):
|
||||
"""
|
||||
Evicts application privileges from the native application privileges cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-privilege-cache.html>`_
|
||||
|
||||
:arg application: A comma-separated list of application names
|
||||
"""
|
||||
if application in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'application'."
|
||||
)
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "privilege", application, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def clear_api_key_cache(self, ids, params=None, headers=None):
|
||||
"""
|
||||
Clear a subset or all entries from the API key cache.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-api-key-cache.html>`_
|
||||
|
||||
:arg ids: A comma-separated list of IDs of API keys to clear
|
||||
from the cache
|
||||
"""
|
||||
if ids in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'ids'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_security", "api_key", ids, "_clear_cache"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def grant_api_key(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates an API key on behalf of another user.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-grant-api-key.html>`_
|
||||
|
||||
:arg body: The api key request to create an API key
|
||||
:arg refresh: If `true` (the default) then refresh the affected
|
||||
shards to make this operation visible to search, if `wait_for` then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/api_key/grant",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def clear_cached_service_tokens(
|
||||
self, namespace, service, name, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Evicts tokens from the service account token caches.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-clear-service-token-caches.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: A comma-separated list of service token names
|
||||
"""
|
||||
for param in (namespace, service, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path(
|
||||
"_security",
|
||||
"service",
|
||||
namespace,
|
||||
service,
|
||||
"credential",
|
||||
"token",
|
||||
name,
|
||||
"_clear_cache",
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def create_service_token(
|
||||
self, namespace, service, name=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Creates a service account token for access without requiring basic
|
||||
authentication.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-service-token.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: An identifier for the token name
|
||||
:arg refresh: If `true` then refresh the affected shards to make
|
||||
this operation visible to search, if `wait_for` (the default) then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (namespace, service):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path(
|
||||
"_security", "service", namespace, service, "credential", "token", name
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("refresh")
|
||||
def delete_service_token(self, namespace, service, name, params=None, headers=None):
|
||||
"""
|
||||
Deletes a service account token.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-delete-service-token.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
:arg name: An identifier for the token name
|
||||
:arg refresh: If `true` then refresh the affected shards to make
|
||||
this operation visible to search, if `wait_for` (the default) then wait
|
||||
for a refresh to make this operation visible to search, if `false` then
|
||||
do nothing with refreshes. Valid choices: true, false, wait_for
|
||||
"""
|
||||
for param in (namespace, service, name):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path(
|
||||
"_security", "service", namespace, service, "credential", "token", name
|
||||
),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_service_accounts(
|
||||
self, namespace=None, service=None, params=None, headers=None
|
||||
):
|
||||
"""
|
||||
Retrieves information about service accounts.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-service-accounts.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "service", namespace, service),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_service_credentials(self, namespace, service, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information of all service credentials for a service account.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-get-service-credentials.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **beta** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg namespace: An identifier for the namespace
|
||||
:arg service: An identifier for the service name
|
||||
"""
|
||||
for param in (namespace, service):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "service", namespace, service, "credential"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_complete_logout(self, body, params=None, headers=None):
|
||||
"""
|
||||
Verifies the logout response sent from the SAML IdP
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-complete-logout.html>`_
|
||||
|
||||
:arg body: The logout response to verify
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/complete_logout",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_authenticate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Exchanges a SAML Response message for an Elasticsearch access token and refresh
|
||||
token pair
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-authenticate.html>`_
|
||||
|
||||
:arg body: The SAML response to authenticate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/authenticate",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_invalidate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Consumes a SAML LogoutRequest
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-invalidate.html>`_
|
||||
|
||||
:arg body: The LogoutRequest message
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_security/saml/invalidate",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_logout(self, body, params=None, headers=None):
|
||||
"""
|
||||
Invalidates an access token and a refresh token that were generated via the
|
||||
SAML Authenticate API
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-logout.html>`_
|
||||
|
||||
:arg body: The tokens to invalidate
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_security/saml/logout", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_prepare_authentication(self, body, params=None, headers=None):
|
||||
"""
|
||||
Creates a SAML authentication request
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-prepare-authentication.html>`_
|
||||
|
||||
:arg body: The realm for which to create the authentication
|
||||
request, identified by either its name or the ACS URL
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_security/saml/prepare", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def saml_service_provider_metadata(self, realm_name, params=None, headers=None):
|
||||
"""
|
||||
Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-sp-metadata.html>`_
|
||||
|
||||
:arg realm_name: The name of the SAML realm to get the metadata
|
||||
for
|
||||
"""
|
||||
if realm_name in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'realm_name'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_security", "saml", "metadata", realm_name),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,743 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SecurityClient(NamespacedClient):
|
||||
def authenticate(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def change_password(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
username: Optional[Any] = ...,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def clear_cached_realms(
|
||||
self,
|
||||
realms: Any,
|
||||
*,
|
||||
usernames: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def clear_cached_roles(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def create_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_privileges(
|
||||
self,
|
||||
application: Any,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_role(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_role_mapping(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def disable_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def enable_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_api_key(
|
||||
self,
|
||||
*,
|
||||
id: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
owner: Optional[Any] = ...,
|
||||
realm_name: Optional[Any] = ...,
|
||||
username: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_privileges(
|
||||
self,
|
||||
*,
|
||||
application: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_role(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_role_mapping(
|
||||
self,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_token(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_user(
|
||||
self,
|
||||
*,
|
||||
username: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_user_privileges(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def has_privileges(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
user: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def invalidate_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def invalidate_token(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_privileges(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_role(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_role_mapping(
|
||||
self,
|
||||
name: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_user(
|
||||
self,
|
||||
username: Any,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_builtin_privileges(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def clear_cached_privileges(
|
||||
self,
|
||||
application: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def clear_api_key_cache(
|
||||
self,
|
||||
ids: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def grant_api_key(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def clear_cached_service_tokens(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def create_service_token(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
*,
|
||||
name: Optional[Any] = ...,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_service_token(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
name: Any,
|
||||
*,
|
||||
refresh: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_service_accounts(
|
||||
self,
|
||||
*,
|
||||
namespace: Optional[Any] = ...,
|
||||
service: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_service_credentials(
|
||||
self,
|
||||
namespace: Any,
|
||||
service: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_complete_logout(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_authenticate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_invalidate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_logout(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_prepare_authentication(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def saml_service_provider_metadata(
|
||||
self,
|
||||
realm_name: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,103 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class ShutdownClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_node(self, node_id, params=None, headers=None):
|
||||
"""
|
||||
Removes a node from the shutdown list
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: The node id of node to be removed from the
|
||||
shutdown state
|
||||
"""
|
||||
if node_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'node_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_node(self, node_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieve status of a node or nodes that are currently marked as shutting down
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: Which node for which to retrieve the shutdown
|
||||
status
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_node(self, node_id, body, params=None, headers=None):
|
||||
"""
|
||||
Adds a node to be shut down
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg node_id: The node id of node to be shut down
|
||||
:arg body: The shutdown type definition to register
|
||||
"""
|
||||
for param in (node_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("_nodes", node_id, "shutdown"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,83 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class ShutdownClient(NamespacedClient):
|
||||
def delete_node(
|
||||
self,
|
||||
node_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_node(
|
||||
self,
|
||||
*,
|
||||
node_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_node(
|
||||
self,
|
||||
node_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,166 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SlmClient(NamespacedClient):
|
||||
@query_params()
|
||||
def delete_lifecycle(self, policy_id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing snapshot lifecycle policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-delete-policy.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy to
|
||||
remove
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def execute_lifecycle(self, policy_id, params=None, headers=None):
|
||||
"""
|
||||
Immediately creates a snapshot according to the lifecycle policy, without
|
||||
waiting for the scheduled time.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-execute-lifecycle.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy to be
|
||||
executed
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_slm", "policy", policy_id, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def execute_retention(self, params=None, headers=None):
|
||||
"""
|
||||
Deletes any snapshots that are expired according to the policy's retention
|
||||
rules.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-execute-retention.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_slm/_execute_retention", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_lifecycle(self, policy_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves one or more snapshot lifecycle policy definitions and information
|
||||
about the latest snapshot attempts.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-policy.html>`_
|
||||
|
||||
:arg policy_id: Comma-separated list of snapshot lifecycle
|
||||
policies to retrieve
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_stats(self, params=None, headers=None):
|
||||
"""
|
||||
Returns global and policy-level statistics about actions taken by snapshot
|
||||
lifecycle management.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-stats.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_slm/stats", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def put_lifecycle(self, policy_id, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates or updates a snapshot lifecycle policy.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-put-policy.html>`_
|
||||
|
||||
:arg policy_id: The id of the snapshot lifecycle policy
|
||||
:arg body: The snapshot lifecycle policy definition to register
|
||||
"""
|
||||
if policy_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'policy_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_slm", "policy", policy_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_status(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the status of snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-get-status.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_slm/status", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def start(self, params=None, headers=None):
|
||||
"""
|
||||
Turns on snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-start.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_slm/start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Turns off snapshot lifecycle management (SLM).
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/slm-api-stop.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_slm/stop", params=params, headers=headers
|
||||
)
|
||||
@@ -1,180 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SlmClient(NamespacedClient):
|
||||
def delete_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def execute_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def execute_retention(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_lifecycle(
|
||||
self,
|
||||
*,
|
||||
policy_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_stats(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_lifecycle(
|
||||
self,
|
||||
policy_id: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_status(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,144 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SqlClient(NamespacedClient):
|
||||
@query_params()
|
||||
def clear_cursor(self, body, params=None, headers=None):
|
||||
"""
|
||||
Clears the SQL cursor
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-pagination.html>`_
|
||||
|
||||
:arg body: Specify the cursor value in the `cursor` element to
|
||||
clean the cursor.
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_sql/close", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("format")
|
||||
def query(self, body, params=None, headers=None):
|
||||
"""
|
||||
Executes a SQL request
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-rest-overview.html>`_
|
||||
|
||||
:arg body: Use the `query` element to start a query. Use the
|
||||
`cursor` element to continue a query.
|
||||
:arg format: a short version of the Accept header, e.g. json,
|
||||
yaml
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_sql", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def translate(self, body, params=None, headers=None):
|
||||
"""
|
||||
Translates SQL into Elasticsearch queries
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-translate.html>`_
|
||||
|
||||
:arg body: Specify the query in the `query` element.
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_sql/translate", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def delete_async(self, id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an async SQL search or a stored synchronous SQL search. If the search
|
||||
is still running, the API cancels it.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-async-sql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_sql", "async", "delete", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
|
||||
def get_async(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the current status and available results for an async SQL search or
|
||||
stored synchronous SQL search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
:arg delimiter: Separator for CSV results Default: ,
|
||||
:arg format: Short version of the Accept header, e.g. json, yaml
|
||||
:arg keep_alive: Retention period for the search and its results
|
||||
Default: 5d
|
||||
:arg wait_for_completion_timeout: Duration to wait for complete
|
||||
results
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_sql", "async", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_async_status(self, id, params=None, headers=None):
|
||||
"""
|
||||
Returns the current status of an async SQL search or a stored synchronous SQL
|
||||
search
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-status-api.html>`_
|
||||
|
||||
:arg id: The async search ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_sql", "async", "status", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
@@ -1,136 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SqlClient(NamespacedClient):
|
||||
def clear_cursor(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def query(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
format: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def translate(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_async(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_async(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
delimiter: Optional[Any] = ...,
|
||||
format: Optional[Any] = ...,
|
||||
keep_alive: Optional[Any] = ...,
|
||||
wait_for_completion_timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_async_status(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,41 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import NamespacedClient, query_params
|
||||
|
||||
|
||||
class SslClient(NamespacedClient):
|
||||
@query_params()
|
||||
def certificates(self, params=None, headers=None):
|
||||
"""
|
||||
Retrieves information about the X.509 certificates used to encrypt
|
||||
communications in the cluster.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-ssl.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET", "/_ssl/certificates", params=params, headers=headers
|
||||
)
|
||||
@@ -1,47 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class SslClient(NamespacedClient):
|
||||
def certificates(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,97 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, query_params
|
||||
|
||||
|
||||
class TextStructureClient(NamespacedClient):
|
||||
@query_params(
|
||||
"charset",
|
||||
"column_names",
|
||||
"delimiter",
|
||||
"explain",
|
||||
"format",
|
||||
"grok_pattern",
|
||||
"has_header_row",
|
||||
"line_merge_size_limit",
|
||||
"lines_to_sample",
|
||||
"quote",
|
||||
"should_trim_fields",
|
||||
"timeout",
|
||||
"timestamp_field",
|
||||
"timestamp_format",
|
||||
)
|
||||
def find_structure(self, body, params=None, headers=None):
|
||||
"""
|
||||
Finds the structure of a text file. The text file must contain data that is
|
||||
suitable to be ingested into Elasticsearch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/find-structure.html>`_
|
||||
|
||||
:arg body: The contents of the file to be analyzed
|
||||
:arg charset: Optional parameter to specify the character set of
|
||||
the file
|
||||
:arg column_names: Optional parameter containing a comma
|
||||
separated list of the column names for a delimited file
|
||||
:arg delimiter: Optional parameter to specify the delimiter
|
||||
character for a delimited file - must be a single character
|
||||
:arg explain: Whether to include a commentary on how the
|
||||
structure was derived
|
||||
:arg format: Optional parameter to specify the high level file
|
||||
format Valid choices: ndjson, xml, delimited, semi_structured_text
|
||||
:arg grok_pattern: Optional parameter to specify the Grok
|
||||
pattern that should be used to extract fields from messages in a semi-
|
||||
structured text file
|
||||
:arg has_header_row: Optional parameter to specify whether a
|
||||
delimited file includes the column names in its first row
|
||||
:arg line_merge_size_limit: Maximum number of characters
|
||||
permitted in a single message when lines are merged to create messages.
|
||||
Default: 10000
|
||||
:arg lines_to_sample: How many lines of the file should be
|
||||
included in the analysis Default: 1000
|
||||
:arg quote: Optional parameter to specify the quote character
|
||||
for a delimited file - must be a single character
|
||||
:arg should_trim_fields: Optional parameter to specify whether
|
||||
the values between delimiters in a delimited file should have whitespace
|
||||
trimmed from them
|
||||
:arg timeout: Timeout after which the analysis will be aborted
|
||||
Default: 25s
|
||||
:arg timestamp_field: Optional parameter to specify the
|
||||
timestamp field in the file
|
||||
:arg timestamp_format: Optional parameter to specify the
|
||||
timestamp format in the file - may be either a Joda or Java time format
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
body = _bulk_body(self.transport.serializer, body)
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_text_structure/find_structure",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,61 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class TextStructureClient(NamespacedClient):
|
||||
def find_structure(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
charset: Optional[Any] = ...,
|
||||
column_names: Optional[Any] = ...,
|
||||
delimiter: Optional[Any] = ...,
|
||||
explain: Optional[Any] = ...,
|
||||
format: Optional[Any] = ...,
|
||||
grok_pattern: Optional[Any] = ...,
|
||||
has_header_row: Optional[Any] = ...,
|
||||
line_merge_size_limit: Optional[Any] = ...,
|
||||
lines_to_sample: Optional[Any] = ...,
|
||||
quote: Optional[Any] = ...,
|
||||
should_trim_fields: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
timestamp_field: Optional[Any] = ...,
|
||||
timestamp_format: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,240 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class TransformClient(NamespacedClient):
|
||||
@query_params("force")
|
||||
def delete_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Deletes an existing transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to delete
|
||||
:arg force: When `true`, the transform is deleted regardless of
|
||||
its current state. The default value is `false`, meaning that the
|
||||
transform must be `stopped` before it can be deleted.
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("allow_no_match", "exclude_generated", "from_", "size")
|
||||
def get_transform(self, transform_id=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves configuration information for transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-transform.html>`_
|
||||
|
||||
:arg transform_id: The id or comma delimited list of id
|
||||
expressions of the transforms to get, '_all' or '*' implies get all
|
||||
transforms
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg exclude_generated: Omits fields that are illegal to set on
|
||||
transform PUT
|
||||
:arg from_: skips a number of transform configs, defaults to 0
|
||||
:arg size: specifies a max number of transforms to get, defaults
|
||||
to 100
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("allow_no_match", "from_", "size")
|
||||
def get_transform_stats(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves usage information for transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-transform-stats.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform for which to get
|
||||
stats. '_all' or '*' implies all transforms
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg from_: skips a number of transform stats, defaults to 0
|
||||
:arg size: specifies a max number of transform stats to get,
|
||||
defaults to 100
|
||||
"""
|
||||
# from is a reserved word so it cannot be used, use from_ instead
|
||||
if "from_" in params:
|
||||
params["from"] = params.pop("from_")
|
||||
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_transform", transform_id, "_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def preview_transform(self, body, params=None, headers=None):
|
||||
"""
|
||||
Previews a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/preview-transform.html>`_
|
||||
|
||||
:arg body: The definition for the transform to preview
|
||||
"""
|
||||
if body in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_transform/_preview", params=params, headers=headers, body=body
|
||||
)
|
||||
|
||||
@query_params("defer_validation")
|
||||
def put_transform(self, transform_id, body, params=None, headers=None):
|
||||
"""
|
||||
Instantiates a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the new transform.
|
||||
:arg body: The transform definition
|
||||
:arg defer_validation: If validations should be deferred until
|
||||
transform starts, defaults to false.
|
||||
"""
|
||||
for param in (transform_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("_transform", transform_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params("timeout")
|
||||
def start_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Starts one or more transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to start
|
||||
:arg timeout: Controls the time to wait for the transform to
|
||||
start
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_start"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_match",
|
||||
"force",
|
||||
"timeout",
|
||||
"wait_for_checkpoint",
|
||||
"wait_for_completion",
|
||||
)
|
||||
def stop_transform(self, transform_id, params=None, headers=None):
|
||||
"""
|
||||
Stops one or more transforms.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/stop-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform to stop
|
||||
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||
matches no transforms. (This includes `_all` string or when no
|
||||
transforms have been specified)
|
||||
:arg force: Whether to force stop a failed transform or not.
|
||||
Default to false
|
||||
:arg timeout: Controls the time to wait until the transform has
|
||||
stopped. Default to 30 seconds
|
||||
:arg wait_for_checkpoint: Whether to wait for the transform to
|
||||
reach a checkpoint before stopping. Default to false
|
||||
:arg wait_for_completion: Whether to wait for the transform to
|
||||
fully stop before returning or not. Default to false
|
||||
"""
|
||||
if transform_id in SKIP_IN_PATH:
|
||||
raise ValueError(
|
||||
"Empty value passed for a required argument 'transform_id'."
|
||||
)
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_stop"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("defer_validation")
|
||||
def update_transform(self, transform_id, body, params=None, headers=None):
|
||||
"""
|
||||
Updates certain properties of a transform.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/update-transform.html>`_
|
||||
|
||||
:arg transform_id: The id of the transform.
|
||||
:arg body: The update transform definition
|
||||
:arg defer_validation: If validations should be deferred until
|
||||
transform starts, defaults to false.
|
||||
"""
|
||||
for param in (transform_id, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
_make_path("_transform", transform_id, "_update"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,185 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class TransformClient(NamespacedClient):
|
||||
def delete_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
force: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_transform(
|
||||
self,
|
||||
*,
|
||||
transform_id: Optional[Any] = ...,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
exclude_generated: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_transform_stats(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
from_: Optional[Any] = ...,
|
||||
size: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def preview_transform(
|
||||
self,
|
||||
*,
|
||||
body: Any,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
defer_validation: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def start_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
timeout: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stop_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
allow_no_match: Optional[Any] = ...,
|
||||
force: Optional[Any] = ...,
|
||||
timeout: Optional[Any] = ...,
|
||||
wait_for_checkpoint: Optional[Any] = ...,
|
||||
wait_for_completion: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def update_transform(
|
||||
self,
|
||||
transform_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
defer_validation: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
@@ -1,229 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class WatcherClient(NamespacedClient):
|
||||
@query_params()
|
||||
def ack_watch(self, watch_id, action_id=None, params=None, headers=None):
|
||||
"""
|
||||
Acknowledges a watch, manually throttling the execution of the watch's actions.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-ack-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
:arg action_id: A comma-separated list of the action ids to be
|
||||
acked
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_ack", action_id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def activate_watch(self, watch_id, params=None, headers=None):
|
||||
"""
|
||||
Activates a currently inactive watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-activate-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_activate"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def deactivate_watch(self, watch_id, params=None, headers=None):
|
||||
"""
|
||||
Deactivates a currently active watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-deactivate-watch.html>`_
|
||||
|
||||
:arg watch_id: Watch ID
|
||||
"""
|
||||
if watch_id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'watch_id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", watch_id, "_deactivate"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def delete_watch(self, id, params=None, headers=None):
|
||||
"""
|
||||
Removes a watch from Watcher.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-delete-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"DELETE",
|
||||
_make_path("_watcher", "watch", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params("debug")
|
||||
def execute_watch(self, body=None, id=None, params=None, headers=None):
|
||||
"""
|
||||
Forces the execution of a stored watch.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-execute-watch.html>`_
|
||||
|
||||
:arg body: Execution control
|
||||
:arg id: Watch ID
|
||||
:arg debug: indicates whether the watch should execute in debug
|
||||
mode
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", id, "_execute"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def get_watch(self, id, params=None, headers=None):
|
||||
"""
|
||||
Retrieves a watch by its ID.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-get-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET", _make_path("_watcher", "watch", id), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("active", "if_primary_term", "if_seq_no", "version")
|
||||
def put_watch(self, id, body=None, params=None, headers=None):
|
||||
"""
|
||||
Creates a new watch, or updates an existing one.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-put-watch.html>`_
|
||||
|
||||
:arg id: Watch ID
|
||||
:arg body: The watch
|
||||
:arg active: Specify whether the watch is in/active by default
|
||||
:arg if_primary_term: only update the watch if the last
|
||||
operation that has changed the watch has the specified primary term
|
||||
:arg if_seq_no: only update the watch if the last operation that
|
||||
has changed the watch has the specified sequence number
|
||||
:arg version: Explicit version number for concurrency control
|
||||
"""
|
||||
if id in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"PUT",
|
||||
_make_path("_watcher", "watch", id),
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def start(self, params=None, headers=None):
|
||||
"""
|
||||
Starts Watcher if it is not already running.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-start.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_watcher/_start", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params("emit_stacktraces")
|
||||
def stats(self, metric=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves the current Watcher metrics.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-stats.html>`_
|
||||
|
||||
:arg metric: Controls what additional stat metrics should be
|
||||
include in the response Valid choices: _all, queued_watches,
|
||||
current_watches, pending_watches
|
||||
:arg emit_stacktraces: Emits stack traces of currently running
|
||||
watches
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path("_watcher", "stats", metric),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def stop(self, params=None, headers=None):
|
||||
"""
|
||||
Stops Watcher if it is running.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-stop.html>`_
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST", "/_watcher/_stop", params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params()
|
||||
def query_watches(self, body=None, params=None, headers=None):
|
||||
"""
|
||||
Retrieves stored watches.
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/watcher-api-query-watches.html>`_
|
||||
|
||||
:arg body: From, size, query, sort and search_after
|
||||
"""
|
||||
return self.transport.perform_request(
|
||||
"POST",
|
||||
"/_watcher/_query/watches",
|
||||
params=params,
|
||||
headers=headers,
|
||||
body=body,
|
||||
)
|
||||
@@ -1,225 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# The OpenSearch Contributors require contributions made to
|
||||
# this file be licensed under the Apache-2.0 license or a
|
||||
# compatible open source license.
|
||||
#
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
#
|
||||
# Licensed to Elasticsearch B.V. under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch B.V. licenses this file to you under
|
||||
# the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Any, Collection, MutableMapping, Optional, Tuple, Union
|
||||
|
||||
from .utils import NamespacedClient
|
||||
|
||||
class WatcherClient(NamespacedClient):
|
||||
def ack_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
action_id: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def activate_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def deactivate_watch(
|
||||
self,
|
||||
watch_id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def delete_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def execute_watch(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
id: Optional[Any] = ...,
|
||||
debug: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def get_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def put_watch(
|
||||
self,
|
||||
id: Any,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
active: Optional[Any] = ...,
|
||||
if_primary_term: Optional[Any] = ...,
|
||||
if_seq_no: Optional[Any] = ...,
|
||||
version: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def start(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stats(
|
||||
self,
|
||||
*,
|
||||
metric: Optional[Any] = ...,
|
||||
emit_stacktraces: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def stop(
|
||||
self,
|
||||
*,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def query_watches(
|
||||
self,
|
||||
*,
|
||||
body: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
Reference in New Issue
Block a user