From a41fd13d2d8a9bc8d800a53faedeb8e11d4cccd0 Mon Sep 17 00:00:00 2001 From: Rushi Agrawal Date: Tue, 10 Aug 2021 15:01:01 +0530 Subject: [PATCH] remove all code related to xpack features Signed-off-by: Rushi Agrawal --- elasticsearch/_async/client/__init__.py | 44 - elasticsearch/_async/client/__init__.pyi | 42 - elasticsearch/_async/client/async_search.py | 236 --- elasticsearch/_async/client/async_search.pyi | 144 -- elasticsearch/_async/client/autoscaling.py | 105 - elasticsearch/_async/client/autoscaling.pyi | 99 - elasticsearch/_async/client/ccr.py | 294 --- elasticsearch/_async/client/ccr.pyi | 256 --- elasticsearch/_async/client/data_frame.py | 164 -- elasticsearch/_async/client/data_frame.pyi | 144 -- elasticsearch/_async/client/enrich.py | 116 -- elasticsearch/_async/client/enrich.pyi | 117 -- elasticsearch/_async/client/eql.py | 117 -- elasticsearch/_async/client/eql.pyi | 105 - elasticsearch/_async/client/fleet.py | 59 - elasticsearch/_async/client/fleet.pyi | 52 - elasticsearch/_async/client/graph.py | 56 - elasticsearch/_async/client/graph.pyi | 52 - elasticsearch/_async/client/ilm.py | 217 -- elasticsearch/_async/client/ilm.pyi | 220 -- elasticsearch/_async/client/license.py | 127 -- elasticsearch/_async/client/license.pyi | 150 -- elasticsearch/_async/client/logstash.py | 89 - elasticsearch/_async/client/logstash.pyi | 83 - elasticsearch/_async/client/ml.py | 1800 ----------------- elasticsearch/_async/client/ml.pyi | 1324 ------------ elasticsearch/_async/client/monitoring.py | 62 - elasticsearch/_async/client/monitoring.pyi | 52 - .../_async/client/searchable_snapshots.py | 166 -- .../_async/client/searchable_snapshots.pyi | 125 -- elasticsearch/_async/client/security.py | 890 -------- elasticsearch/_async/client/security.pyi | 743 ------- elasticsearch/_async/client/shutdown.py | 103 - elasticsearch/_async/client/shutdown.pyi | 83 - elasticsearch/_async/client/slm.py | 166 -- elasticsearch/_async/client/slm.pyi | 180 -- elasticsearch/_async/client/sql.py | 144 -- elasticsearch/_async/client/sql.pyi | 136 -- elasticsearch/_async/client/ssl.py | 41 - elasticsearch/_async/client/ssl.pyi | 47 - elasticsearch/_async/client/text_structure.py | 97 - .../_async/client/text_structure.pyi | 61 - elasticsearch/_async/client/transform.py | 240 --- elasticsearch/_async/client/transform.pyi | 185 -- elasticsearch/_async/client/watcher.py | 229 --- elasticsearch/_async/client/watcher.pyi | 225 --- elasticsearch/client/__init__.py | 44 - elasticsearch/client/__init__.pyi | 42 - elasticsearch/client/async_search.py | 236 --- elasticsearch/client/async_search.pyi | 144 -- elasticsearch/client/autoscaling.py | 105 - elasticsearch/client/autoscaling.pyi | 99 - elasticsearch/client/ccr.py | 294 --- elasticsearch/client/ccr.pyi | 256 --- elasticsearch/client/data_frame.py | 158 -- elasticsearch/client/data_frame.pyi | 144 -- elasticsearch/client/enrich.py | 116 -- elasticsearch/client/enrich.pyi | 117 -- elasticsearch/client/eql.py | 117 -- elasticsearch/client/eql.pyi | 105 - elasticsearch/client/fleet.py | 59 - elasticsearch/client/fleet.pyi | 52 - elasticsearch/client/graph.py | 56 - elasticsearch/client/graph.pyi | 52 - elasticsearch/client/ilm.py | 217 -- elasticsearch/client/ilm.pyi | 220 -- elasticsearch/client/license.py | 127 -- elasticsearch/client/license.pyi | 150 -- elasticsearch/client/logstash.py | 89 - elasticsearch/client/logstash.pyi | 83 - elasticsearch/client/ml.py | 1780 ---------------- elasticsearch/client/ml.pyi | 1324 ------------ elasticsearch/client/monitoring.py | 62 - elasticsearch/client/monitoring.pyi | 52 - elasticsearch/client/searchable_snapshots.py | 166 -- elasticsearch/client/searchable_snapshots.pyi | 125 -- elasticsearch/client/security.py | 882 -------- elasticsearch/client/security.pyi | 743 ------- elasticsearch/client/shutdown.py | 103 - elasticsearch/client/shutdown.pyi | 83 - elasticsearch/client/slm.py | 166 -- elasticsearch/client/slm.pyi | 180 -- elasticsearch/client/sql.py | 144 -- elasticsearch/client/sql.pyi | 136 -- elasticsearch/client/ssl.py | 41 - elasticsearch/client/ssl.pyi | 47 - elasticsearch/client/text_structure.py | 97 - elasticsearch/client/text_structure.pyi | 61 - elasticsearch/client/transform.py | 240 --- elasticsearch/client/transform.pyi | 185 -- elasticsearch/client/watcher.py | 229 --- elasticsearch/client/watcher.pyi | 225 --- 92 files changed, 20340 deletions(-) delete mode 100644 elasticsearch/_async/client/async_search.py delete mode 100644 elasticsearch/_async/client/async_search.pyi delete mode 100644 elasticsearch/_async/client/autoscaling.py delete mode 100644 elasticsearch/_async/client/autoscaling.pyi delete mode 100644 elasticsearch/_async/client/ccr.py delete mode 100644 elasticsearch/_async/client/ccr.pyi delete mode 100644 elasticsearch/_async/client/data_frame.py delete mode 100644 elasticsearch/_async/client/data_frame.pyi delete mode 100644 elasticsearch/_async/client/enrich.py delete mode 100644 elasticsearch/_async/client/enrich.pyi delete mode 100644 elasticsearch/_async/client/eql.py delete mode 100644 elasticsearch/_async/client/eql.pyi delete mode 100644 elasticsearch/_async/client/fleet.py delete mode 100644 elasticsearch/_async/client/fleet.pyi delete mode 100644 elasticsearch/_async/client/graph.py delete mode 100644 elasticsearch/_async/client/graph.pyi delete mode 100644 elasticsearch/_async/client/ilm.py delete mode 100644 elasticsearch/_async/client/ilm.pyi delete mode 100644 elasticsearch/_async/client/license.py delete mode 100644 elasticsearch/_async/client/license.pyi delete mode 100644 elasticsearch/_async/client/logstash.py delete mode 100644 elasticsearch/_async/client/logstash.pyi delete mode 100644 elasticsearch/_async/client/ml.py delete mode 100644 elasticsearch/_async/client/ml.pyi delete mode 100644 elasticsearch/_async/client/monitoring.py delete mode 100644 elasticsearch/_async/client/monitoring.pyi delete mode 100644 elasticsearch/_async/client/searchable_snapshots.py delete mode 100644 elasticsearch/_async/client/searchable_snapshots.pyi delete mode 100644 elasticsearch/_async/client/security.py delete mode 100644 elasticsearch/_async/client/security.pyi delete mode 100644 elasticsearch/_async/client/shutdown.py delete mode 100644 elasticsearch/_async/client/shutdown.pyi delete mode 100644 elasticsearch/_async/client/slm.py delete mode 100644 elasticsearch/_async/client/slm.pyi delete mode 100644 elasticsearch/_async/client/sql.py delete mode 100644 elasticsearch/_async/client/sql.pyi delete mode 100644 elasticsearch/_async/client/ssl.py delete mode 100644 elasticsearch/_async/client/ssl.pyi delete mode 100644 elasticsearch/_async/client/text_structure.py delete mode 100644 elasticsearch/_async/client/text_structure.pyi delete mode 100644 elasticsearch/_async/client/transform.py delete mode 100644 elasticsearch/_async/client/transform.pyi delete mode 100644 elasticsearch/_async/client/watcher.py delete mode 100644 elasticsearch/_async/client/watcher.pyi delete mode 100644 elasticsearch/client/async_search.py delete mode 100644 elasticsearch/client/async_search.pyi delete mode 100644 elasticsearch/client/autoscaling.py delete mode 100644 elasticsearch/client/autoscaling.pyi delete mode 100644 elasticsearch/client/ccr.py delete mode 100644 elasticsearch/client/ccr.pyi delete mode 100644 elasticsearch/client/data_frame.py delete mode 100644 elasticsearch/client/data_frame.pyi delete mode 100644 elasticsearch/client/enrich.py delete mode 100644 elasticsearch/client/enrich.pyi delete mode 100644 elasticsearch/client/eql.py delete mode 100644 elasticsearch/client/eql.pyi delete mode 100644 elasticsearch/client/fleet.py delete mode 100644 elasticsearch/client/fleet.pyi delete mode 100644 elasticsearch/client/graph.py delete mode 100644 elasticsearch/client/graph.pyi delete mode 100644 elasticsearch/client/ilm.py delete mode 100644 elasticsearch/client/ilm.pyi delete mode 100644 elasticsearch/client/license.py delete mode 100644 elasticsearch/client/license.pyi delete mode 100644 elasticsearch/client/logstash.py delete mode 100644 elasticsearch/client/logstash.pyi delete mode 100644 elasticsearch/client/ml.py delete mode 100644 elasticsearch/client/ml.pyi delete mode 100644 elasticsearch/client/monitoring.py delete mode 100644 elasticsearch/client/monitoring.pyi delete mode 100644 elasticsearch/client/searchable_snapshots.py delete mode 100644 elasticsearch/client/searchable_snapshots.pyi delete mode 100644 elasticsearch/client/security.py delete mode 100644 elasticsearch/client/security.pyi delete mode 100644 elasticsearch/client/shutdown.py delete mode 100644 elasticsearch/client/shutdown.pyi delete mode 100644 elasticsearch/client/slm.py delete mode 100644 elasticsearch/client/slm.pyi delete mode 100644 elasticsearch/client/sql.py delete mode 100644 elasticsearch/client/sql.pyi delete mode 100644 elasticsearch/client/ssl.py delete mode 100644 elasticsearch/client/ssl.pyi delete mode 100644 elasticsearch/client/text_structure.py delete mode 100644 elasticsearch/client/text_structure.pyi delete mode 100644 elasticsearch/client/transform.py delete mode 100644 elasticsearch/client/transform.pyi delete mode 100644 elasticsearch/client/watcher.py delete mode 100644 elasticsearch/client/watcher.pyi diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 2fc87ed6..71731d06 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -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: diff --git a/elasticsearch/_async/client/__init__.pyi b/elasticsearch/_async/client/__init__.pyi index 81a50612..426b5400 100644 --- a/elasticsearch/_async/client/__init__.pyi +++ b/elasticsearch/_async/client/__init__.pyi @@ -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 = ..., diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py deleted file mode 100644 index e6fb290e..00000000 --- a/elasticsearch/_async/client/async_search.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 : 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. - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/async_search.pyi b/elasticsearch/_async/client/async_search.pyi deleted file mode 100644 index c72ae56c..00000000 --- a/elasticsearch/_async/client/async_search.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py deleted file mode 100644 index 89c96707..00000000 --- a/elasticsearch/_async/client/autoscaling.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - return await self.transport.perform_request( - "GET", "/_autoscaling/capacity", params=params, headers=headers - ) diff --git a/elasticsearch/_async/client/autoscaling.pyi b/elasticsearch/_async/client/autoscaling.pyi deleted file mode 100644 index 06452215..00000000 --- a/elasticsearch/_async/client/autoscaling.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py deleted file mode 100644 index d0f37131..00000000 --- a/elasticsearch/_async/client/ccr.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/ccr.pyi b/elasticsearch/_async/client/ccr.pyi deleted file mode 100644 index b9c70ad1..00000000 --- a/elasticsearch/_async/client/ccr.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/data_frame.py b/elasticsearch/_async/client/data_frame.py deleted file mode 100644 index 9bba7a16..00000000 --- a/elasticsearch/_async/client/data_frame.py +++ /dev/null @@ -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 - ): - """ - ``_ - - :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 - ): - """ - ``_ - - :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 - ): - """ - ``_ - - :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): - """ - ``_ - - :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 - ): - """ - ``_ - - :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): - """ - ``_ - - :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): - """ - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/data_frame.pyi b/elasticsearch/_async/client/data_frame.pyi deleted file mode 100644 index 87996384..00000000 --- a/elasticsearch/_async/client/data_frame.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/enrich.py b/elasticsearch/_async/client/enrich.py deleted file mode 100644 index 20574ee3..00000000 --- a/elasticsearch/_async/client/enrich.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - return await self.transport.perform_request( - "GET", "/_enrich/_stats", params=params, headers=headers - ) diff --git a/elasticsearch/_async/client/enrich.pyi b/elasticsearch/_async/client/enrich.pyi deleted file mode 100644 index ab739641..00000000 --- a/elasticsearch/_async/client/enrich.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py deleted file mode 100644 index 407de108..00000000 --- a/elasticsearch/_async/client/eql.py +++ /dev/null @@ -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) - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/eql.pyi b/elasticsearch/_async/client/eql.pyi deleted file mode 100644 index 74caf422..00000000 --- a/elasticsearch/_async/client/eql.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py deleted file mode 100644 index 20d6165c..00000000 --- a/elasticsearch/_async/client/fleet.py +++ /dev/null @@ -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, - ) diff --git a/elasticsearch/_async/client/fleet.pyi b/elasticsearch/_async/client/fleet.pyi deleted file mode 100644 index b860f1f1..00000000 --- a/elasticsearch/_async/client/fleet.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/graph.py b/elasticsearch/_async/client/graph.py deleted file mode 100644 index bfd68dc2..00000000 --- a/elasticsearch/_async/client/graph.py +++ /dev/null @@ -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. - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/graph.pyi b/elasticsearch/_async/client/graph.pyi deleted file mode 100644 index 3db36cbb..00000000 --- a/elasticsearch/_async/client/graph.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py deleted file mode 100644 index 64f2ee5e..00000000 --- a/elasticsearch/_async/client/ilm.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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 - - ``_ - """ - 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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/ilm.pyi b/elasticsearch/_async/client/ilm.pyi deleted file mode 100644 index 8aa6e312..00000000 --- a/elasticsearch/_async/client/ilm.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/license.py b/elasticsearch/_async/client/license.py deleted file mode 100644 index b60c9b96..00000000 --- a/elasticsearch/_async/client/license.py +++ /dev/null @@ -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 - - ``_ - """ - 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 - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 - ) diff --git a/elasticsearch/_async/client/license.pyi b/elasticsearch/_async/client/license.pyi deleted file mode 100644 index 946ef94e..00000000 --- a/elasticsearch/_async/client/license.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/logstash.py b/elasticsearch/_async/client/logstash.py deleted file mode 100644 index 7343b45f..00000000 --- a/elasticsearch/_async/client/logstash.py +++ /dev/null @@ -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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/logstash.pyi b/elasticsearch/_async/client/logstash.pyi deleted file mode 100644 index c130fb8e..00000000 --- a/elasticsearch/_async/client/logstash.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py deleted file mode 100644 index 782b8c1e..00000000 --- a/elasticsearch/_async/client/ml.py +++ /dev/null @@ -1,1800 +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 MlClient(NamespacedClient): - @query_params("allow_no_jobs", "allow_no_match", "force", "timeout") - async def close_job(self, job_id, body=None, params=None, headers=None): - """ - Closes one or more anomaly detection jobs. A job can be opened and closed - multiple times throughout its lifecycle. - - ``_ - - :arg job_id: The name of the job to close - :arg body: The URL params optionally sent in the body - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg force: True if the job should be forcefully closed - :arg timeout: Controls the time to wait until a job has closed. - Default to 30 minutes - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_close"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def delete_calendar(self, calendar_id, params=None, headers=None): - """ - Deletes a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to delete - """ - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id), - params=params, - headers=headers, - ) - - @query_params() - async def delete_calendar_event( - self, calendar_id, event_id, params=None, headers=None - ): - """ - Deletes scheduled events from a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg event_id: The ID of the event to remove from the calendar - """ - for param in (calendar_id, event_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id, "events", event_id), - params=params, - headers=headers, - ) - - @query_params() - async def delete_calendar_job(self, calendar_id, job_id, params=None, headers=None): - """ - Deletes anomaly detection jobs from a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg job_id: The ID of the job to remove from the calendar - """ - for param in (calendar_id, job_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id, "jobs", job_id), - params=params, - headers=headers, - ) - - @query_params("force") - async def delete_datafeed(self, datafeed_id, params=None, headers=None): - """ - Deletes an existing datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to delete - :arg force: True if the datafeed should be forcefully deleted - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - ) - - @query_params("requests_per_second", "timeout") - async def delete_expired_data( - self, body=None, job_id=None, params=None, headers=None - ): - """ - Deletes expired and unused machine learning data. - - ``_ - - :arg body: deleting expired data parameters - :arg job_id: The ID of the job(s) to perform expired data - hygiene for - :arg requests_per_second: The desired requests per second for - the deletion processes. - :arg timeout: How long can the underlying delete processes run - until they are canceled - """ - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "_delete_expired_data", job_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def delete_filter(self, filter_id, params=None, headers=None): - """ - Deletes a filter. - - ``_ - - :arg filter_id: The ID of the filter to delete - """ - if filter_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'filter_id'.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "filters", filter_id), - params=params, - headers=headers, - ) - - @query_params("allow_no_forecasts", "timeout") - async def delete_forecast( - self, job_id, forecast_id=None, params=None, headers=None - ): - """ - Deletes forecasts from a machine learning job. - - ``_ - - :arg job_id: The ID of the job from which to delete forecasts - :arg forecast_id: The ID of the forecast to delete, can be comma - delimited list. Leaving blank implies `_all` - :arg allow_no_forecasts: Whether to ignore if `_all` matches no - forecasts - :arg timeout: Controls the time to wait until the forecast(s) - are deleted. Default to 30 seconds - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "anomaly_detectors", job_id, "_forecast", forecast_id), - params=params, - headers=headers, - ) - - @query_params("force", "wait_for_completion") - async def delete_job(self, job_id, params=None, headers=None): - """ - Deletes an existing anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to delete - :arg force: True if the job should be forcefully deleted - :arg wait_for_completion: Should this request wait until the - operation has completed before returning Default: True - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - ) - - @query_params() - async def delete_model_snapshot( - self, job_id, snapshot_id, params=None, headers=None - ): - """ - Deletes an existing model snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to delete - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "DELETE", - _make_path( - "_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id - ), - params=params, - headers=headers, - ) - - @query_params("advance_time", "calc_interim", "end", "skip_time", "start") - async def flush_job(self, job_id, body=None, params=None, headers=None): - """ - Forces any buffered data to be processed by the job. - - ``_ - - :arg job_id: The name of the job to flush - :arg body: Flush parameters - :arg advance_time: Advances time to the given value generating - results and updating the model for the advanced interval - :arg calc_interim: Calculates interim results for the most - recent bucket or all buckets within the latency period - :arg end: When used in conjunction with calc_interim, specifies - the range of buckets on which to calculate interim results - :arg skip_time: Skips time to the given value without generating - results or updating the model for the skipped interval - :arg start: When used in conjunction with calc_interim, - specifies the range of buckets on which to calculate interim results - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_flush"), - params=params, - headers=headers, - body=body, - ) - - @query_params("duration", "expires_in", "max_model_memory") - async def forecast(self, job_id, params=None, headers=None): - """ - Predicts the future behavior of a time series by using its historical behavior. - - ``_ - - :arg job_id: The ID of the job to forecast for - :arg duration: The duration of the forecast - :arg expires_in: The time interval after which the forecast - expires. Expired forecasts will be deleted at the first opportunity. - :arg max_model_memory: The max memory able to be used by the - forecast. Default is 20mb. - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_forecast"), - params=params, - headers=headers, - ) - - @query_params( - "anomaly_score", - "desc", - "end", - "exclude_interim", - "expand", - "from_", - "size", - "sort", - "start", - ) - async def get_buckets( - self, job_id, body=None, timestamp=None, params=None, headers=None - ): - """ - Retrieves anomaly detection job results for one or more buckets. - - ``_ - - :arg job_id: ID of the job to get bucket results from - :arg body: Bucket selection details if not provided in URI - :arg timestamp: The timestamp of the desired single bucket - result - :arg anomaly_score: Filter for the most anomalous buckets - :arg desc: Set the sort direction - :arg end: End time filter for buckets - :arg exclude_interim: Exclude interim results - :arg expand: Include anomaly records - :arg from_: skips a number of buckets - :arg size: specifies a max number of buckets to get - :arg sort: Sort buckets by a particular field - :arg start: Start time filter for buckets - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "buckets", timestamp - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("end", "from_", "job_id", "size", "start") - async def get_calendar_events(self, calendar_id, params=None, headers=None): - """ - Retrieves information about the scheduled events in calendars. - - ``_ - - :arg calendar_id: The ID of the calendar containing the events - :arg end: Get events before this time - :arg from_: Skips a number of events - :arg job_id: Get events for the job. When this option is used - calendar_id must be '_all' - :arg size: Specifies a max number of events to get - :arg start: Get events after this time - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return await self.transport.perform_request( - "GET", - _make_path("_ml", "calendars", calendar_id, "events"), - params=params, - headers=headers, - ) - - @query_params("from_", "size") - async def get_calendars( - self, body=None, calendar_id=None, params=None, headers=None - ): - """ - Retrieves configuration information for calendars. - - ``_ - - :arg body: The from and size parameters optionally sent in the - body - :arg calendar_id: The ID of the calendar to fetch - :arg from_: skips a number of calendars - :arg size: specifies a max number of calendars to get - """ - # 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("_ml", "calendars", calendar_id), - params=params, - headers=headers, - body=body, - ) - - @query_params("from_", "partition_field_value", "size") - async def get_categories( - self, job_id, body=None, category_id=None, params=None, headers=None - ): - """ - Retrieves anomaly detection job results for one or more categories. - - ``_ - - :arg job_id: The name of the job - :arg body: Category selection details if not provided in URI - :arg category_id: The identifier of the category definition of - interest - :arg from_: skips a number of categories - :arg partition_field_value: Specifies the partition to retrieve - categories for. This is optional, and should never be used for jobs - where per-partition categorization is disabled. - :arg size: specifies a max number of categories to get - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "categories", category_id - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_datafeeds", "allow_no_match") - async def get_datafeed_stats(self, datafeed_id=None, params=None, headers=None): - """ - Retrieves usage information for datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeeds stats to fetch - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - """ - return await self.transport.perform_request( - "GET", - _make_path("_ml", "datafeeds", datafeed_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params("allow_no_datafeeds", "allow_no_match", "exclude_generated") - async def get_datafeeds(self, datafeed_id=None, params=None, headers=None): - """ - Retrieves configuration information for datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeeds to fetch - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - :arg exclude_generated: Omits fields that are illegal to set on - datafeed PUT - """ - return await self.transport.perform_request( - "GET", - _make_path("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - ) - - @query_params("from_", "size") - async def get_filters(self, filter_id=None, params=None, headers=None): - """ - Retrieves filters. - - ``_ - - :arg filter_id: The ID of the filter to fetch - :arg from_: skips a number of filters - :arg size: specifies a max number of filters to get - """ - # 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("_ml", "filters", filter_id), - params=params, - headers=headers, - ) - - @query_params( - "desc", - "end", - "exclude_interim", - "from_", - "influencer_score", - "size", - "sort", - "start", - ) - async def get_influencers(self, job_id, body=None, params=None, headers=None): - """ - Retrieves anomaly detection job results for one or more influencers. - - ``_ - - :arg job_id: Identifier for the anomaly detection job - :arg body: Influencer selection criteria - :arg desc: whether the results should be sorted in decending - order - :arg end: end timestamp for the requested influencers - :arg exclude_interim: Exclude interim results - :arg from_: skips a number of influencers - :arg influencer_score: influencer score threshold for the - requested influencers - :arg size: specifies a max number of influencers to get - :arg sort: sort field for the requested influencers - :arg start: start timestamp for the requested influencers - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "results", "influencers"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_jobs", "allow_no_match") - async def get_job_stats(self, job_id=None, params=None, headers=None): - """ - Retrieves usage information for anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the jobs stats to fetch - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - """ - return await self.transport.perform_request( - "GET", - _make_path("_ml", "anomaly_detectors", job_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params("allow_no_jobs", "allow_no_match", "exclude_generated") - async def get_jobs(self, job_id=None, params=None, headers=None): - """ - Retrieves configuration information for anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the jobs to fetch - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg exclude_generated: Omits fields that are illegal to set on - job PUT - """ - return await self.transport.perform_request( - "GET", - _make_path("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - ) - - @query_params("desc", "end", "from_", "size", "sort", "start") - async def get_model_snapshots( - self, job_id, body=None, snapshot_id=None, params=None, headers=None - ): - """ - Retrieves information about model snapshots. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg body: Model snapshot selection criteria - :arg snapshot_id: The ID of the snapshot to fetch - :arg desc: True if the results should be sorted in descending - order - :arg end: The filter 'end' query parameter - :arg from_: Skips a number of documents - :arg size: The default number of documents returned in queries - as a string. - :arg sort: Name of the field to sort on - :arg start: The filter 'start' query parameter - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id - ), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_jobs", - "allow_no_match", - "bucket_span", - "end", - "exclude_interim", - "overall_score", - "start", - "top_n", - ) - async def get_overall_buckets(self, job_id, body=None, params=None, headers=None): - """ - Retrieves overall bucket results that summarize the bucket results of multiple - anomaly detection jobs. - - ``_ - - :arg job_id: The job IDs for which to calculate overall bucket - results - :arg body: Overall bucket selection details if not provided in - URI - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg bucket_span: The span of the overall buckets. Defaults to - the longest job bucket_span - :arg end: Returns overall buckets with timestamps earlier than - this time - :arg exclude_interim: If true overall buckets that include - interim buckets will be excluded - :arg overall_score: Returns overall buckets with overall scores - higher than this value - :arg start: Returns overall buckets with timestamps after this - time - :arg top_n: The number of top job bucket scores to be used in - the overall_score calculation - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "overall_buckets" - ), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "desc", - "end", - "exclude_interim", - "from_", - "record_score", - "size", - "sort", - "start", - ) - async def get_records(self, job_id, body=None, params=None, headers=None): - """ - Retrieves anomaly records for an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job - :arg body: Record selection criteria - :arg desc: Set the sort direction - :arg end: End time filter for records - :arg exclude_interim: Exclude interim results - :arg from_: skips a number of records - :arg record_score: Returns records with anomaly scores greater - or equal than this value - :arg size: specifies a max number of records to get - :arg sort: Sort records by a particular field - :arg start: Start time filter for records - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "results", "records"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def info(self, params=None, headers=None): - """ - Returns defaults and limits used by machine learning. - - ``_ - """ - return await self.transport.perform_request( - "GET", "/_ml/info", params=params, headers=headers - ) - - @query_params() - async def open_job(self, job_id, params=None, headers=None): - """ - Opens one or more anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the job to open - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_open"), - params=params, - headers=headers, - ) - - @query_params() - async def post_calendar_events(self, calendar_id, body, params=None, headers=None): - """ - Posts scheduled events in a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg body: A list of events - """ - for param in (calendar_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("_ml", "calendars", calendar_id, "events"), - params=params, - headers=headers, - body=body, - ) - - @query_params("reset_end", "reset_start") - async def post_data(self, job_id, body, params=None, headers=None): - """ - Sends data to an anomaly detection job for analysis. - - ``_ - - :arg job_id: The name of the job receiving the data - :arg body: The data to process - :arg reset_end: Optional parameter to specify the end of the - bucket resetting range - :arg reset_start: Optional parameter to specify the start of the - bucket resetting range - """ - for param in (job_id, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - body = _bulk_body(self.transport.serializer, body) - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_data"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def preview_datafeed( - self, body=None, datafeed_id=None, params=None, headers=None - ): - """ - Previews a datafeed. - - ``_ - - :arg body: The datafeed config and job config with which to - execute the preview - :arg datafeed_id: The ID of the datafeed to preview - """ - return await self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_preview"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def put_calendar(self, calendar_id, body=None, params=None, headers=None): - """ - Instantiates a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to create - :arg body: The calendar details - """ - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return await self.transport.perform_request( - "PUT", - _make_path("_ml", "calendars", calendar_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def put_calendar_job(self, calendar_id, job_id, params=None, headers=None): - """ - Adds an anomaly detection job to a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg job_id: The ID of the job to add to the calendar - """ - for param in (calendar_id, job_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "PUT", - _make_path("_ml", "calendars", calendar_id, "jobs", job_id), - params=params, - headers=headers, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - async def put_datafeed(self, datafeed_id, body, params=None, headers=None): - """ - Instantiates a datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to create - :arg body: The datafeed config - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true) - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open) Valid choices: - open, closed, hidden, none, all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - """ - for param in (datafeed_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("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def put_filter(self, filter_id, body, params=None, headers=None): - """ - Instantiates a filter. - - ``_ - - :arg filter_id: The ID of the filter to create - :arg body: The filter details - """ - for param in (filter_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("_ml", "filters", filter_id), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - async def put_job(self, job_id, body, params=None, headers=None): - """ - Instantiates an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to create - :arg body: The job - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true). Only set if - datafeed_config is provided. - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open). Only set if - datafeed_config is provided. Valid choices: open, closed, hidden, none, - all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true). Only set if datafeed_config is provided. - :arg ignore_unavailable: Ignore unavailable indexes (default: - false). Only set if datafeed_config is provided. - """ - for param in (job_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("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - body=body, - ) - - @query_params("delete_intervening_results") - async def revert_model_snapshot( - self, job_id, snapshot_id, body=None, params=None, headers=None - ): - """ - Reverts to a specific snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to revert to - :arg body: Reversion options - :arg delete_intervening_results: Should we reset the results - back to the time of the snapshot? - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_revert", - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("enabled", "timeout") - async def set_upgrade_mode(self, params=None, headers=None): - """ - Sets a cluster wide upgrade_mode setting that prepares machine learning indices - for an upgrade. - - ``_ - - :arg enabled: Whether to enable upgrade_mode ML setting or not. - Defaults to false. - :arg timeout: Controls the time to wait before action times out. - Defaults to 30 seconds - """ - return await self.transport.perform_request( - "POST", "/_ml/set_upgrade_mode", params=params, headers=headers - ) - - @query_params("end", "start", "timeout") - async def start_datafeed(self, datafeed_id, body=None, params=None, headers=None): - """ - Starts one or more datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeed to start - :arg body: The start datafeed parameters - :arg end: The end time when the datafeed should stop. When not - set, the datafeed continues in real time - :arg start: The start time from where the datafeed should begin - :arg timeout: Controls the time to wait until a datafeed has - started. Default to 20 seconds - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_start"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_datafeeds", "allow_no_match", "force", "timeout") - async def stop_datafeed(self, datafeed_id, body=None, params=None, headers=None): - """ - Stops one or more datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeed to stop - :arg body: The URL params optionally sent in the body - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - :arg force: True if the datafeed should be forcefully stopped. - :arg timeout: Controls the time to wait until a datafeed has - stopped. Default to 20 seconds - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_stop"), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - async def update_datafeed(self, datafeed_id, body, params=None, headers=None): - """ - Updates certain properties of a datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to update - :arg body: The datafeed update settings - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true) - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open) Valid choices: - open, closed, hidden, none, all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - """ - for param in (datafeed_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("_ml", "datafeeds", datafeed_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def update_filter(self, filter_id, body, params=None, headers=None): - """ - Updates the description of a filter, adds items, or removes items. - - ``_ - - :arg filter_id: The ID of the filter to update - :arg body: The filter update - """ - for param in (filter_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("_ml", "filters", filter_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def update_job(self, job_id, body, params=None, headers=None): - """ - Updates certain properties of an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to create - :arg body: The job update settings - """ - for param in (job_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("_ml", "anomaly_detectors", job_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def update_model_snapshot( - self, job_id, snapshot_id, body, params=None, headers=None - ): - """ - Updates certain properties of a snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to update - :arg body: The model snapshot properties to update - """ - for param in (job_id, snapshot_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( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_update", - ), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def validate(self, body, params=None, headers=None): - """ - Validates an anomaly detection job. - - ``_ - - :arg body: The job config - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return await self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_validate", - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def validate_detector(self, body, params=None, headers=None): - """ - Validates an anomaly detection detector. - - ``_ - - :arg body: The detector - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return await self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_validate/detector", - params=params, - headers=headers, - body=body, - ) - - @query_params("force", "timeout") - async def delete_data_frame_analytics(self, id, params=None, headers=None): - """ - Deletes an existing data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to delete - :arg force: True if the job should be forcefully deleted - :arg timeout: Controls the time to wait until a job is deleted. - Defaults to 1 minute - """ - 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("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - ) - - @query_params() - async def evaluate_data_frame(self, body, params=None, headers=None): - """ - Evaluates the data frame analytics for an annotated index. - - ``_ - - :arg body: The evaluation definition - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return await self.transport.perform_request( - "POST", - "/_ml/data_frame/_evaluate", - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_match", "exclude_generated", "from_", "size") - async def get_data_frame_analytics(self, id=None, params=None, headers=None): - """ - Retrieves configuration information for data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) Default: True - :arg exclude_generated: Omits fields that are illegal to set on - data frame analytics PUT - :arg from_: skips a number of analytics - :arg size: specifies a max number of analytics to get Default: - 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("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - ) - - @query_params("allow_no_match", "from_", "size", "verbose") - async def get_data_frame_analytics_stats(self, id=None, params=None, headers=None): - """ - Retrieves usage information for data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics stats to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) Default: True - :arg from_: skips a number of analytics - :arg size: specifies a max number of analytics to get Default: - 100 - :arg verbose: whether the stats response should be verbose - """ - # 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("_ml", "data_frame", "analytics", id, "_stats"), - params=params, - headers=headers, - ) - - @query_params() - async def put_data_frame_analytics(self, id, body, params=None, headers=None): - """ - Instantiates a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to create - :arg body: The data frame analytics configuration - """ - 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("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - body=body, - ) - - @query_params("timeout") - async def start_data_frame_analytics( - self, id, body=None, params=None, headers=None - ): - """ - Starts a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to start - :arg body: The start data frame analytics parameters - :arg timeout: Controls the time to wait until the task has - started. Defaults to 20 seconds - """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_start"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_match", "force", "timeout") - async def stop_data_frame_analytics(self, id, body=None, params=None, headers=None): - """ - Stops one or more data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics to stop - :arg body: The stop data frame analytics parameters - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) - :arg force: True if the data frame analytics should be - forcefully stopped - :arg timeout: Controls the time to wait until the task has - stopped. Defaults to 20 seconds - """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_stop"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def delete_trained_model(self, model_id, params=None, headers=None): - """ - Deletes an existing trained inference model that is currently not referenced by - an ingest pipeline. - - ``_ - - :arg model_id: The ID of the trained model to delete - """ - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'model_id'.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "trained_models", model_id), - params=params, - headers=headers, - ) - - @query_params() - async def explain_data_frame_analytics( - self, body=None, id=None, params=None, headers=None - ): - """ - Explains a data frame analytics config. - - ``_ - - :arg body: The data frame analytics config to explain - :arg id: The ID of the data frame analytics to explain - """ - return await self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_explain"), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_match", - "decompress_definition", - "exclude_generated", - "from_", - "include", - "include_model_definition", - "size", - "tags", - ) - async def get_trained_models(self, model_id=None, params=None, headers=None): - """ - Retrieves configuration information for a trained inference model. - - ``_ - - :arg model_id: The ID of the trained models to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no trained models. (This includes `_all` string or when no - trained models have been specified) Default: True - :arg decompress_definition: Should the model definition be - decompressed into valid JSON or returned in a custom compressed format. - Defaults to true. Default: True - :arg exclude_generated: Omits fields that are illegal to set on - model PUT - :arg from_: skips a number of trained models - :arg include: A comma-separate list of fields to optionally - include. Valid options are 'definition' and 'total_feature_importance'. - Default is none. - :arg include_model_definition: Should the full model definition - be included in the results. These definitions can be large. So be - cautious when including them. Defaults to false. - :arg size: specifies a max number of trained models to get - Default: 100 - :arg tags: A comma-separated list of tags that the model must - have. - """ - # 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("_ml", "trained_models", model_id), - params=params, - headers=headers, - ) - - @query_params("allow_no_match", "from_", "size") - async def get_trained_models_stats(self, model_id=None, params=None, headers=None): - """ - Retrieves usage information for trained inference models. - - ``_ - - :arg model_id: The ID of the trained models stats to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no trained models. (This includes `_all` string or when no - trained models have been specified) Default: True - :arg from_: skips a number of trained models - :arg size: specifies a max number of trained models to get - Default: 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("_ml", "trained_models", model_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params() - async def put_trained_model(self, model_id, body, params=None, headers=None): - """ - Creates an inference trained model. - - ``_ - - :arg model_id: The ID of the trained models to store - :arg body: The trained model configuration - """ - for param in (model_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("_ml", "trained_models", model_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def estimate_model_memory(self, body, params=None, headers=None): - """ - Estimates the model memory - - ``_ - - :arg body: The analysis config, plus cardinality estimates for - fields it references - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return await self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_estimate_model_memory", - params=params, - headers=headers, - body=body, - ) - - @query_params() - async def update_data_frame_analytics(self, id, body, params=None, headers=None): - """ - Updates certain properties of a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to update - :arg body: The data frame analytics settings to 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( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params("timeout", "wait_for_completion") - async def upgrade_job_snapshot( - self, job_id, snapshot_id, params=None, headers=None - ): - """ - Upgrades a given job snapshot to the current major version. - - ``_ - - :arg job_id: The ID of the job - :arg snapshot_id: The ID of the snapshot - :arg timeout: How long should the API wait for the job to be - opened and the old snapshot to be loaded. - :arg wait_for_completion: Should the request wait until the task - is complete before responding to the caller. Default is false. - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "POST", - _make_path( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_upgrade", - ), - params=params, - headers=headers, - ) - - @query_params() - async def delete_trained_model_alias( - self, model_id, model_alias, params=None, headers=None - ): - """ - Deletes a model alias that refers to the trained model - - ``_ - - :arg model_id: The trained model where the model alias is - assigned - :arg model_alias: The trained model alias to delete - """ - for param in (model_id, model_alias): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "DELETE", - _make_path("_ml", "trained_models", model_id, "model_aliases", model_alias), - params=params, - headers=headers, - ) - - @query_params() - async def preview_data_frame_analytics( - self, body=None, id=None, params=None, headers=None - ): - """ - Previews that will be analyzed given a data frame analytics config. - - ``_ - - :arg body: The data frame analytics config to preview - :arg id: The ID of the data frame analytics to preview - """ - return await self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_preview"), - params=params, - headers=headers, - body=body, - ) - - @query_params("reassign") - async def put_trained_model_alias( - self, model_id, model_alias, params=None, headers=None - ): - """ - Creates a new model alias (or reassigns an existing one) to refer to the - trained model - - ``_ - - :arg model_id: The trained model where the model alias should be - assigned - :arg model_alias: The trained model alias to update - :arg reassign: If the model_alias already exists and points to a - separate model_id, this parameter must be true. Defaults to false. - """ - for param in (model_id, model_alias): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return await self.transport.perform_request( - "PUT", - _make_path("_ml", "trained_models", model_id, "model_aliases", model_alias), - params=params, - headers=headers, - ) - - @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_file_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. - - ``_ - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :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", - "/_ml/find_file_structure", - params=params, - headers=headers, - body=body, - ) - - @query_params("wait_for_completion") - async def reset_job(self, job_id, params=None, headers=None): - """ - Resets an existing anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to reset - :arg wait_for_completion: Should this request wait until the - operation has completed before returning Default: True - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return await self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_reset"), - params=params, - headers=headers, - ) diff --git a/elasticsearch/_async/client/ml.pyi b/elasticsearch/_async/client/ml.pyi deleted file mode 100644 index e14d0412..00000000 --- a/elasticsearch/_async/client/ml.pyi +++ /dev/null @@ -1,1324 +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 MlClient(NamespacedClient): - async def close_job( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: 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: ... - async def delete_calendar( - self, - calendar_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_calendar_event( - self, - calendar_id: Any, - event_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_calendar_job( - self, - calendar_id: Any, - job_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_datafeed( - self, - datafeed_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 delete_expired_data( - self, - *, - body: Optional[Any] = ..., - job_id: Optional[Any] = ..., - requests_per_second: 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: ... - async def delete_filter( - self, - filter_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_forecast( - self, - job_id: Any, - *, - forecast_id: Optional[Any] = ..., - allow_no_forecasts: 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: ... - async def delete_job( - self, - job_id: Any, - *, - force: 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 delete_model_snapshot( - self, - job_id: Any, - snapshot_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 flush_job( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - advance_time: Optional[Any] = ..., - calc_interim: Optional[Any] = ..., - end: Optional[Any] = ..., - skip_time: Optional[Any] = ..., - start: 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 forecast( - self, - job_id: Any, - *, - duration: Optional[Any] = ..., - expires_in: Optional[Any] = ..., - max_model_memory: 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_buckets( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - timestamp: Optional[Any] = ..., - anomaly_score: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - expand: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_calendar_events( - self, - calendar_id: Any, - *, - end: Optional[Any] = ..., - from_: Optional[Any] = ..., - job_id: Optional[Any] = ..., - size: Optional[Any] = ..., - start: 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_calendars( - self, - *, - body: Optional[Any] = ..., - calendar_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] = ..., - http_auth: Optional[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_categories( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - category_id: Optional[Any] = ..., - from_: Optional[Any] = ..., - partition_field_value: 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_datafeed_stats( - self, - *, - datafeed_id: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: 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_datafeeds( - self, - *, - datafeed_id: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - exclude_generated: 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_filters( - self, - *, - filter_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] = ..., - http_auth: Optional[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_influencers( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - from_: Optional[Any] = ..., - influencer_score: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_job_stats( - self, - *, - job_id: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: 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_jobs( - self, - *, - job_id: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - exclude_generated: 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_model_snapshots( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - snapshot_id: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_overall_buckets( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - bucket_span: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - overall_score: Optional[Any] = ..., - start: Optional[Any] = ..., - top_n: 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_records( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - from_: Optional[Any] = ..., - record_score: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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 info( - 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 open_job( - self, - job_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 post_calendar_events( - self, - calendar_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: ... - async def post_data( - self, - job_id: Any, - *, - body: Any, - reset_end: Optional[Any] = ..., - reset_start: 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_datafeed( - self, - *, - body: Optional[Any] = ..., - datafeed_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_calendar( - self, - calendar_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 put_calendar_job( - self, - calendar_id: Any, - job_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_datafeed( - self, - datafeed_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 put_filter( - self, - filter_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: ... - async def put_job( - self, - job_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 revert_model_snapshot( - self, - job_id: Any, - snapshot_id: Any, - *, - body: Optional[Any] = ..., - delete_intervening_results: 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 set_upgrade_mode( - self, - *, - enabled: 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: ... - async def start_datafeed( - self, - datafeed_id: Any, - *, - body: Optional[Any] = ..., - end: Optional[Any] = ..., - start: 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: ... - async def stop_datafeed( - self, - datafeed_id: Any, - *, - body: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: 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: ... - async def update_datafeed( - self, - datafeed_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 update_filter( - self, - filter_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: ... - async def update_job( - self, - job_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: ... - async def update_model_snapshot( - self, - job_id: Any, - snapshot_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: ... - async def validate( - 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 validate_detector( - 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_data_frame_analytics( - self, - id: Any, - *, - force: 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: ... - async def evaluate_data_frame( - 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_data_frame_analytics( - self, - *, - 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_data_frame_analytics_stats( - self, - *, - id: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - verbose: 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_data_frame_analytics( - 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: ... - async def start_data_frame_analytics( - self, - id: Any, - *, - body: 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: ... - async def stop_data_frame_analytics( - self, - id: Any, - *, - body: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: 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: ... - async def delete_trained_model( - self, - model_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 explain_data_frame_analytics( - self, - *, - body: Optional[Any] = ..., - 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_trained_models( - self, - *, - model_id: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - decompress_definition: Optional[Any] = ..., - exclude_generated: Optional[Any] = ..., - from_: Optional[Any] = ..., - include: Optional[Any] = ..., - include_model_definition: Optional[Any] = ..., - size: Optional[Any] = ..., - tags: 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_trained_models_stats( - self, - *, - model_id: Optional[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 put_trained_model( - self, - model_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: ... - async def estimate_model_memory( - 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 update_data_frame_analytics( - 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: ... - async def upgrade_job_snapshot( - self, - job_id: Any, - snapshot_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] = ..., - http_auth: Optional[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_trained_model_alias( - self, - model_id: Any, - model_alias: 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_data_frame_analytics( - self, - *, - body: Optional[Any] = ..., - 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_trained_model_alias( - self, - model_id: Any, - model_alias: Any, - *, - reassign: 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 find_file_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: ... - async def reset_job( - self, - job_id: 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: ... diff --git a/elasticsearch/_async/client/monitoring.py b/elasticsearch/_async/client/monitoring.py deleted file mode 100644 index 8403b020..00000000 --- a/elasticsearch/_async/client/monitoring.py +++ /dev/null @@ -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. - - ``_ - - .. 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, - ) diff --git a/elasticsearch/_async/client/monitoring.pyi b/elasticsearch/_async/client/monitoring.pyi deleted file mode 100644 index 31e63fc6..00000000 --- a/elasticsearch/_async/client/monitoring.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py deleted file mode 100644 index dd0ed6c1..00000000 --- a/elasticsearch/_async/client/searchable_snapshots.py +++ /dev/null @@ -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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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, - ) diff --git a/elasticsearch/_async/client/searchable_snapshots.pyi b/elasticsearch/_async/client/searchable_snapshots.pyi deleted file mode 100644 index 3f58282c..00000000 --- a/elasticsearch/_async/client/searchable_snapshots.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py deleted file mode 100644 index 004043ad..00000000 --- a/elasticsearch/_async/client/security.py +++ /dev/null @@ -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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/security.pyi b/elasticsearch/_async/client/security.pyi deleted file mode 100644 index 41033dd3..00000000 --- a/elasticsearch/_async/client/security.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/shutdown.py b/elasticsearch/_async/client/shutdown.py deleted file mode 100644 index 1b9f7cf5..00000000 --- a/elasticsearch/_async/client/shutdown.py +++ /dev/null @@ -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 - - ``_ - - .. 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 - - ``_ - - .. 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 - - ``_ - - .. 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, - ) diff --git a/elasticsearch/_async/client/shutdown.pyi b/elasticsearch/_async/client/shutdown.pyi deleted file mode 100644 index e7e42d26..00000000 --- a/elasticsearch/_async/client/shutdown.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/slm.py b/elasticsearch/_async/client/slm.py deleted file mode 100644 index ad3c03c9..00000000 --- a/elasticsearch/_async/client/slm.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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). - - ``_ - """ - 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). - - ``_ - """ - 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). - - ``_ - """ - return await self.transport.perform_request( - "POST", "/_slm/stop", params=params, headers=headers - ) diff --git a/elasticsearch/_async/client/slm.pyi b/elasticsearch/_async/client/slm.pyi deleted file mode 100644 index 17c6eb99..00000000 --- a/elasticsearch/_async/client/slm.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py deleted file mode 100644 index 14127543..00000000 --- a/elasticsearch/_async/client/sql.py +++ /dev/null @@ -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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/sql.pyi b/elasticsearch/_async/client/sql.pyi deleted file mode 100644 index e1255005..00000000 --- a/elasticsearch/_async/client/sql.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/ssl.py b/elasticsearch/_async/client/ssl.py deleted file mode 100644 index eebefac1..00000000 --- a/elasticsearch/_async/client/ssl.py +++ /dev/null @@ -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. - - ``_ - """ - return await self.transport.perform_request( - "GET", "/_ssl/certificates", params=params, headers=headers - ) diff --git a/elasticsearch/_async/client/ssl.pyi b/elasticsearch/_async/client/ssl.pyi deleted file mode 100644 index 75093b5d..00000000 --- a/elasticsearch/_async/client/ssl.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/text_structure.py b/elasticsearch/_async/client/text_structure.py deleted file mode 100644 index 50b280bf..00000000 --- a/elasticsearch/_async/client/text_structure.py +++ /dev/null @@ -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. - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/text_structure.pyi b/elasticsearch/_async/client/text_structure.pyi deleted file mode 100644 index bc89c6bf..00000000 --- a/elasticsearch/_async/client/text_structure.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py deleted file mode 100644 index 1363b525..00000000 --- a/elasticsearch/_async/client/transform.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/transform.pyi b/elasticsearch/_async/client/transform.pyi deleted file mode 100644 index 4d51448e..00000000 --- a/elasticsearch/_async/client/transform.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py deleted file mode 100644 index fac3a99d..00000000 --- a/elasticsearch/_async/client/watcher.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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, - ) diff --git a/elasticsearch/_async/client/watcher.pyi b/elasticsearch/_async/client/watcher.pyi deleted file mode 100644 index 72df9e62..00000000 --- a/elasticsearch/_async/client/watcher.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index e4794b54..8043b42e 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -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: diff --git a/elasticsearch/client/__init__.pyi b/elasticsearch/client/__init__.pyi index b4d1580a..86d697fe 100644 --- a/elasticsearch/client/__init__.pyi +++ b/elasticsearch/client/__init__.pyi @@ -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 = ..., diff --git a/elasticsearch/client/async_search.py b/elasticsearch/client/async_search.py deleted file mode 100644 index 9b3d90f5..00000000 --- a/elasticsearch/client/async_search.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 : 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. - - ``_ - - :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, - ) diff --git a/elasticsearch/client/async_search.pyi b/elasticsearch/client/async_search.pyi deleted file mode 100644 index f786f77c..00000000 --- a/elasticsearch/client/async_search.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/autoscaling.py b/elasticsearch/client/autoscaling.py deleted file mode 100644 index 78ebfe5b..00000000 --- a/elasticsearch/client/autoscaling.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - return self.transport.perform_request( - "GET", "/_autoscaling/capacity", params=params, headers=headers - ) diff --git a/elasticsearch/client/autoscaling.pyi b/elasticsearch/client/autoscaling.pyi deleted file mode 100644 index 0f4e0063..00000000 --- a/elasticsearch/client/autoscaling.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/ccr.py b/elasticsearch/client/ccr.py deleted file mode 100644 index c85571b5..00000000 --- a/elasticsearch/client/ccr.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/ccr.pyi b/elasticsearch/client/ccr.pyi deleted file mode 100644 index 7a3f2445..00000000 --- a/elasticsearch/client/ccr.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/data_frame.py b/elasticsearch/client/data_frame.py deleted file mode 100644 index 56bbf1e1..00000000 --- a/elasticsearch/client/data_frame.py +++ /dev/null @@ -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): - """ - ``_ - - :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): - """ - ``_ - - :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 - ): - """ - ``_ - - :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): - """ - ``_ - - :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): - """ - ``_ - - :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): - """ - ``_ - - :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): - """ - ``_ - - :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, - ) diff --git a/elasticsearch/client/data_frame.pyi b/elasticsearch/client/data_frame.pyi deleted file mode 100644 index b360b494..00000000 --- a/elasticsearch/client/data_frame.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/enrich.py b/elasticsearch/client/enrich.py deleted file mode 100644 index b4ec7e87..00000000 --- a/elasticsearch/client/enrich.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - return self.transport.perform_request( - "GET", "/_enrich/_stats", params=params, headers=headers - ) diff --git a/elasticsearch/client/enrich.pyi b/elasticsearch/client/enrich.pyi deleted file mode 100644 index c876899a..00000000 --- a/elasticsearch/client/enrich.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/eql.py b/elasticsearch/client/eql.py deleted file mode 100644 index dbd05d3e..00000000 --- a/elasticsearch/client/eql.py +++ /dev/null @@ -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) - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/eql.pyi b/elasticsearch/client/eql.pyi deleted file mode 100644 index af848a07..00000000 --- a/elasticsearch/client/eql.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/fleet.py b/elasticsearch/client/fleet.py deleted file mode 100644 index 6bd15a63..00000000 --- a/elasticsearch/client/fleet.py +++ /dev/null @@ -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, - ) diff --git a/elasticsearch/client/fleet.pyi b/elasticsearch/client/fleet.pyi deleted file mode 100644 index 710c052f..00000000 --- a/elasticsearch/client/fleet.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/graph.py b/elasticsearch/client/graph.py deleted file mode 100644 index de46e7a0..00000000 --- a/elasticsearch/client/graph.py +++ /dev/null @@ -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. - - ``_ - - :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, - ) diff --git a/elasticsearch/client/graph.pyi b/elasticsearch/client/graph.pyi deleted file mode 100644 index 22204821..00000000 --- a/elasticsearch/client/graph.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/ilm.py b/elasticsearch/client/ilm.py deleted file mode 100644 index 14ccb1b4..00000000 --- a/elasticsearch/client/ilm.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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 - - ``_ - """ - 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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/ilm.pyi b/elasticsearch/client/ilm.pyi deleted file mode 100644 index d679a066..00000000 --- a/elasticsearch/client/ilm.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/license.py b/elasticsearch/client/license.py deleted file mode 100644 index c3deb494..00000000 --- a/elasticsearch/client/license.py +++ /dev/null @@ -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 - - ``_ - """ - 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 - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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 - ) diff --git a/elasticsearch/client/license.pyi b/elasticsearch/client/license.pyi deleted file mode 100644 index a7b24486..00000000 --- a/elasticsearch/client/license.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/logstash.py b/elasticsearch/client/logstash.py deleted file mode 100644 index 555c5193..00000000 --- a/elasticsearch/client/logstash.py +++ /dev/null @@ -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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/logstash.pyi b/elasticsearch/client/logstash.pyi deleted file mode 100644 index b78b4268..00000000 --- a/elasticsearch/client/logstash.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py deleted file mode 100644 index 267e5436..00000000 --- a/elasticsearch/client/ml.py +++ /dev/null @@ -1,1780 +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 MlClient(NamespacedClient): - @query_params("allow_no_jobs", "allow_no_match", "force", "timeout") - def close_job(self, job_id, body=None, params=None, headers=None): - """ - Closes one or more anomaly detection jobs. A job can be opened and closed - multiple times throughout its lifecycle. - - ``_ - - :arg job_id: The name of the job to close - :arg body: The URL params optionally sent in the body - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg force: True if the job should be forcefully closed - :arg timeout: Controls the time to wait until a job has closed. - Default to 30 minutes - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_close"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def delete_calendar(self, calendar_id, params=None, headers=None): - """ - Deletes a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to delete - """ - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id), - params=params, - headers=headers, - ) - - @query_params() - def delete_calendar_event(self, calendar_id, event_id, params=None, headers=None): - """ - Deletes scheduled events from a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg event_id: The ID of the event to remove from the calendar - """ - for param in (calendar_id, event_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id, "events", event_id), - params=params, - headers=headers, - ) - - @query_params() - def delete_calendar_job(self, calendar_id, job_id, params=None, headers=None): - """ - Deletes anomaly detection jobs from a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg job_id: The ID of the job to remove from the calendar - """ - for param in (calendar_id, job_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "calendars", calendar_id, "jobs", job_id), - params=params, - headers=headers, - ) - - @query_params("force") - def delete_datafeed(self, datafeed_id, params=None, headers=None): - """ - Deletes an existing datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to delete - :arg force: True if the datafeed should be forcefully deleted - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - ) - - @query_params("requests_per_second", "timeout") - def delete_expired_data(self, body=None, job_id=None, params=None, headers=None): - """ - Deletes expired and unused machine learning data. - - ``_ - - :arg body: deleting expired data parameters - :arg job_id: The ID of the job(s) to perform expired data - hygiene for - :arg requests_per_second: The desired requests per second for - the deletion processes. - :arg timeout: How long can the underlying delete processes run - until they are canceled - """ - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "_delete_expired_data", job_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def delete_filter(self, filter_id, params=None, headers=None): - """ - Deletes a filter. - - ``_ - - :arg filter_id: The ID of the filter to delete - """ - if filter_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'filter_id'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "filters", filter_id), - params=params, - headers=headers, - ) - - @query_params("allow_no_forecasts", "timeout") - def delete_forecast(self, job_id, forecast_id=None, params=None, headers=None): - """ - Deletes forecasts from a machine learning job. - - ``_ - - :arg job_id: The ID of the job from which to delete forecasts - :arg forecast_id: The ID of the forecast to delete, can be comma - delimited list. Leaving blank implies `_all` - :arg allow_no_forecasts: Whether to ignore if `_all` matches no - forecasts - :arg timeout: Controls the time to wait until the forecast(s) - are deleted. Default to 30 seconds - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "anomaly_detectors", job_id, "_forecast", forecast_id), - params=params, - headers=headers, - ) - - @query_params("force", "wait_for_completion") - def delete_job(self, job_id, params=None, headers=None): - """ - Deletes an existing anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to delete - :arg force: True if the job should be forcefully deleted - :arg wait_for_completion: Should this request wait until the - operation has completed before returning Default: True - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - ) - - @query_params() - def delete_model_snapshot(self, job_id, snapshot_id, params=None, headers=None): - """ - Deletes an existing model snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to delete - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "DELETE", - _make_path( - "_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id - ), - params=params, - headers=headers, - ) - - @query_params("advance_time", "calc_interim", "end", "skip_time", "start") - def flush_job(self, job_id, body=None, params=None, headers=None): - """ - Forces any buffered data to be processed by the job. - - ``_ - - :arg job_id: The name of the job to flush - :arg body: Flush parameters - :arg advance_time: Advances time to the given value generating - results and updating the model for the advanced interval - :arg calc_interim: Calculates interim results for the most - recent bucket or all buckets within the latency period - :arg end: When used in conjunction with calc_interim, specifies - the range of buckets on which to calculate interim results - :arg skip_time: Skips time to the given value without generating - results or updating the model for the skipped interval - :arg start: When used in conjunction with calc_interim, - specifies the range of buckets on which to calculate interim results - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_flush"), - params=params, - headers=headers, - body=body, - ) - - @query_params("duration", "expires_in", "max_model_memory") - def forecast(self, job_id, params=None, headers=None): - """ - Predicts the future behavior of a time series by using its historical behavior. - - ``_ - - :arg job_id: The ID of the job to forecast for - :arg duration: The duration of the forecast - :arg expires_in: The time interval after which the forecast - expires. Expired forecasts will be deleted at the first opportunity. - :arg max_model_memory: The max memory able to be used by the - forecast. Default is 20mb. - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_forecast"), - params=params, - headers=headers, - ) - - @query_params( - "anomaly_score", - "desc", - "end", - "exclude_interim", - "expand", - "from_", - "size", - "sort", - "start", - ) - def get_buckets(self, job_id, body=None, timestamp=None, params=None, headers=None): - """ - Retrieves anomaly detection job results for one or more buckets. - - ``_ - - :arg job_id: ID of the job to get bucket results from - :arg body: Bucket selection details if not provided in URI - :arg timestamp: The timestamp of the desired single bucket - result - :arg anomaly_score: Filter for the most anomalous buckets - :arg desc: Set the sort direction - :arg end: End time filter for buckets - :arg exclude_interim: Exclude interim results - :arg expand: Include anomaly records - :arg from_: skips a number of buckets - :arg size: specifies a max number of buckets to get - :arg sort: Sort buckets by a particular field - :arg start: Start time filter for buckets - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "buckets", timestamp - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("end", "from_", "job_id", "size", "start") - def get_calendar_events(self, calendar_id, params=None, headers=None): - """ - Retrieves information about the scheduled events in calendars. - - ``_ - - :arg calendar_id: The ID of the calendar containing the events - :arg end: Get events before this time - :arg from_: Skips a number of events - :arg job_id: Get events for the job. When this option is used - calendar_id must be '_all' - :arg size: Specifies a max number of events to get - :arg start: Get events after this time - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return self.transport.perform_request( - "GET", - _make_path("_ml", "calendars", calendar_id, "events"), - params=params, - headers=headers, - ) - - @query_params("from_", "size") - def get_calendars(self, body=None, calendar_id=None, params=None, headers=None): - """ - Retrieves configuration information for calendars. - - ``_ - - :arg body: The from and size parameters optionally sent in the - body - :arg calendar_id: The ID of the calendar to fetch - :arg from_: skips a number of calendars - :arg size: specifies a max number of calendars to get - """ - # 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("_ml", "calendars", calendar_id), - params=params, - headers=headers, - body=body, - ) - - @query_params("from_", "partition_field_value", "size") - def get_categories( - self, job_id, body=None, category_id=None, params=None, headers=None - ): - """ - Retrieves anomaly detection job results for one or more categories. - - ``_ - - :arg job_id: The name of the job - :arg body: Category selection details if not provided in URI - :arg category_id: The identifier of the category definition of - interest - :arg from_: skips a number of categories - :arg partition_field_value: Specifies the partition to retrieve - categories for. This is optional, and should never be used for jobs - where per-partition categorization is disabled. - :arg size: specifies a max number of categories to get - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "categories", category_id - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_datafeeds", "allow_no_match") - def get_datafeed_stats(self, datafeed_id=None, params=None, headers=None): - """ - Retrieves usage information for datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeeds stats to fetch - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - """ - return self.transport.perform_request( - "GET", - _make_path("_ml", "datafeeds", datafeed_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params("allow_no_datafeeds", "allow_no_match", "exclude_generated") - def get_datafeeds(self, datafeed_id=None, params=None, headers=None): - """ - Retrieves configuration information for datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeeds to fetch - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - :arg exclude_generated: Omits fields that are illegal to set on - datafeed PUT - """ - return self.transport.perform_request( - "GET", - _make_path("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - ) - - @query_params("from_", "size") - def get_filters(self, filter_id=None, params=None, headers=None): - """ - Retrieves filters. - - ``_ - - :arg filter_id: The ID of the filter to fetch - :arg from_: skips a number of filters - :arg size: specifies a max number of filters to get - """ - # 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("_ml", "filters", filter_id), - params=params, - headers=headers, - ) - - @query_params( - "desc", - "end", - "exclude_interim", - "from_", - "influencer_score", - "size", - "sort", - "start", - ) - def get_influencers(self, job_id, body=None, params=None, headers=None): - """ - Retrieves anomaly detection job results for one or more influencers. - - ``_ - - :arg job_id: Identifier for the anomaly detection job - :arg body: Influencer selection criteria - :arg desc: whether the results should be sorted in decending - order - :arg end: end timestamp for the requested influencers - :arg exclude_interim: Exclude interim results - :arg from_: skips a number of influencers - :arg influencer_score: influencer score threshold for the - requested influencers - :arg size: specifies a max number of influencers to get - :arg sort: sort field for the requested influencers - :arg start: start timestamp for the requested influencers - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "results", "influencers"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_jobs", "allow_no_match") - def get_job_stats(self, job_id=None, params=None, headers=None): - """ - Retrieves usage information for anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the jobs stats to fetch - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - """ - return self.transport.perform_request( - "GET", - _make_path("_ml", "anomaly_detectors", job_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params("allow_no_jobs", "allow_no_match", "exclude_generated") - def get_jobs(self, job_id=None, params=None, headers=None): - """ - Retrieves configuration information for anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the jobs to fetch - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg exclude_generated: Omits fields that are illegal to set on - job PUT - """ - return self.transport.perform_request( - "GET", - _make_path("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - ) - - @query_params("desc", "end", "from_", "size", "sort", "start") - def get_model_snapshots( - self, job_id, body=None, snapshot_id=None, params=None, headers=None - ): - """ - Retrieves information about model snapshots. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg body: Model snapshot selection criteria - :arg snapshot_id: The ID of the snapshot to fetch - :arg desc: True if the results should be sorted in descending - order - :arg end: The filter 'end' query parameter - :arg from_: Skips a number of documents - :arg size: The default number of documents returned in queries - as a string. - :arg sort: Name of the field to sort on - :arg start: The filter 'start' query parameter - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id - ), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_jobs", - "allow_no_match", - "bucket_span", - "end", - "exclude_interim", - "overall_score", - "start", - "top_n", - ) - def get_overall_buckets(self, job_id, body=None, params=None, headers=None): - """ - Retrieves overall bucket results that summarize the bucket results of multiple - anomaly detection jobs. - - ``_ - - :arg job_id: The job IDs for which to calculate overall bucket - results - :arg body: Overall bucket selection details if not provided in - URI - :arg allow_no_jobs: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no jobs. (This includes `_all` string or when no jobs have been - specified) - :arg bucket_span: The span of the overall buckets. Defaults to - the longest job bucket_span - :arg end: Returns overall buckets with timestamps earlier than - this time - :arg exclude_interim: If true overall buckets that include - interim buckets will be excluded - :arg overall_score: Returns overall buckets with overall scores - higher than this value - :arg start: Returns overall buckets with timestamps after this - time - :arg top_n: The number of top job bucket scores to be used in - the overall_score calculation - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", "anomaly_detectors", job_id, "results", "overall_buckets" - ), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "desc", - "end", - "exclude_interim", - "from_", - "record_score", - "size", - "sort", - "start", - ) - def get_records(self, job_id, body=None, params=None, headers=None): - """ - Retrieves anomaly records for an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job - :arg body: Record selection criteria - :arg desc: Set the sort direction - :arg end: End time filter for records - :arg exclude_interim: Exclude interim results - :arg from_: skips a number of records - :arg record_score: Returns records with anomaly scores greater - or equal than this value - :arg size: specifies a max number of records to get - :arg sort: Sort records by a particular field - :arg start: Start time filter for records - """ - # from is a reserved word so it cannot be used, use from_ instead - if "from_" in params: - params["from"] = params.pop("from_") - - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "results", "records"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def info(self, params=None, headers=None): - """ - Returns defaults and limits used by machine learning. - - ``_ - """ - return self.transport.perform_request( - "GET", "/_ml/info", params=params, headers=headers - ) - - @query_params() - def open_job(self, job_id, params=None, headers=None): - """ - Opens one or more anomaly detection jobs. - - ``_ - - :arg job_id: The ID of the job to open - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_open"), - params=params, - headers=headers, - ) - - @query_params() - def post_calendar_events(self, calendar_id, body, params=None, headers=None): - """ - Posts scheduled events in a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg body: A list of events - """ - for param in (calendar_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("_ml", "calendars", calendar_id, "events"), - params=params, - headers=headers, - body=body, - ) - - @query_params("reset_end", "reset_start") - def post_data(self, job_id, body, params=None, headers=None): - """ - Sends data to an anomaly detection job for analysis. - - ``_ - - :arg job_id: The name of the job receiving the data - :arg body: The data to process - :arg reset_end: Optional parameter to specify the end of the - bucket resetting range - :arg reset_start: Optional parameter to specify the start of the - bucket resetting range - """ - for param in (job_id, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - body = _bulk_body(self.transport.serializer, body) - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_data"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def preview_datafeed(self, body=None, datafeed_id=None, params=None, headers=None): - """ - Previews a datafeed. - - ``_ - - :arg body: The datafeed config and job config with which to - execute the preview - :arg datafeed_id: The ID of the datafeed to preview - """ - return self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_preview"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def put_calendar(self, calendar_id, body=None, params=None, headers=None): - """ - Instantiates a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to create - :arg body: The calendar details - """ - if calendar_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'calendar_id'." - ) - - return self.transport.perform_request( - "PUT", - _make_path("_ml", "calendars", calendar_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def put_calendar_job(self, calendar_id, job_id, params=None, headers=None): - """ - Adds an anomaly detection job to a calendar. - - ``_ - - :arg calendar_id: The ID of the calendar to modify - :arg job_id: The ID of the job to add to the calendar - """ - for param in (calendar_id, job_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "PUT", - _make_path("_ml", "calendars", calendar_id, "jobs", job_id), - params=params, - headers=headers, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - def put_datafeed(self, datafeed_id, body, params=None, headers=None): - """ - Instantiates a datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to create - :arg body: The datafeed config - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true) - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open) Valid choices: - open, closed, hidden, none, all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - """ - for param in (datafeed_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("_ml", "datafeeds", datafeed_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def put_filter(self, filter_id, body, params=None, headers=None): - """ - Instantiates a filter. - - ``_ - - :arg filter_id: The ID of the filter to create - :arg body: The filter details - """ - for param in (filter_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("_ml", "filters", filter_id), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - def put_job(self, job_id, body, params=None, headers=None): - """ - Instantiates an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to create - :arg body: The job - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true). Only set if - datafeed_config is provided. - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open). Only set if - datafeed_config is provided. Valid choices: open, closed, hidden, none, - all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true). Only set if datafeed_config is provided. - :arg ignore_unavailable: Ignore unavailable indexes (default: - false). Only set if datafeed_config is provided. - """ - for param in (job_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("_ml", "anomaly_detectors", job_id), - params=params, - headers=headers, - body=body, - ) - - @query_params("delete_intervening_results") - def revert_model_snapshot( - self, job_id, snapshot_id, body=None, params=None, headers=None - ): - """ - Reverts to a specific snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to revert to - :arg body: Reversion options - :arg delete_intervening_results: Should we reset the results - back to the time of the snapshot? - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_revert", - ), - params=params, - headers=headers, - body=body, - ) - - @query_params("enabled", "timeout") - def set_upgrade_mode(self, params=None, headers=None): - """ - Sets a cluster wide upgrade_mode setting that prepares machine learning indices - for an upgrade. - - ``_ - - :arg enabled: Whether to enable upgrade_mode ML setting or not. - Defaults to false. - :arg timeout: Controls the time to wait before action times out. - Defaults to 30 seconds - """ - return self.transport.perform_request( - "POST", "/_ml/set_upgrade_mode", params=params, headers=headers - ) - - @query_params("end", "start", "timeout") - def start_datafeed(self, datafeed_id, body=None, params=None, headers=None): - """ - Starts one or more datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeed to start - :arg body: The start datafeed parameters - :arg end: The end time when the datafeed should stop. When not - set, the datafeed continues in real time - :arg start: The start time from where the datafeed should begin - :arg timeout: Controls the time to wait until a datafeed has - started. Default to 20 seconds - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_start"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_datafeeds", "allow_no_match", "force", "timeout") - def stop_datafeed(self, datafeed_id, body=None, params=None, headers=None): - """ - Stops one or more datafeeds. - - ``_ - - :arg datafeed_id: The ID of the datafeed to stop - :arg body: The URL params optionally sent in the body - :arg allow_no_datafeeds: Whether to ignore if a wildcard - expression matches no datafeeds. (This includes `_all` string or when no - datafeeds have been specified) - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no datafeeds. (This includes `_all` string or when no datafeeds - have been specified) - :arg force: True if the datafeed should be forcefully stopped. - :arg timeout: Controls the time to wait until a datafeed has - stopped. Default to 20 seconds - """ - if datafeed_id in SKIP_IN_PATH: - raise ValueError( - "Empty value passed for a required argument 'datafeed_id'." - ) - - return self.transport.perform_request( - "POST", - _make_path("_ml", "datafeeds", datafeed_id, "_stop"), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" - ) - def update_datafeed(self, datafeed_id, body, params=None, headers=None): - """ - Updates certain properties of a datafeed. - - ``_ - - :arg datafeed_id: The ID of the datafeed to update - :arg body: The datafeed update settings - :arg allow_no_indices: Ignore if the source indices expressions - resolves to no concrete indices (default: true) - :arg expand_wildcards: Whether source index expressions should - get expanded to open or closed indices (default: open) Valid choices: - open, closed, hidden, none, all - :arg ignore_throttled: Ignore indices that are marked as - throttled (default: true) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - """ - for param in (datafeed_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("_ml", "datafeeds", datafeed_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def update_filter(self, filter_id, body, params=None, headers=None): - """ - Updates the description of a filter, adds items, or removes items. - - ``_ - - :arg filter_id: The ID of the filter to update - :arg body: The filter update - """ - for param in (filter_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("_ml", "filters", filter_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def update_job(self, job_id, body, params=None, headers=None): - """ - Updates certain properties of an anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to create - :arg body: The job update settings - """ - for param in (job_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("_ml", "anomaly_detectors", job_id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def update_model_snapshot( - self, job_id, snapshot_id, body, params=None, headers=None - ): - """ - Updates certain properties of a snapshot. - - ``_ - - :arg job_id: The ID of the job to fetch - :arg snapshot_id: The ID of the snapshot to update - :arg body: The model snapshot properties to update - """ - for param in (job_id, snapshot_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( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_update", - ), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def validate(self, body, params=None, headers=None): - """ - Validates an anomaly detection job. - - ``_ - - :arg body: The job config - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_validate", - params=params, - headers=headers, - body=body, - ) - - @query_params() - def validate_detector(self, body, params=None, headers=None): - """ - Validates an anomaly detection detector. - - ``_ - - :arg body: The detector - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_validate/detector", - params=params, - headers=headers, - body=body, - ) - - @query_params("force", "timeout") - def delete_data_frame_analytics(self, id, params=None, headers=None): - """ - Deletes an existing data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to delete - :arg force: True if the job should be forcefully deleted - :arg timeout: Controls the time to wait until a job is deleted. - Defaults to 1 minute - """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'id'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - ) - - @query_params() - def evaluate_data_frame(self, body, params=None, headers=None): - """ - Evaluates the data frame analytics for an annotated index. - - ``_ - - :arg body: The evaluation definition - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return self.transport.perform_request( - "POST", - "/_ml/data_frame/_evaluate", - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_match", "exclude_generated", "from_", "size") - def get_data_frame_analytics(self, id=None, params=None, headers=None): - """ - Retrieves configuration information for data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) Default: True - :arg exclude_generated: Omits fields that are illegal to set on - data frame analytics PUT - :arg from_: skips a number of analytics - :arg size: specifies a max number of analytics to get Default: - 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("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - ) - - @query_params("allow_no_match", "from_", "size", "verbose") - def get_data_frame_analytics_stats(self, id=None, params=None, headers=None): - """ - Retrieves usage information for data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics stats to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) Default: True - :arg from_: skips a number of analytics - :arg size: specifies a max number of analytics to get Default: - 100 - :arg verbose: whether the stats response should be verbose - """ - # 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("_ml", "data_frame", "analytics", id, "_stats"), - params=params, - headers=headers, - ) - - @query_params() - def put_data_frame_analytics(self, id, body, params=None, headers=None): - """ - Instantiates a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to create - :arg body: The data frame analytics configuration - """ - 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("_ml", "data_frame", "analytics", id), - params=params, - headers=headers, - body=body, - ) - - @query_params("timeout") - def start_data_frame_analytics(self, id, body=None, params=None, headers=None): - """ - Starts a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to start - :arg body: The start data frame analytics parameters - :arg timeout: Controls the time to wait until the task has - started. Defaults to 20 seconds - """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_start"), - params=params, - headers=headers, - body=body, - ) - - @query_params("allow_no_match", "force", "timeout") - def stop_data_frame_analytics(self, id, body=None, params=None, headers=None): - """ - Stops one or more data frame analytics jobs. - - ``_ - - :arg id: The ID of the data frame analytics to stop - :arg body: The stop data frame analytics parameters - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no data frame analytics. (This includes `_all` string or when no - data frame analytics have been specified) - :arg force: True if the data frame analytics should be - forcefully stopped - :arg timeout: Controls the time to wait until the task has - stopped. Defaults to 20 seconds - """ - if id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_stop"), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def delete_trained_model(self, model_id, params=None, headers=None): - """ - Deletes an existing trained inference model that is currently not referenced by - an ingest pipeline. - - ``_ - - :arg model_id: The ID of the trained model to delete - """ - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'model_id'.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "trained_models", model_id), - params=params, - headers=headers, - ) - - @query_params() - def explain_data_frame_analytics( - self, body=None, id=None, params=None, headers=None - ): - """ - Explains a data frame analytics config. - - ``_ - - :arg body: The data frame analytics config to explain - :arg id: The ID of the data frame analytics to explain - """ - return self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_explain"), - params=params, - headers=headers, - body=body, - ) - - @query_params( - "allow_no_match", - "decompress_definition", - "exclude_generated", - "from_", - "include", - "include_model_definition", - "size", - "tags", - ) - def get_trained_models(self, model_id=None, params=None, headers=None): - """ - Retrieves configuration information for a trained inference model. - - ``_ - - :arg model_id: The ID of the trained models to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no trained models. (This includes `_all` string or when no - trained models have been specified) Default: True - :arg decompress_definition: Should the model definition be - decompressed into valid JSON or returned in a custom compressed format. - Defaults to true. Default: True - :arg exclude_generated: Omits fields that are illegal to set on - model PUT - :arg from_: skips a number of trained models - :arg include: A comma-separate list of fields to optionally - include. Valid options are 'definition' and 'total_feature_importance'. - Default is none. - :arg include_model_definition: Should the full model definition - be included in the results. These definitions can be large. So be - cautious when including them. Defaults to false. - :arg size: specifies a max number of trained models to get - Default: 100 - :arg tags: A comma-separated list of tags that the model must - have. - """ - # 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("_ml", "trained_models", model_id), - params=params, - headers=headers, - ) - - @query_params("allow_no_match", "from_", "size") - def get_trained_models_stats(self, model_id=None, params=None, headers=None): - """ - Retrieves usage information for trained inference models. - - ``_ - - :arg model_id: The ID of the trained models stats to fetch - :arg allow_no_match: Whether to ignore if a wildcard expression - matches no trained models. (This includes `_all` string or when no - trained models have been specified) Default: True - :arg from_: skips a number of trained models - :arg size: specifies a max number of trained models to get - Default: 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("_ml", "trained_models", model_id, "_stats"), - params=params, - headers=headers, - ) - - @query_params() - def put_trained_model(self, model_id, body, params=None, headers=None): - """ - Creates an inference trained model. - - ``_ - - :arg model_id: The ID of the trained models to store - :arg body: The trained model configuration - """ - for param in (model_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("_ml", "trained_models", model_id), - params=params, - headers=headers, - body=body, - ) - - @query_params() - def estimate_model_memory(self, body, params=None, headers=None): - """ - Estimates the model memory - - ``_ - - :arg body: The analysis config, plus cardinality estimates for - fields it references - """ - if body in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'body'.") - - return self.transport.perform_request( - "POST", - "/_ml/anomaly_detectors/_estimate_model_memory", - params=params, - headers=headers, - body=body, - ) - - @query_params() - def update_data_frame_analytics(self, id, body, params=None, headers=None): - """ - Updates certain properties of a data frame analytics job. - - ``_ - - :arg id: The ID of the data frame analytics to update - :arg body: The data frame analytics settings to 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( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_update"), - params=params, - headers=headers, - body=body, - ) - - @query_params("timeout", "wait_for_completion") - def upgrade_job_snapshot(self, job_id, snapshot_id, params=None, headers=None): - """ - Upgrades a given job snapshot to the current major version. - - ``_ - - :arg job_id: The ID of the job - :arg snapshot_id: The ID of the snapshot - :arg timeout: How long should the API wait for the job to be - opened and the old snapshot to be loaded. - :arg wait_for_completion: Should the request wait until the task - is complete before responding to the caller. Default is false. - """ - for param in (job_id, snapshot_id): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "POST", - _make_path( - "_ml", - "anomaly_detectors", - job_id, - "model_snapshots", - snapshot_id, - "_upgrade", - ), - params=params, - headers=headers, - ) - - @query_params() - def delete_trained_model_alias( - self, model_id, model_alias, params=None, headers=None - ): - """ - Deletes a model alias that refers to the trained model - - ``_ - - :arg model_id: The trained model where the model alias is - assigned - :arg model_alias: The trained model alias to delete - """ - for param in (model_id, model_alias): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "DELETE", - _make_path("_ml", "trained_models", model_id, "model_aliases", model_alias), - params=params, - headers=headers, - ) - - @query_params() - def preview_data_frame_analytics( - self, body=None, id=None, params=None, headers=None - ): - """ - Previews that will be analyzed given a data frame analytics config. - - ``_ - - :arg body: The data frame analytics config to preview - :arg id: The ID of the data frame analytics to preview - """ - return self.transport.perform_request( - "POST", - _make_path("_ml", "data_frame", "analytics", id, "_preview"), - params=params, - headers=headers, - body=body, - ) - - @query_params("reassign") - def put_trained_model_alias(self, model_id, model_alias, params=None, headers=None): - """ - Creates a new model alias (or reassigns an existing one) to refer to the - trained model - - ``_ - - :arg model_id: The trained model where the model alias should be - assigned - :arg model_alias: The trained model alias to update - :arg reassign: If the model_alias already exists and points to a - separate model_id, this parameter must be true. Defaults to false. - """ - for param in (model_id, model_alias): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") - - return self.transport.perform_request( - "PUT", - _make_path("_ml", "trained_models", model_id, "model_aliases", model_alias), - params=params, - headers=headers, - ) - - @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_file_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. - - ``_ - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :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", - "/_ml/find_file_structure", - params=params, - headers=headers, - body=body, - ) - - @query_params("wait_for_completion") - def reset_job(self, job_id, params=None, headers=None): - """ - Resets an existing anomaly detection job. - - ``_ - - :arg job_id: The ID of the job to reset - :arg wait_for_completion: Should this request wait until the - operation has completed before returning Default: True - """ - if job_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'job_id'.") - - return self.transport.perform_request( - "POST", - _make_path("_ml", "anomaly_detectors", job_id, "_reset"), - params=params, - headers=headers, - ) diff --git a/elasticsearch/client/ml.pyi b/elasticsearch/client/ml.pyi deleted file mode 100644 index 2fcd6269..00000000 --- a/elasticsearch/client/ml.pyi +++ /dev/null @@ -1,1324 +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 MlClient(NamespacedClient): - def close_job( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def delete_calendar( - self, - calendar_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_calendar_event( - self, - calendar_id: Any, - event_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_calendar_job( - self, - calendar_id: Any, - job_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_datafeed( - self, - datafeed_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 delete_expired_data( - self, - *, - body: Optional[Any] = ..., - job_id: Optional[Any] = ..., - requests_per_second: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def delete_filter( - self, - filter_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_forecast( - self, - job_id: Any, - *, - forecast_id: Optional[Any] = ..., - allow_no_forecasts: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def delete_job( - self, - job_id: Any, - *, - force: 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 delete_model_snapshot( - self, - job_id: Any, - snapshot_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 flush_job( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - advance_time: Optional[Any] = ..., - calc_interim: Optional[Any] = ..., - end: Optional[Any] = ..., - skip_time: Optional[Any] = ..., - start: 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 forecast( - self, - job_id: Any, - *, - duration: Optional[Any] = ..., - expires_in: Optional[Any] = ..., - max_model_memory: 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_buckets( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - timestamp: Optional[Any] = ..., - anomaly_score: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - expand: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_calendar_events( - self, - calendar_id: Any, - *, - end: Optional[Any] = ..., - from_: Optional[Any] = ..., - job_id: Optional[Any] = ..., - size: Optional[Any] = ..., - start: 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_calendars( - self, - *, - body: Optional[Any] = ..., - calendar_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] = ..., - http_auth: Optional[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_categories( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - category_id: Optional[Any] = ..., - from_: Optional[Any] = ..., - partition_field_value: 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_datafeed_stats( - self, - *, - datafeed_id: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: 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_datafeeds( - self, - *, - datafeed_id: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - exclude_generated: 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_filters( - self, - *, - filter_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] = ..., - http_auth: Optional[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_influencers( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - from_: Optional[Any] = ..., - influencer_score: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_job_stats( - self, - *, - job_id: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: 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_jobs( - self, - *, - job_id: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - exclude_generated: 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_model_snapshots( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - snapshot_id: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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_overall_buckets( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - allow_no_jobs: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - bucket_span: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - overall_score: Optional[Any] = ..., - start: Optional[Any] = ..., - top_n: 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_records( - self, - job_id: Any, - *, - body: Optional[Any] = ..., - desc: Optional[Any] = ..., - end: Optional[Any] = ..., - exclude_interim: Optional[Any] = ..., - from_: Optional[Any] = ..., - record_score: Optional[Any] = ..., - size: Optional[Any] = ..., - sort: Optional[Any] = ..., - start: 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 info( - 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 open_job( - self, - job_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 post_calendar_events( - self, - calendar_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: ... - def post_data( - self, - job_id: Any, - *, - body: Any, - reset_end: Optional[Any] = ..., - reset_start: 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_datafeed( - self, - *, - body: Optional[Any] = ..., - datafeed_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_calendar( - self, - calendar_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 put_calendar_job( - self, - calendar_id: Any, - job_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_datafeed( - self, - datafeed_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 put_filter( - self, - filter_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: ... - def put_job( - self, - job_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 revert_model_snapshot( - self, - job_id: Any, - snapshot_id: Any, - *, - body: Optional[Any] = ..., - delete_intervening_results: 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 set_upgrade_mode( - self, - *, - enabled: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def start_datafeed( - self, - datafeed_id: Any, - *, - body: Optional[Any] = ..., - end: Optional[Any] = ..., - start: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def stop_datafeed( - self, - datafeed_id: Any, - *, - body: Optional[Any] = ..., - allow_no_datafeeds: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def update_datafeed( - self, - datafeed_id: Any, - *, - body: Any, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_throttled: 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 update_filter( - self, - filter_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: ... - def update_job( - self, - job_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: ... - def update_model_snapshot( - self, - job_id: Any, - snapshot_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: ... - def validate( - 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 validate_detector( - 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_data_frame_analytics( - self, - id: Any, - *, - force: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def evaluate_data_frame( - 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_data_frame_analytics( - self, - *, - 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_data_frame_analytics_stats( - self, - *, - id: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - from_: Optional[Any] = ..., - size: Optional[Any] = ..., - verbose: 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_data_frame_analytics( - 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: ... - def start_data_frame_analytics( - self, - id: Any, - *, - body: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def stop_data_frame_analytics( - self, - id: Any, - *, - body: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - force: Optional[Any] = ..., - timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def delete_trained_model( - self, - model_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 explain_data_frame_analytics( - self, - *, - body: Optional[Any] = ..., - 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_trained_models( - self, - *, - model_id: Optional[Any] = ..., - allow_no_match: Optional[Any] = ..., - decompress_definition: Optional[Any] = ..., - exclude_generated: Optional[Any] = ..., - from_: Optional[Any] = ..., - include: Optional[Any] = ..., - include_model_definition: Optional[Any] = ..., - size: Optional[Any] = ..., - tags: 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_trained_models_stats( - self, - *, - model_id: Optional[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 put_trained_model( - self, - model_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: ... - def estimate_model_memory( - 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 update_data_frame_analytics( - 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: ... - def upgrade_job_snapshot( - self, - job_id: Any, - snapshot_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] = ..., - http_auth: Optional[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_trained_model_alias( - self, - model_id: Any, - model_alias: 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_data_frame_analytics( - self, - *, - body: Optional[Any] = ..., - 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_trained_model_alias( - self, - model_id: Any, - model_alias: Any, - *, - reassign: 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 find_file_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: ... - def reset_job( - self, - job_id: 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: ... diff --git a/elasticsearch/client/monitoring.py b/elasticsearch/client/monitoring.py deleted file mode 100644 index a1672b95..00000000 --- a/elasticsearch/client/monitoring.py +++ /dev/null @@ -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. - - ``_ - - .. 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, - ) diff --git a/elasticsearch/client/monitoring.pyi b/elasticsearch/client/monitoring.pyi deleted file mode 100644 index e626cd6d..00000000 --- a/elasticsearch/client/monitoring.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/searchable_snapshots.py b/elasticsearch/client/searchable_snapshots.py deleted file mode 100644 index 9feb72a5..00000000 --- a/elasticsearch/client/searchable_snapshots.py +++ /dev/null @@ -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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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, - ) diff --git a/elasticsearch/client/searchable_snapshots.pyi b/elasticsearch/client/searchable_snapshots.pyi deleted file mode 100644 index 5d1d91d0..00000000 --- a/elasticsearch/client/searchable_snapshots.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/security.py b/elasticsearch/client/security.py deleted file mode 100644 index 5cdac1b0..00000000 --- a/elasticsearch/client/security.py +++ /dev/null @@ -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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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. - - ``_ - - .. 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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/security.pyi b/elasticsearch/client/security.pyi deleted file mode 100644 index b30ee6a1..00000000 --- a/elasticsearch/client/security.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/shutdown.py b/elasticsearch/client/shutdown.py deleted file mode 100644 index aa131ed3..00000000 --- a/elasticsearch/client/shutdown.py +++ /dev/null @@ -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 - - ``_ - - .. 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 - - ``_ - - .. 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 - - ``_ - - .. 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, - ) diff --git a/elasticsearch/client/shutdown.pyi b/elasticsearch/client/shutdown.pyi deleted file mode 100644 index 4faefb4c..00000000 --- a/elasticsearch/client/shutdown.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/slm.py b/elasticsearch/client/slm.py deleted file mode 100644 index 521af0d9..00000000 --- a/elasticsearch/client/slm.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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). - - ``_ - """ - 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). - - ``_ - """ - 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). - - ``_ - """ - return self.transport.perform_request( - "POST", "/_slm/stop", params=params, headers=headers - ) diff --git a/elasticsearch/client/slm.pyi b/elasticsearch/client/slm.pyi deleted file mode 100644 index 2fcb700f..00000000 --- a/elasticsearch/client/slm.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/sql.py b/elasticsearch/client/sql.py deleted file mode 100644 index 514a1e79..00000000 --- a/elasticsearch/client/sql.py +++ /dev/null @@ -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 - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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. - - ``_ - - :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 - - ``_ - - :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 - - ``_ - - :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, - ) diff --git a/elasticsearch/client/sql.pyi b/elasticsearch/client/sql.pyi deleted file mode 100644 index 6c6711bd..00000000 --- a/elasticsearch/client/sql.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/ssl.py b/elasticsearch/client/ssl.py deleted file mode 100644 index 644b6043..00000000 --- a/elasticsearch/client/ssl.py +++ /dev/null @@ -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. - - ``_ - """ - return self.transport.perform_request( - "GET", "/_ssl/certificates", params=params, headers=headers - ) diff --git a/elasticsearch/client/ssl.pyi b/elasticsearch/client/ssl.pyi deleted file mode 100644 index 14f3774b..00000000 --- a/elasticsearch/client/ssl.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/text_structure.py b/elasticsearch/client/text_structure.py deleted file mode 100644 index c266bed8..00000000 --- a/elasticsearch/client/text_structure.py +++ /dev/null @@ -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. - - ``_ - - :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, - ) diff --git a/elasticsearch/client/text_structure.pyi b/elasticsearch/client/text_structure.pyi deleted file mode 100644 index 28ccff8f..00000000 --- a/elasticsearch/client/text_structure.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/transform.py b/elasticsearch/client/transform.py deleted file mode 100644 index 8fe3bf85..00000000 --- a/elasticsearch/client/transform.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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, - ) diff --git a/elasticsearch/client/transform.pyi b/elasticsearch/client/transform.pyi deleted file mode 100644 index fe686f86..00000000 --- a/elasticsearch/client/transform.pyi +++ /dev/null @@ -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: ... diff --git a/elasticsearch/client/watcher.py b/elasticsearch/client/watcher.py deleted file mode 100644 index 681f2b94..00000000 --- a/elasticsearch/client/watcher.py +++ /dev/null @@ -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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :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. - - ``_ - """ - 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. - - ``_ - - :arg body: From, size, query, sort and search_after - """ - return self.transport.perform_request( - "POST", - "/_watcher/_query/watches", - params=params, - headers=headers, - body=body, - ) diff --git a/elasticsearch/client/watcher.pyi b/elasticsearch/client/watcher.pyi deleted file mode 100644 index 6a9178ad..00000000 --- a/elasticsearch/client/watcher.pyi +++ /dev/null @@ -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: ...