Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def mark_dead(self, connection): # mark as dead even when sniffing to avoid hitting this host during the sniff process self.connection_pool.mark_dead(connection) if self.sniff_on_connection_fail: self.sniff_hosts()
[ "\n Mark a connection as dead (failed) in the connection pool. If sniffing\n on failure is enabled this will initiate the sniffing process.\n\n :arg connection: instance of :class:`~elasticsearch.Connection` that failed\n " ]
Please provide a description of the function:def perform_request(self, method, url, headers=None, params=None, body=None): if body is not None: body = self.serializer.dumps(body) # some clients or environments don't support sending GET with body if method in ('HEAD'...
[ "\n Perform the actual request. Retrieve a connection from the connection\n pool, pass all the information to it's perform_request method and\n return the data.\n\n If an exception was raised, mark the connection as failed and retry (up\n to `max_retries` times).\n\n If the...
Please provide a description of the function:def change_password(self, body, username=None, params=None): if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PUT", _make_path(...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html>`_\n\n :arg body: the new password for the user\n :arg username: The username of the user to change the password for\n :arg refresh: If `true` (the default) then refresh the affected s...
Please provide a description of the function:def clear_cached_realms(self, realms, params=None): if realms in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'realms'.") return self.transport.perform_request( "POST", _make_path("_se...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html>`_\n\n :arg realms: Comma-separated list of realms to clear\n :arg usernames: Comma-separated list of usernames to clear from the\n cache\n " ]
Please provide a description of the function:def clear_cached_roles(self, name, params=None): 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", na...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html>`_\n\n :arg name: Role name\n " ]
Please provide a description of the function:def create_api_key(self, body, params=None): 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, bo...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html>`_\n\n :arg body: The api key request to create an API key\n :arg refresh: If `true` (the default) then refresh the affected shards\n to make this operation visible to search, if `w...
Please provide a description of the function:def delete_privileges(self, application, name, params=None): 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...
[ "\n `<TODO>`_\n\n :arg application: Application name\n :arg name: Privilege name\n :arg refresh: If `true` (the default) then refresh the affected shards\n to make this operation visible to search, if `wait_for` then wait\n for a refresh to make this operation visib...
Please provide a description of the function:def delete_user(self, username, params=None): 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", "us...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html>`_\n\n :arg username: username\n :arg refresh: If `true` (the default) then refresh the affected shards\n to make this operation visible to search, if `wait_for` then wait\n ...
Please provide a description of the function:def get_privileges(self, application=None, name=None, params=None): return self.transport.perform_request( "GET", _make_path("_security", "privilege", application, name), params=params, )
[ "\n `<TODO>`_\n\n :arg application: Application name\n :arg name: Privilege name\n " ]
Please provide a description of the function:def get_role(self, name=None, params=None): return self.transport.perform_request( "GET", _make_path("_security", "role", name), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html>`_\n\n :arg name: Role name\n " ]
Please provide a description of the function:def get_role_mapping(self, name=None, params=None): return self.transport.perform_request( "GET", _make_path("_security", "role_mapping", name), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html>`_\n\n :arg name: Role-Mapping name\n " ]
Please provide a description of the function:def get_token(self, body, params=None): 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, b...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html>`_\n\n :arg body: The token request to get\n " ]
Please provide a description of the function:def get_user(self, username=None, params=None): return self.transport.perform_request( "GET", _make_path("_security", "user", username), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html>`_\n\n :arg username: A comma-separated list of usernames\n " ]
Please provide a description of the function:def has_privileges(self, body, user=None, params=None): if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "GET", _make_path("_sec...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html>`_\n\n :arg body: The privileges to test\n :arg user: Username\n " ]
Please provide a description of the function:def invalidate_api_key(self, body, params=None): 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=par...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html>`_\n\n :arg body: The api key request to invalidate API key(s)\n " ]
Please provide a description of the function:def invalidate_token(self, body, params=None): 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=...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_\n\n :arg body: The token to invalidate\n " ]
Please provide a description of the function:def put_privileges(self, body, params=None): 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,...
[ "\n `<TODO>`_\n\n :arg body: The privilege(s) to add\n :arg refresh: If `true` (the default) then refresh the affected shards\n to make this operation visible to search, if `wait_for` then wait\n for a refresh to make this operation visible to search, if `false`\n ...
Please provide a description of the function:def put_user(self, username, body, params=None): 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( "...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_\n\n :arg username: The username of the User\n :arg body: The user to add\n :arg refresh: If `true` (the default) then refresh the affected shards\n to make this operation visibl...
Please provide a description of the function:def delete_lifecycle(self, policy=None, params=None): return self.transport.perform_request( "DELETE", _make_path("_ilm", "policy", policy), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_\n\n :arg policy: The name of the index lifecycle policy\n " ]
Please provide a description of the function:def explain_lifecycle(self, index=None, params=None): return self.transport.perform_request( "GET", _make_path(index, "_ilm", "explain"), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_\n\n :arg index: The name of the index to explain\n " ]
Please provide a description of the function:def get_lifecycle(self, policy=None, params=None): return self.transport.perform_request( "GET", _make_path("_ilm", "policy", policy), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_\n\n :arg policy: The name of the index lifecycle policy\n " ]
Please provide a description of the function:def move_to_step(self, index=None, body=None, params=None): return self.transport.perform_request( "POST", _make_path("_ilm", "move", index), params=params, body=body )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_\n\n :arg index: The name of the index whose lifecycle step is to change\n :arg body: The new lifecycle step to move to\n " ]
Please provide a description of the function:def put_lifecycle(self, policy=None, body=None, params=None): return self.transport.perform_request( "PUT", _make_path("_ilm", "policy", policy), params=params, body=body )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_\n\n :arg policy: The name of the index lifecycle policy\n :arg body: The lifecycle policy definition to register\n " ]
Please provide a description of the function:def remove_policy(self, index=None, params=None): return self.transport.perform_request( "POST", _make_path(index, "_ilm", "remove"), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html>`_\n\n :arg index: The name of the index to remove policy on\n " ]
Please provide a description of the function:def retry(self, index=None, params=None): return self.transport.perform_request( "POST", _make_path(index, "_ilm", "retry"), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_\n\n :arg index: The name of the indices (comma-separated) whose failed\n lifecycle step is to be retry\n " ]
Please provide a description of the function:def post(self, body=None, params=None): return self.transport.perform_request( "PUT", "/_license", params=params, body=body )
[ "\n `<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_\n\n :arg body: licenses to be installed\n :arg acknowledge: whether the user has acknowledged acknowledge messages\n (default: false)\n " ]
Please provide a description of the function:def parse_commits(head, name): for commit in head.traverse(): yield { '_id': commit.hexsha, 'repository': name, 'committed_date': datetime.fromtimestamp(commit.committed_date), 'committer': { 'n...
[ "\n Go through the git repository log and generate a document per commit\n containing all the metadata.\n " ]
Please provide a description of the function:def load_repo(client, path=None, index='git'): path = dirname(dirname(abspath(__file__))) if path is None else path repo_name = basename(path) repo = git.Repo(path) create_git_index(client, index) # we let the streaming bulk continuously process th...
[ "\n Parse a git repository with all it's commits and load it into elasticsearch\n using `client`. If the index doesn't exist it will be created.\n " ]
Please provide a description of the function:def get_jobs(self, id=None, params=None): return self.transport.perform_request( "GET", _make_path("_rollup", "job", id), params=params )
[ "\n `<>`_\n\n :arg id: The ID of the job(s) to fetch. Accepts glob patterns, or left\n blank for all jobs\n " ]
Please provide a description of the function:def get_rollup_caps(self, id=None, params=None): return self.transport.perform_request( "GET", _make_path("_rollup", "data", id), params=params )
[ "\n `<>`_\n\n :arg id: The ID of the index to check rollup capabilities on, or left\n blank for all jobs\n " ]
Please provide a description of the function:def put_job(self, id, body, params=None): 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_p...
[ "\n `<>`_\n\n :arg id: The ID of the job to create\n :arg body: The job configuration\n " ]
Please provide a description of the function:def info(self, index=None, params=None): return self.transport.perform_request( "GET", _make_path(index, "_xpack", "migration", "deprecations"), params=params, )
[ "\n `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_\n\n :arg index: Index pattern\n " ]
Please provide a description of the function:def info(self, node_id=None, metric=None, params=None): return self.transport.perform_request( "GET", _make_path("_nodes", node_id, metric), params=params )
[ "\n The cluster nodes info API allows to retrieve one or more (or all) of\n the cluster nodes information.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_\n\n :arg node_id: A comma-separated list of node IDs or names to limit the\n ...
Please provide a description of the function:def stats(self, node_id=None, metric=None, index_metric=None, params=None): return self.transport.perform_request( "GET", _make_path("_nodes", node_id, "stats", metric, index_metric), params=params, )
[ "\n The cluster nodes stats API allows to retrieve one or more (or all) of\n the cluster nodes statistics.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_\n\n :arg node_id: A comma-separated list of node IDs or names to limit the\n ...
Please provide a description of the function:def hot_threads(self, node_id=None, params=None): # avoid python reserved words if params and "type_" in params: params["type"] = params.pop("type_") return self.transport.perform_request( "GET", _make_path("_cluster",...
[ "\n An API allowing to get the current hot threads on each node in the cluster.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_\n\n :arg node_id: A comma-separated list of node IDs or names to limit the\n returned information; use...
Please provide a description of the function:def usage(self, node_id=None, metric=None, params=None): return self.transport.perform_request( "GET", _make_path("_nodes", node_id, "usage", metric), params=params )
[ "\n The cluster nodes usage API allows to retrieve information on the usage\n of features for each node.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_\n\n :arg node_id: A comma-separated list of node IDs or names to limit the\n r...
Please provide a description of the function:def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer): bulk_actions, bulk_data = [], [] size, action_count = 0, 0 for action, data in actions: raw_data, raw_action = data, action action = serializer.dumps(action) # +1 t...
[ "\n Split actions into chunks by number or size, serialize them into strings in\n the process.\n " ]
Please provide a description of the function:def _process_bulk_chunk( client, bulk_actions, bulk_data, raise_on_exception=True, raise_on_error=True, *args, **kwargs ): # if raise on error is set, we need to collect errors per chunk before raising them errors = [] try: ...
[ "\n Send a bulk request to elasticsearch and process the output.\n " ]
Please provide a description of the function:def streaming_bulk( client, actions, chunk_size=500, max_chunk_bytes=100 * 1024 * 1024, raise_on_error=True, expand_action_callback=expand_action, raise_on_exception=True, max_retries=0, initial_backoff=2, max_backoff=600, yield_ok...
[ "\n Streaming bulk consumes actions from the iterable passed in and yields\n results per action. For non-streaming usecases use\n :func:`~elasticsearch.helpers.bulk` which is a wrapper around streaming\n bulk that returns summary information about the bulk operation once the\n entire input is consume...
Please provide a description of the function:def parallel_bulk( client, actions, thread_count=4, chunk_size=500, max_chunk_bytes=100 * 1024 * 1024, queue_size=4, expand_action_callback=expand_action, *args, **kwargs ): # Avoid importing multiprocessing unless parallel_bulk i...
[ "\n Parallel version of the bulk helper run in multiple threads at once.\n\n :arg client: instance of :class:`~elasticsearch.Elasticsearch` to use\n :arg actions: iterator containing the actions\n :arg thread_count: size of the threadpool to use for the bulk requests\n :arg chunk_size: number of docs...
Please provide a description of the function:def scan( client, query=None, scroll="5m", raise_on_error=True, preserve_order=False, size=1000, request_timeout=None, clear_scroll=True, scroll_kwargs=None, **kwargs ): scroll_kwargs = scroll_kwargs or {} if not preserve...
[ "\n Simple abstraction on top of the\n :meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that\n yields all hits as returned by underlining scroll requests.\n\n By default scan does not return results in any pre-determined order. To\n have a standard order in the returned documents (...
Please provide a description of the function:def reindex( client, source_index, target_index, query=None, target_client=None, chunk_size=500, scroll="5m", scan_kwargs={}, bulk_kwargs={}, ): target_client = client if target_client is None else target_client docs = scan(c...
[ "\n Reindex all documents from one index that satisfy a given query\n to another, potentially (if `target_client` is specified) on a different cluster.\n If you don't specify the query you will reindex all the documents.\n\n Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is\n availa...
Please provide a description of the function:def get_data_frame_transform(self, transform_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_data_frame", "transforms", transform_id), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_\n\n :arg transform_id: The id or comma delimited list of id expressions of\n the transforms to get, '_all' or '*' implies get all transforms\n :arg from_: skips a number of transfor...
Please provide a description of the function:def get_data_frame_transform_stats(self, transform_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_data_frame", "transforms", transform_id, "_stats"), params=params, )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_\n\n :arg transform_id: The id of the transform for which to get stats.\n '_all' or '*' implies all transforms\n " ]
Please provide a description of the function:def preview_data_frame_transform(self, body, params=None): 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...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_\n\n :arg body: The definition for the data_frame transform to preview\n " ]
Please provide a description of the function:def put_data_frame_transform(self, transform_id, body, params=None): for param in (transform_id, body): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") return self.transport.perfor...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_\n\n :arg transform_id: The id of the new transform.\n :arg body: The data frame transform definition\n " ]
Please provide a description of the function:def stop_data_frame_transform(self, transform_id, params=None): if transform_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required argument 'transform_id'." ) return self.transport.perform_re...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_\n\n :arg transform_id: The id of the transform to stop\n :arg timeout: Controls the time to wait until the transform has stopped.\n Default to 30 seconds\n :arg wait_for_com...
Please provide a description of the function:def allocation(self, node_id=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'allocation', node_id), params=params)
[ "\n Allocation provides a snapshot of how shards have located around the\n cluster and the state of disk usage.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_\n\n :arg node_id: A comma-separated list of node IDs or names to limit the\n ...
Please provide a description of the function:def count(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'count', index), params=params)
[ "\n Count provides quick access to the document count of the entire cluster,\n or individual indices.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_\n\n :arg index: A comma-separated list of index names to limit the returned\n information...
Please provide a description of the function:def indices(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'indices', index), params=params)
[ "\n The indices command provides a cross-section of each index.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_\n\n :arg index: A comma-separated list of index names to limit the returned\n information\n :arg bytes: The unit in which to ...
Please provide a description of the function:def recovery(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'recovery', index), params=params)
[ "\n recovery is a view of shard replication.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_\n\n :arg index: A comma-separated list of index names to limit the returned\n information\n :arg bytes: The unit in which to display byte value...
Please provide a description of the function:def shards(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'shards', index), params=params)
[ "\n The shards command is the detailed view of what nodes contain which shards.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_\n\n :arg index: A comma-separated list of index names to limit the returned\n information\n :arg bytes: The un...
Please provide a description of the function:def segments(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'segments', index), params=params)
[ "\n The segments command is the detailed view of Lucene segments per index.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_\n\n :arg index: A comma-separated list of index names to limit the returned\n information\n :arg bytes: The unit...
Please provide a description of the function:def thread_pool(self, thread_pool_patterns=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'thread_pool', thread_pool_patterns), params=params)
[ "\n Get information about thread pools.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_\n\n :arg thread_pool_patterns: A comma-separated list of regular-expressions\n to filter the thread pools in the output\n :arg format: a short ve...
Please provide a description of the function:def fielddata(self, fields=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'fielddata', fields), params=params)
[ "\n Shows information about currently loaded fielddata on a per-node basis.\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_\n\n :arg fields: A comma-separated list of fields to return the fielddata\n size\n :arg bytes: The unit in whic...
Please provide a description of the function:def templates(self, name=None, params=None): return self.transport.perform_request('GET', _make_path('_cat', 'templates', name), params=params)
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_\n\n :arg name: A pattern that returned template names must match\n :arg format: a short version of the Accept header, e.g. json, yaml\n :arg h: Comma-separated list of column names to display\n ...
Please provide a description of the function:def ack_watch(self, watch_id, action_id=None, params=None): if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'watch_id'.") return self.transport.perform_request( "PUT", _mak...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_\n\n :arg watch_id: Watch ID\n :arg action_id: A comma-separated list of the action ids to be acked\n " ]
Please provide a description of the function:def activate_watch(self, watch_id, params=None): 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", "wat...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_\n\n :arg watch_id: Watch ID\n " ]
Please provide a description of the function:def delete_watch(self, id, params=None): 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=...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_\n\n :arg id: Watch ID\n " ]
Please provide a description of the function:def execute_watch(self, id=None, body=None, params=None): return self.transport.perform_request( "PUT", _make_path("_watcher", "watch", id, "_execute"), params=params, body=body, )
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_\n\n :arg id: Watch ID\n :arg body: Execution control\n :arg debug: indicates whether the watch should execute in debug mode\n " ]
Please provide a description of the function:def put_watch(self, id, body=None, params=None): 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), pa...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_\n\n :arg id: Watch ID\n :arg body: The watch\n :arg active: Specify whether the watch is in/active by default\n :arg if_primary_term: only update the watch if the last operation that...
Please provide a description of the function:def health(self, index=None, params=None): return self.transport.perform_request('GET', _make_path('_cluster', 'health', index), params=params)
[ "\n Get a very simple status on the health of the cluster.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_\n\n :arg index: Limit the information returned to a specific index\n :arg level: Specify the level of detail for returned information,\n ...
Please provide a description of the function:def state(self, metric=None, index=None, params=None): if index and not metric: metric = '_all' return self.transport.perform_request('GET', _make_path('_cluster', 'state', metric, index), params=params)
[ "\n Get a comprehensive state information of the whole cluster.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_\n\n :arg metric: Limit the information returned to the specified metrics\n :arg index: A comma-separated list of index names; use `_all...
Please provide a description of the function:def stats(self, node_id=None, params=None): url = '/_cluster/stats' if node_id: url = _make_path('_cluster/stats/nodes', node_id) return self.transport.perform_request('GET', url, params=params)
[ "\n The Cluster Stats API allows to retrieve statistics from a cluster wide\n perspective. The API returns basic index metrics and information about\n the current nodes that form the cluster.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_\n\n ...
Please provide a description of the function:def reroute(self, body=None, params=None): return self.transport.perform_request('POST', '/_cluster/reroute', params=params, body=body)
[ "\n Explicitly execute a cluster reroute allocation command including specific commands.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_\n\n :arg body: The definition of `commands` to perform (`move`, `cancel`,\n `allocate`)\n :arg dr...
Please provide a description of the function:def put_settings(self, body=None, params=None): return self.transport.perform_request('PUT', '/_cluster/settings', params=params, body=body)
[ "\n Update cluster wide specific settings.\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_\n\n :arg body: The settings to be updated. Can be either `transient` or\n `persistent` (survives cluster restart).\n :arg flat_settings...
Please provide a description of the function:def allocation_explain(self, body=None, params=None): return self.transport.perform_request('GET', '/_cluster/allocation/explain', params=params, body=body)
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_\n\n :arg body: The index, shard, and primary flag to explain. Empty means\n 'explain the first unassigned shard'\n :arg include_disk_info: Return information about disk usage and s...
Please provide a description of the function:def deprecations(self, index=None, params=None): return self.transport.perform_request( "GET", _make_path(index, "_migration", "deprecations"), params=params )
[ "\n `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_\n\n :arg index: Index pattern\n " ]
Please provide a description of the function:def get_connection(self): self.resurrect() connections = self.connections[:] # no live nodes, resurrect one by force and return it if not connections: return self.resurrect(True) # only call selector if we have a...
[ "\n Return a connection from the pool using the `ConnectionSelector`\n instance.\n\n It tries to resurrect eligible connections, forces a resurrection when\n no connections are availible and passes the list of live connections to\n the selector instance to choose from.\n\n ...
Please provide a description of the function:def follow(self, index, body, params=None): 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", _m...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_\n\n :arg index: The name of the follower index\n :arg body: The name of the leader index and other optional ccr related\n parameters\n :arg wait_for_active_shards: Sets the number of s...
Please provide a description of the function:def follow_info(self, index=None, params=None): return self.transport.perform_request( "GET", _make_path(index, "_ccr", "info"), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_\n\n :arg index: A comma-separated list of index patterns; use `_all` to\n perform the operation on all indices\n " ]
Please provide a description of the function:def follow_stats(self, index, params=None): 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"), pa...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_\n\n :arg index: A comma-separated list of index patterns; use `_all` to\n perform the operation on all indices\n " ]
Please provide a description of the function:def get_auto_follow_pattern(self, name=None, params=None): return self.transport.perform_request( "GET", _make_path("_ccr", "auto_follow", name), params=params )
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_\n\n :arg name: The name of the auto follow pattern.\n " ]
Please provide a description of the function:def put_auto_follow_pattern(self, name, body, params=None): 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( ...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_\n\n :arg name: The name of the auto follow pattern.\n :arg body: The specification of the auto follow pattern\n " ]
Please provide a description of the function:def resume_follow(self, index, body=None, params=None): 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",...
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_\n\n :arg index: The name of the follow index to resume following.\n :arg body: The name of the leader index and other optional ccr related\n parameters\n " ]
Please provide a description of the function:def get_pipeline(self, id=None, params=None): return self.transport.perform_request('GET', _make_path('_ingest', 'pipeline', id), params=params)
[ "\n `<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_\n\n :arg id: Comma separated list of pipeline ids. Wildcards supported\n :arg master_timeout: Explicit operation timeout for connection to master\n node\n " ]
Please provide a description of the function:def delete_calendar_event(self, calendar_id, event_id, params=None): 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.per...
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar to modify\n :arg event_id: The ID of the event to remove from the calendar\n " ]
Please provide a description of the function:def delete_filter(self, filter_id, params=None): 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", "fil...
[ "\n `<>`_\n\n :arg filter_id: The ID of the filter to delete\n " ]
Please provide a description of the function:def delete_forecast(self, job_id, forecast_id=None, params=None): if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") return self.transport.perform_request( "DELETE", ...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_\n\n :arg job_id: The ID of the job from which to delete forecasts\n :arg forecast_id: The ID of the forecast to delete, can be comma\n delimited list. Leaving blank implies `_all`\n ...
Please provide a description of the function:def delete_job(self, job_id, params=None): 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_detecto...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_\n\n :arg job_id: The ID of the job to delete\n :arg force: True if the job should be forcefully deleted, default False\n :arg wait_for_completion: Should this request wait until the operation\n ...
Please provide a description of the function:def delete_model_snapshot(self, job_id, snapshot_id, params=None): 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...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_\n\n :arg job_id: The ID of the job to fetch\n :arg snapshot_id: The ID of the snapshot to delete\n " ]
Please provide a description of the function:def find_file_structure(self, body, params=None): if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "POST", "/_ml/find_file_struc...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_\n\n :arg body: The contents of the file to be analyzed\n :arg charset: Optional parameter to specify the character set of the\n file\n :arg column_names: Optional parameter containin...
Please provide a description of the function:def flush_job(self, job_id, body=None, params=None): 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("_m...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_\n\n :arg job_id: The name of the job to flush\n :arg body: Flush parameters\n :arg advance_time: Advances time to the given value generating results\n and updating the model for the advan...
Please provide a description of the function:def get_buckets(self, job_id, timestamp=None, body=None, params=None): if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") return self.transport.perform_request( "GET", ...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_\n\n :arg job_id: ID of the job to get bucket results from\n :arg timestamp: The timestamp of the desired single bucket result\n :arg body: Bucket selection details if not provided in URI\n :...
Please provide a description of the function:def get_calendar_events(self, calendar_id, params=None): if calendar_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required argument 'calendar_id'." ) return self.transport.perform_request( ...
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar containing the events\n :arg end: Get events before this time\n :arg from_: Skips a number of events\n :arg job_id: Get events for the job. When this option is used\n calendar_id must be '_all'\n :arg size: S...
Please provide a description of the function:def get_calendars(self, calendar_id=None, body=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "calendars", calendar_id), params=params, body=body )
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar to fetch\n :arg body: The from and size parameters optionally sent in the body\n :arg from_: skips a number of calendars\n :arg size: specifies a max number of calendars to get\n " ]
Please provide a description of the function:def get_categories(self, job_id, category_id=None, body=None, params=None): if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") return self.transport.perform_request( "GET", ...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_\n\n :arg job_id: The name of the job\n :arg category_id: The identifier of the category definition of interest\n :arg body: Category selection details if not provided in URI\n :arg from_: ...
Please provide a description of the function:def get_datafeed_stats(self, datafeed_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "datafeeds", datafeed_id, "_stats"), params=params )
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_\n\n :arg datafeed_id: The ID of the datafeeds stats to fetch\n :arg allow_no_datafeeds: Whether to ignore if a wildcard expression\n matches no datafeeds. (This includes `_all` string o...
Please provide a description of the function:def get_datafeeds(self, datafeed_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "datafeeds", datafeed_id), params=params )
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_\n\n :arg datafeed_id: The ID of the datafeeds to fetch\n :arg allow_no_datafeeds: Whether to ignore if a wildcard expression\n matches no datafeeds. (This includes `_all` string or when no\n ...
Please provide a description of the function:def get_filters(self, filter_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "filters", filter_id), params=params )
[ "\n `<>`_\n\n :arg filter_id: The ID of the filter to fetch\n :arg from_: skips a number of filters\n :arg size: specifies a max number of filters to get\n " ]
Please provide a description of the function:def get_job_stats(self, job_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "anomaly_detectors", job_id, "_stats"), params=params, )
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_\n\n :arg job_id: The ID of the jobs stats to fetch\n :arg allow_no_jobs: Whether to ignore if a wildcard expression matches\n no jobs. (This includes `_all` string or when no jobs have been\...
Please provide a description of the function:def get_jobs(self, job_id=None, params=None): return self.transport.perform_request( "GET", _make_path("_ml", "anomaly_detectors", job_id), params=params )
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_\n\n :arg job_id: The ID of the jobs to fetch\n :arg allow_no_jobs: Whether to ignore if a wildcard expression matches\n no jobs. (This includes `_all` string or when no jobs have been\n ...
Please provide a description of the function:def get_model_snapshots(self, job_id, snapshot_id=None, body=None, params=None): if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") return self.transport.perform_request( "GET",...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_\n\n :arg job_id: The ID of the job to fetch\n :arg snapshot_id: The ID of the snapshot to fetch\n :arg body: Model snapshot selection criteria\n :arg desc: True if the results should be so...
Please provide a description of the function:def post_calendar_events(self, calendar_id, body, params=None): 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_requ...
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar to modify\n :arg body: A list of events\n " ]
Please provide a description of the function:def post_data(self, job_id, body, params=None): 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( "POS...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_\n\n :arg job_id: The name of the job receiving the data\n :arg body: The data to process\n :arg reset_end: Optional parameter to specify the end of the bucket\n resetting range\n :...
Please provide a description of the function:def preview_datafeed(self, datafeed_id, params=None): if datafeed_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required argument 'datafeed_id'." ) return self.transport.perform_request( ...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_\n\n :arg datafeed_id: The ID of the datafeed to preview\n " ]
Please provide a description of the function:def put_calendar(self, calendar_id, body=None, params=None): if calendar_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required argument 'calendar_id'." ) return self.transport.perform_request...
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar to create\n :arg body: The calendar details\n " ]
Please provide a description of the function:def put_calendar_job(self, calendar_id, job_id, params=None): 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_requ...
[ "\n `<>`_\n\n :arg calendar_id: The ID of the calendar to modify\n :arg job_id: The ID of the job to add to the calendar\n " ]
Please provide a description of the function:def start_datafeed(self, datafeed_id, body=None, params=None): if datafeed_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required argument 'datafeed_id'." ) return self.transport.perform_reque...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_\n\n :arg datafeed_id: The ID of the datafeed to start\n :arg body: The start datafeed parameters\n :arg end: The end time when the datafeed should stop. When not set, the\n datafeed ...
Please provide a description of the function:def update_datafeed(self, datafeed_id, body, params=None): 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( ...
[ "\n `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_\n\n :arg datafeed_id: The ID of the datafeed to update\n :arg body: The datafeed update settings\n " ]