From 8e1798cf31d06b0f2750d947eca240bd4ac6d5a7 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Thu, 23 Apr 2020 11:22:08 -0500 Subject: [PATCH] Apply license header changes and API gen --- docs/conf.py | 24 ++-- elasticsearch/__init__.py | 4 + elasticsearch/client/__init__.py | 76 +++++------ elasticsearch/client/async_search.py | 10 +- elasticsearch/client/autoscaling.py | 12 +- elasticsearch/client/cat.py | 54 ++++---- elasticsearch/client/ccr.py | 30 +++-- elasticsearch/client/cluster.py | 22 ++-- elasticsearch/client/data_frame.py | 4 + elasticsearch/client/deprecation.py | 4 + elasticsearch/client/enrich.py | 14 ++- elasticsearch/client/eql.py | 6 +- elasticsearch/client/graph.py | 6 +- elasticsearch/client/ilm.py | 24 ++-- elasticsearch/client/indices.py | 100 ++++++++------- elasticsearch/client/ingest.py | 14 ++- elasticsearch/client/license.py | 18 +-- elasticsearch/client/migration.py | 6 +- elasticsearch/client/ml.py | 118 +++++++++--------- elasticsearch/client/monitoring.py | 6 +- elasticsearch/client/nodes.py | 14 ++- elasticsearch/client/remote.py | 4 + elasticsearch/client/rollup.py | 20 +-- elasticsearch/client/searchable_snapshots.py | 10 +- elasticsearch/client/security.py | 56 +++++---- elasticsearch/client/slm.py | 22 ++-- elasticsearch/client/snapshot.py | 24 ++-- elasticsearch/client/sql.py | 10 +- elasticsearch/client/ssl.py | 6 +- elasticsearch/client/tasks.py | 10 +- elasticsearch/client/transform.py | 20 +-- elasticsearch/client/utils.py | 4 + elasticsearch/client/watcher.py | 24 ++-- elasticsearch/client/xpack.py | 8 +- elasticsearch/compat.py | 4 + elasticsearch/connection/__init__.py | 4 + elasticsearch/connection/base.py | 4 + elasticsearch/connection/http_requests.py | 4 + elasticsearch/connection/http_urllib3.py | 4 + elasticsearch/connection/pooling.py | 4 + elasticsearch/connection_pool.py | 4 + elasticsearch/exceptions.py | 4 + elasticsearch/helpers/__init__.py | 4 + elasticsearch/helpers/actions.py | 4 + elasticsearch/helpers/errors.py | 4 + elasticsearch/helpers/test.py | 4 + elasticsearch/serializer.py | 4 + elasticsearch/transport.py | 4 + setup.py | 5 +- test_elasticsearch/__init__.py | 3 + test_elasticsearch/run_tests.py | 4 + test_elasticsearch/test_cases.py | 4 + test_elasticsearch/test_client/__init__.py | 4 + .../test_client/test_cluster.py | 4 + .../test_client/test_indices.py | 4 + test_elasticsearch/test_client/test_utils.py | 4 + test_elasticsearch/test_connection.py | 9 +- test_elasticsearch/test_connection_pool.py | 4 + test_elasticsearch/test_exceptions.py | 4 + test_elasticsearch/test_helpers.py | 4 + test_elasticsearch/test_serializer.py | 4 + test_elasticsearch/test_server/__init__.py | 4 + .../test_server/test_clients.py | 4 + test_elasticsearch/test_server/test_common.py | 4 + .../test_server/test_helpers.py | 4 + test_elasticsearch/test_transport.py | 4 + utils/generate_api.py | 5 +- 67 files changed, 585 insertions(+), 337 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4d349c82..8ed0572a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,18 +1,11 @@ # -*- coding: utf-8 -*- -# -# Elasticsearch documentation build configuration file, created by -# sphinx-quickstart on Mon May 6 15:38:41 2013. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information import os import datetime +import elasticsearch # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -49,9 +42,6 @@ copyright = u"%d, Elasticsearch B.V" % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# - -import elasticsearch # The short X.Y version. version = elasticsearch.__versionstr__ @@ -191,11 +181,11 @@ htmlhelp_basename = "Elasticsearchdoc" latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/elasticsearch/__init__.py b/elasticsearch/__init__.py index 2cc5b403..8d1eff83 100644 --- a/elasticsearch/__init__.py +++ b/elasticsearch/__init__.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + # flake8: noqa from __future__ import absolute_import diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 1463da91..9d581ab8 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals import logging @@ -281,7 +285,7 @@ class Elasticsearch(object): def ping(self, params=None, headers=None): """ Returns whether the cluster is running. - ``_ + ``_ """ try: return self.transport.perform_request( @@ -294,7 +298,7 @@ class Elasticsearch(object): def info(self, params=None, headers=None): """ Returns basic information about the cluster. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/", params=params, headers=headers @@ -314,7 +318,7 @@ class Elasticsearch(object): """ Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ + ``_ :arg index: The name of the index :arg id: Document ID @@ -370,7 +374,7 @@ class Elasticsearch(object): def index(self, index, body, doc_type=None, id=None, params=None, headers=None): """ Creates or updates a document in an index. - ``_ + ``_ :arg index: The name of the index :arg body: The document @@ -433,7 +437,7 @@ class Elasticsearch(object): def bulk(self, body, index=None, doc_type=None, params=None, headers=None): """ Allows to perform multiple index/update/delete operations in a single request. - ``_ + ``_ :arg body: The operation definition and data (action-data pairs), separated by newlines @@ -479,7 +483,7 @@ class Elasticsearch(object): def clear_scroll(self, body=None, scroll_id=None, params=None, headers=None): """ Explicitly clears the search context for a scroll. - ``_ + ``_ :arg body: A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter @@ -515,7 +519,7 @@ class Elasticsearch(object): def count(self, body=None, index=None, doc_type=None, params=None, headers=None): """ Returns number of documents matching a query. - ``_ + ``_ :arg body: A query to restrict the results specified with the Query DSL (optional) @@ -572,7 +576,7 @@ class Elasticsearch(object): def delete(self, index, id, doc_type=None, params=None, headers=None): """ Removes a document from the index. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -647,7 +651,7 @@ class Elasticsearch(object): def delete_by_query(self, index, body, doc_type=None, params=None, headers=None): """ Deletes documents matching the provided query. - ``_ + ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -743,7 +747,7 @@ class Elasticsearch(object): """ Changes the number of requests per second for a particular Delete By Query operation. - ``_ + ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -763,7 +767,7 @@ class Elasticsearch(object): def delete_script(self, id, params=None, headers=None): """ Deletes a script. - ``_ + ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -791,7 +795,7 @@ class Elasticsearch(object): def exists(self, index, id, doc_type=None, params=None, headers=None): """ Returns information about whether a document exists in an index. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -841,7 +845,7 @@ class Elasticsearch(object): def exists_source(self, index, id, doc_type=None, params=None, headers=None): """ Returns information about whether a document source exists in an index. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -892,7 +896,7 @@ class Elasticsearch(object): def explain(self, index, id, body=None, doc_type=None, params=None, headers=None): """ Returns information about why a specific matches (or doesn't match) a query. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -946,7 +950,7 @@ class Elasticsearch(object): """ Returns the information about the capabilities of fields among multiple indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -981,7 +985,7 @@ class Elasticsearch(object): def get(self, index, id, doc_type=None, params=None, headers=None): """ Returns a document. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -1021,7 +1025,7 @@ class Elasticsearch(object): def get_script(self, id, params=None, headers=None): """ Returns a script. - ``_ + ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -1047,7 +1051,7 @@ class Elasticsearch(object): def get_source(self, index, id, doc_type=None, params=None, headers=None): """ Returns the source of a document. - ``_ + ``_ :arg index: The name of the index :arg id: The document ID @@ -1097,7 +1101,7 @@ class Elasticsearch(object): def mget(self, body, index=None, doc_type=None, params=None, headers=None): """ Allows to get multiple documents in one request. - ``_ + ``_ :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is @@ -1143,7 +1147,7 @@ class Elasticsearch(object): def msearch(self, body, index=None, doc_type=None, params=None, headers=None): """ Allows to execute several search operations in one request. - ``_ + ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1199,7 +1203,7 @@ class Elasticsearch(object): ): """ Allows to execute several search template operations in one request. - ``_ + ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1251,7 +1255,7 @@ class Elasticsearch(object): ): """ Returns multiple termvectors in one request. - ``_ + ``_ :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of @@ -1302,7 +1306,7 @@ class Elasticsearch(object): def put_script(self, id, body, context=None, params=None, headers=None): """ Creates or updates a script. - ``_ + ``_ :arg id: Script ID :arg body: The document @@ -1329,7 +1333,7 @@ class Elasticsearch(object): """ Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ + ``_ :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. @@ -1372,7 +1376,7 @@ class Elasticsearch(object): Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ + ``_ :arg body: The search definition using the Query DSL and the prototype for the index request. @@ -1407,7 +1411,7 @@ class Elasticsearch(object): def reindex_rethrottle(self, task_id, params=None, headers=None): """ Changes the number of requests per second for a particular Reindex operation. - ``_ + ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -1427,7 +1431,7 @@ class Elasticsearch(object): def render_search_template(self, body=None, id=None, params=None, headers=None): """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :arg body: The search definition template and its params :arg id: The id of the stored search template @@ -1460,7 +1464,7 @@ class Elasticsearch(object): def scroll(self, body=None, scroll_id=None, params=None, headers=None): """ Allows to retrieve a large numbers of results from a single search request. - ``_ + ``_ :arg body: The scroll ID if not passed by URL or query parameter. @@ -1528,7 +1532,7 @@ class Elasticsearch(object): def search(self, body=None, index=None, doc_type=None, params=None, headers=None): """ Returns results matching a query. - ``_ + ``_ :arg body: The search definition using the Query DSL :arg index: A comma-separated list of index names to search; use @@ -1650,7 +1654,7 @@ class Elasticsearch(object): """ Returns information about the indices and shards that a search request would be executed against. - ``_ + ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1692,7 +1696,7 @@ class Elasticsearch(object): ): """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :arg body: The search definition template and its params :arg index: A comma-separated list of index names to search; use @@ -1758,7 +1762,7 @@ class Elasticsearch(object): """ Returns information and statistics about terms in the fields of a particular document. - ``_ + ``_ :arg index: The index in which the document resides. :arg body: Define parameters and or supply a document to get @@ -1818,7 +1822,7 @@ class Elasticsearch(object): def update(self, index, id, body, doc_type=None, params=None, headers=None): """ Updates a document with a script or partial document. - ``_ + ``_ :arg index: The name of the index :arg id: Document ID @@ -1912,7 +1916,7 @@ class Elasticsearch(object): """ Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - ``_ + ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2011,7 +2015,7 @@ class Elasticsearch(object): """ Changes the number of requests per second for a particular Update By Query operation. - ``_ + ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -2041,7 +2045,7 @@ class Elasticsearch(object): def get_script_languages(self, params=None, headers=None): """ Returns available script types, languages and contexts - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers diff --git a/elasticsearch/client/async_search.py b/elasticsearch/client/async_search.py index 1c9bd472..d4cabb4b 100644 --- a/elasticsearch/client/async_search.py +++ b/elasticsearch/client/async_search.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, SKIP_IN_PATH, query_params, _make_path @@ -7,7 +11,7 @@ class AsyncSearchClient(NamespacedClient): """ 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 """ @@ -23,7 +27,7 @@ class AsyncSearchClient(NamespacedClient): """ 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 @@ -86,7 +90,7 @@ class AsyncSearchClient(NamespacedClient): 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 diff --git a/elasticsearch/client/autoscaling.py b/elasticsearch/client/autoscaling.py index cff6f74a..b073f43f 100644 --- a/elasticsearch/client/autoscaling.py +++ b/elasticsearch/client/autoscaling.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, SKIP_IN_PATH, _make_path @@ -7,7 +11,7 @@ class AutoscalingClient(NamespacedClient): """ Gets the current autoscaling decision based on the configured autoscaling policy, indicating whether or not autoscaling is needed. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_autoscaling/decision", params=params, headers=headers @@ -16,7 +20,7 @@ class AutoscalingClient(NamespacedClient): @query_params() def delete_autoscaling_policy(self, name, params=None, headers=None): """ - ``_ + ``_ :arg name: the name of the autoscaling policy """ @@ -33,7 +37,7 @@ class AutoscalingClient(NamespacedClient): @query_params() def get_autoscaling_policy(self, name, params=None, headers=None): """ - ``_ + ``_ :arg name: the name of the autoscaling policy """ @@ -50,7 +54,7 @@ class AutoscalingClient(NamespacedClient): @query_params() def put_autoscaling_policy(self, name, body, params=None, headers=None): """ - ``_ + ``_ :arg name: the name of the autoscaling policy :arg body: the specification of the autoscaling policy diff --git a/elasticsearch/client/cat.py b/elasticsearch/client/cat.py index 5a344766..ddbc3c8e 100644 --- a/elasticsearch/client/cat.py +++ b/elasticsearch/client/cat.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path @@ -7,7 +11,7 @@ class CatClient(NamespacedClient): """ Shows information about currently configured aliases to indices including filter and routing infos. - ``_ + ``_ :arg name: A comma-separated list of alias names to return :arg expand_wildcards: Whether to expand wildcard expression to @@ -32,7 +36,7 @@ class CatClient(NamespacedClient): """ Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information @@ -62,7 +66,7 @@ class CatClient(NamespacedClient): """ Provides quick access to the document count of the entire cluster, or individual indices. - ``_ + ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -82,7 +86,7 @@ class CatClient(NamespacedClient): def health(self, params=None, headers=None): """ Returns a concise representation of the cluster health. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -103,7 +107,7 @@ class CatClient(NamespacedClient): def help(self, params=None, headers=None): """ Returns help for the Cat APIs. - ``_ + ``_ :arg help: Return help information :arg s: Comma-separated list of column names or column aliases @@ -132,7 +136,7 @@ class CatClient(NamespacedClient): """ Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ + ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -170,7 +174,7 @@ class CatClient(NamespacedClient): def master(self, params=None, headers=None): """ Returns information about the master node. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -203,7 +207,7 @@ class CatClient(NamespacedClient): def nodes(self, params=None, headers=None): """ Returns basic statistics about performance of cluster nodes. - ``_ + ``_ :arg bytes: The unit in which to display byte values Valid choices: b, k, kb, m, mb, g, gb, t, tb, p, pb @@ -233,7 +237,7 @@ class CatClient(NamespacedClient): def recovery(self, index=None, params=None, headers=None): """ Returns information about index shard recoveries, both on-going completed. - ``_ + ``_ :arg index: Comma-separated list or wildcard expression of index names to limit the returned information @@ -263,7 +267,7 @@ class CatClient(NamespacedClient): def shards(self, index=None, params=None, headers=None): """ Provides a detailed view of shard allocation on nodes. - ``_ + ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -291,7 +295,7 @@ class CatClient(NamespacedClient): def segments(self, index=None, params=None, headers=None): """ Provides low-level information about the segments in the shards of an index. - ``_ + ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -313,7 +317,7 @@ class CatClient(NamespacedClient): def pending_tasks(self, params=None, headers=None): """ Returns a concise representation of the cluster pending tasks. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -338,7 +342,7 @@ class CatClient(NamespacedClient): """ Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ + ``_ :arg thread_pool_patterns: A comma-separated list of regular- expressions to filter the thread pools in the output @@ -368,7 +372,7 @@ class CatClient(NamespacedClient): """ Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ + ``_ :arg fields: A comma-separated list of fields to return in the output @@ -393,7 +397,7 @@ class CatClient(NamespacedClient): def plugins(self, params=None, headers=None): """ Returns information about installed plugins across nodes node. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -415,7 +419,7 @@ class CatClient(NamespacedClient): def nodeattrs(self, params=None, headers=None): """ Returns information about custom node attributes. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -437,7 +441,7 @@ class CatClient(NamespacedClient): def repositories(self, params=None, headers=None): """ Returns information about snapshot repositories registered in the cluster. - ``_ + ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -461,7 +465,7 @@ class CatClient(NamespacedClient): def snapshots(self, repository=None, params=None, headers=None): """ Returns all snapshots in a specific repository. - ``_ + ``_ :arg repository: Name of repository from which to fetch the snapshot information @@ -502,7 +506,7 @@ class CatClient(NamespacedClient): """ Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ + ``_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. @@ -531,7 +535,7 @@ class CatClient(NamespacedClient): def templates(self, name=None, params=None, headers=None): """ Returns information about existing templates. - ``_ + ``_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, @@ -554,7 +558,7 @@ class CatClient(NamespacedClient): def ml_data_frame_analytics(self, id=None, params=None, headers=None): """ Gets configuration and usage information about 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 @@ -583,7 +587,7 @@ class CatClient(NamespacedClient): def ml_datafeeds(self, datafeed_id=None, params=None, headers=None): """ Gets configuration and usage information about datafeeds. - ``_ + ``_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard @@ -610,7 +614,7 @@ class CatClient(NamespacedClient): def ml_jobs(self, job_id=None, params=None, headers=None): """ Gets configuration and usage information about 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 @@ -650,7 +654,7 @@ class CatClient(NamespacedClient): def ml_trained_models(self, model_id=None, params=None, headers=None): """ Gets configuration and usage information about inference trained models. - ``_ + ``_ :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -688,7 +692,7 @@ class CatClient(NamespacedClient): def transforms(self, transform_id=None, params=None, headers=None): """ Gets configuration and usage information about transforms. - ``_ + ``_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transforms diff --git a/elasticsearch/client/ccr.py b/elasticsearch/client/ccr.py index 5ef08c47..ea241234 100644 --- a/elasticsearch/client/ccr.py +++ b/elasticsearch/client/ccr.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class CcrClient(NamespacedClient): def delete_auto_follow_pattern(self, name, params=None, headers=None): """ Deletes auto-follow patterns. - ``_ + ``_ :arg name: The name of the auto follow pattern. """ @@ -24,7 +28,7 @@ class CcrClient(NamespacedClient): 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 @@ -52,7 +56,7 @@ class CcrClient(NamespacedClient): """ 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 @@ -69,7 +73,7 @@ class CcrClient(NamespacedClient): """ 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 @@ -85,7 +89,7 @@ class CcrClient(NamespacedClient): 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 @@ -111,7 +115,7 @@ class CcrClient(NamespacedClient): """ Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - ``_ + ``_ :arg name: The name of the auto follow pattern. """ @@ -127,7 +131,7 @@ class CcrClient(NamespacedClient): """ 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. @@ -148,7 +152,7 @@ class CcrClient(NamespacedClient): 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 @@ -169,7 +173,7 @@ class CcrClient(NamespacedClient): 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 @@ -190,7 +194,7 @@ class CcrClient(NamespacedClient): 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 @@ -201,7 +205,7 @@ class CcrClient(NamespacedClient): """ 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. @@ -220,7 +224,7 @@ class CcrClient(NamespacedClient): 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. @@ -239,7 +243,7 @@ class CcrClient(NamespacedClient): 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. diff --git a/elasticsearch/client/cluster.py b/elasticsearch/client/cluster.py index a2ff1971..3cd9ca38 100644 --- a/elasticsearch/client/cluster.py +++ b/elasticsearch/client/cluster.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -18,7 +22,7 @@ class ClusterClient(NamespacedClient): def health(self, index=None, params=None, headers=None): """ Returns basic information about the health of the cluster. - ``_ + ``_ :arg index: Limit the information returned to a specific index :arg expand_wildcards: Whether to expand wildcard expression to @@ -57,7 +61,7 @@ class ClusterClient(NamespacedClient): """ Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ + ``_ :arg local: Return local information, do not retrieve the state from master node (default: false) @@ -80,7 +84,7 @@ class ClusterClient(NamespacedClient): def state(self, metric=None, index=None, params=None, headers=None): """ Returns a comprehensive information about the state of the cluster. - ``_ + ``_ :arg metric: Limit the information returned to the specified metrics Valid choices: _all, blocks, metadata, nodes, routing_table, @@ -119,7 +123,7 @@ class ClusterClient(NamespacedClient): def stats(self, node_id=None, params=None, headers=None): """ Returns high-level overview of cluster statistics. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -144,7 +148,7 @@ class ClusterClient(NamespacedClient): def reroute(self, body=None, params=None, headers=None): """ Allows to manually change the allocation of individual shards in the cluster. - ``_ + ``_ :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) @@ -169,7 +173,7 @@ class ClusterClient(NamespacedClient): def get_settings(self, params=None, headers=None): """ Returns cluster settings. - ``_ + ``_ :arg flat_settings: Return settings in flat format (default: false) @@ -187,7 +191,7 @@ class ClusterClient(NamespacedClient): def put_settings(self, body, params=None, headers=None): """ Updates the cluster settings. - ``_ + ``_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). @@ -208,7 +212,7 @@ class ClusterClient(NamespacedClient): def remote_info(self, params=None, headers=None): """ Returns the information about configured remote clusters. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers @@ -218,7 +222,7 @@ class ClusterClient(NamespacedClient): def allocation_explain(self, body=None, params=None, headers=None): """ Provides explanations for shard allocations in the cluster. - ``_ + ``_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' diff --git a/elasticsearch/client/data_frame.py b/elasticsearch/client/data_frame.py index e7ff49a5..cacf2539 100644 --- a/elasticsearch/client/data_frame.py +++ b/elasticsearch/client/data_frame.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH diff --git a/elasticsearch/client/deprecation.py b/elasticsearch/client/deprecation.py index 8b0e9d70..32651196 100644 --- a/elasticsearch/client/deprecation.py +++ b/elasticsearch/client/deprecation.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path diff --git a/elasticsearch/client/enrich.py b/elasticsearch/client/enrich.py index 2237a3d0..eabf9afc 100644 --- a/elasticsearch/client/enrich.py +++ b/elasticsearch/client/enrich.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class EnrichClient(NamespacedClient): 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 """ @@ -24,7 +28,7 @@ class EnrichClient(NamespacedClient): 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 @@ -44,7 +48,7 @@ class EnrichClient(NamespacedClient): 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 """ @@ -56,7 +60,7 @@ class EnrichClient(NamespacedClient): 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 @@ -78,7 +82,7 @@ class EnrichClient(NamespacedClient): """ 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/eql.py b/elasticsearch/client/eql.py index 4562bfe9..dc6e036d 100644 --- a/elasticsearch/client/eql.py +++ b/elasticsearch/client/eql.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, SKIP_IN_PATH, query_params, _make_path @@ -6,7 +10,7 @@ class EqlClient(NamespacedClient): 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 diff --git a/elasticsearch/client/graph.py b/elasticsearch/client/graph.py index d495ede6..bb3e0c94 100644 --- a/elasticsearch/client/graph.py +++ b/elasticsearch/client/graph.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -7,7 +11,7 @@ class GraphClient(NamespacedClient): """ 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 diff --git a/elasticsearch/client/ilm.py b/elasticsearch/client/ilm.py index bc8b7052..53282140 100644 --- a/elasticsearch/client/ilm.py +++ b/elasticsearch/client/ilm.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -7,7 +11,7 @@ class IlmClient(NamespacedClient): """ Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - ``_ + ``_ :arg policy: The name of the index lifecycle policy """ @@ -26,7 +30,7 @@ class IlmClient(NamespacedClient): """ 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 @@ -46,7 +50,7 @@ class IlmClient(NamespacedClient): """ Returns the specified policy definition. Includes the policy version and last modified date. - ``_ + ``_ :arg policy: The name of the index lifecycle policy """ @@ -58,7 +62,7 @@ class IlmClient(NamespacedClient): 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 @@ -68,7 +72,7 @@ class IlmClient(NamespacedClient): 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 @@ -89,7 +93,7 @@ class IlmClient(NamespacedClient): 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 @@ -109,7 +113,7 @@ class IlmClient(NamespacedClient): 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 """ @@ -124,7 +128,7 @@ class IlmClient(NamespacedClient): 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 @@ -140,7 +144,7 @@ class IlmClient(NamespacedClient): 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 @@ -151,7 +155,7 @@ class IlmClient(NamespacedClient): """ 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 diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index e3e10319..0a5d99f1 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -7,7 +11,7 @@ class IndicesClient(NamespacedClient): """ Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ + ``_ :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed @@ -25,7 +29,7 @@ class IndicesClient(NamespacedClient): def refresh(self, index=None, params=None, headers=None): """ Performs the refresh operation in one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -52,7 +56,7 @@ class IndicesClient(NamespacedClient): def flush(self, index=None, params=None, headers=None): """ Performs the flush operation on one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -88,7 +92,7 @@ class IndicesClient(NamespacedClient): def create(self, index, body=None, params=None, headers=None): """ Creates an index with optional settings and mappings. - ``_ + ``_ :arg index: The name of the index :arg body: The configuration for the index (`settings` and @@ -113,7 +117,7 @@ class IndicesClient(NamespacedClient): def clone(self, index, target, body=None, params=None, headers=None): """ Clones an index - ``_ + ``_ :arg index: The name of the source index to clone :arg target: The name of the target index to clone into @@ -149,7 +153,7 @@ class IndicesClient(NamespacedClient): def get(self, index, params=None, headers=None): """ Returns information about one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -187,7 +191,7 @@ class IndicesClient(NamespacedClient): def open(self, index, params=None, headers=None): """ Opens an index. - ``_ + ``_ :arg index: A comma separated list of indices to open :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -221,7 +225,7 @@ class IndicesClient(NamespacedClient): def close(self, index, params=None, headers=None): """ Closes an index. - ``_ + ``_ :arg index: A comma separated list of indices to close :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -254,7 +258,7 @@ class IndicesClient(NamespacedClient): def delete(self, index, params=None, headers=None): """ Deletes an index. - ``_ + ``_ :arg index: A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices @@ -286,7 +290,7 @@ class IndicesClient(NamespacedClient): def exists(self, index, params=None, headers=None): """ Returns information about whether a particular index exists. - ``_ + ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -315,7 +319,7 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular document type exists. (DEPRECATED) - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` to check the types across all indices @@ -353,7 +357,7 @@ class IndicesClient(NamespacedClient): def put_mapping(self, body, index=None, doc_type=None, params=None, headers=None): """ Updates the index mappings. - ``_ + ``_ :arg body: The mapping definition :arg index: A comma-separated list of index names the mapping @@ -398,7 +402,7 @@ class IndicesClient(NamespacedClient): def get_mapping(self, index=None, doc_type=None, params=None, headers=None): """ Returns mappings for one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of document types @@ -436,7 +440,7 @@ class IndicesClient(NamespacedClient): ): """ Returns mapping for one or more fields. - ``_ + ``_ :arg fields: A comma-separated list of fields :arg index: A comma-separated list of index names @@ -470,7 +474,7 @@ class IndicesClient(NamespacedClient): def put_alias(self, index, name, body=None, params=None, headers=None): """ Creates or updates an alias. - ``_ + ``_ :arg index: A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the @@ -497,7 +501,7 @@ class IndicesClient(NamespacedClient): def exists_alias(self, name, index=None, params=None, headers=None): """ Returns information about whether a particular alias exists. - ``_ + ``_ :arg name: A comma-separated list of alias names to return :arg index: A comma-separated list of index names to filter @@ -524,7 +528,7 @@ class IndicesClient(NamespacedClient): def get_alias(self, index=None, name=None, params=None, headers=None): """ Returns an alias. - ``_ + ``_ :arg index: A comma-separated list of index names to filter aliases @@ -548,7 +552,7 @@ class IndicesClient(NamespacedClient): def update_aliases(self, body, params=None, headers=None): """ Updates index aliases. - ``_ + ``_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master @@ -565,7 +569,7 @@ class IndicesClient(NamespacedClient): def delete_alias(self, index, name, params=None, headers=None): """ Deletes an alias. - ``_ + ``_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices @@ -586,7 +590,7 @@ class IndicesClient(NamespacedClient): def put_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - ``_ + ``_ :arg name: The name of the template :arg body: The template definition @@ -615,7 +619,7 @@ class IndicesClient(NamespacedClient): def exists_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - ``_ + ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -636,7 +640,7 @@ class IndicesClient(NamespacedClient): def get_template(self, name=None, params=None, headers=None): """ Returns an index template. - ``_ + ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -656,7 +660,7 @@ class IndicesClient(NamespacedClient): def delete_template(self, name, params=None, headers=None): """ Deletes an index template. - ``_ + ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -681,7 +685,7 @@ class IndicesClient(NamespacedClient): def get_settings(self, index=None, name=None, params=None, headers=None): """ Returns settings for one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -718,7 +722,7 @@ class IndicesClient(NamespacedClient): def put_settings(self, body, index=None, params=None, headers=None): """ Updates the index settings. - ``_ + ``_ :arg body: The index settings to be updated :arg index: A comma-separated list of index names; use `_all` or @@ -765,7 +769,7 @@ class IndicesClient(NamespacedClient): def stats(self, index=None, metric=None, params=None, headers=None): """ Provides statistics on operations happening in an index. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -808,7 +812,7 @@ class IndicesClient(NamespacedClient): def segments(self, index=None, params=None, headers=None): """ Provides low-level information about segments in a Lucene index. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -845,7 +849,7 @@ class IndicesClient(NamespacedClient): ): """ Allows a user to validate a potentially expensive query without executing it. - ``_ + ``_ :arg body: The query definition specified with the Query DSL :arg index: A comma-separated list of index names to restrict @@ -898,7 +902,7 @@ class IndicesClient(NamespacedClient): def clear_cache(self, index=None, params=None, headers=None): """ Clears all or specific caches for one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index name to limit the operation @@ -924,7 +928,7 @@ class IndicesClient(NamespacedClient): def recovery(self, index=None, params=None, headers=None): """ Returns information about ongoing index shard recoveries. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -947,7 +951,7 @@ class IndicesClient(NamespacedClient): def upgrade(self, index=None, params=None, headers=None): """ The _upgrade API is no longer useful and will be removed. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -972,7 +976,7 @@ class IndicesClient(NamespacedClient): def get_upgrade(self, index=None, params=None, headers=None): """ The _upgrade API is no longer useful and will be removed. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -994,7 +998,7 @@ class IndicesClient(NamespacedClient): """ Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -1020,7 +1024,7 @@ class IndicesClient(NamespacedClient): def shard_stores(self, index=None, params=None, headers=None): """ Provides store information for shard copies of indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1051,7 +1055,7 @@ class IndicesClient(NamespacedClient): def forcemerge(self, index=None, params=None, headers=None): """ Performs the force merge operation on one or more indices. - ``_ + ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1080,7 +1084,7 @@ class IndicesClient(NamespacedClient): def shrink(self, index, target, body=None, params=None, headers=None): """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ + ``_ :arg index: The name of the source index to shrink :arg target: The name of the target index to shrink into @@ -1112,7 +1116,7 @@ class IndicesClient(NamespacedClient): """ Allows you to split an existing index into a new index with more primary shards. - ``_ + ``_ :arg index: The name of the source index to split :arg target: The name of the target index to split into @@ -1149,7 +1153,7 @@ class IndicesClient(NamespacedClient): """ Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ + ``_ :arg alias: The name of the alias to rollover :arg body: The conditions that needs to be met for executing @@ -1191,7 +1195,7 @@ class IndicesClient(NamespacedClient): """ Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only. - ``_ + ``_ :arg index: The name of the index to freeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1226,7 +1230,7 @@ class IndicesClient(NamespacedClient): """ Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ + ``_ :arg index: The name of the index to unfreeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1253,7 +1257,7 @@ class IndicesClient(NamespacedClient): def reload_search_analyzers(self, index, params=None, headers=None): """ Reloads an index's search analyzers and their resources. - ``_ + ``_ :arg index: A comma-separated list of index names to reload analyzers for @@ -1280,7 +1284,7 @@ class IndicesClient(NamespacedClient): def create_data_stream(self, name, body, params=None, headers=None): """ Creates or updates a data stream - ``_ + ``_ :arg name: The name of the data stream :arg body: The data stream definition @@ -1301,7 +1305,7 @@ class IndicesClient(NamespacedClient): def delete_data_stream(self, name, params=None, headers=None): """ Deletes a data stream. - ``_ + ``_ :arg name: The name of the data stream """ @@ -1316,7 +1320,7 @@ class IndicesClient(NamespacedClient): def get_data_streams(self, name=None, params=None, headers=None): """ Returns data streams. - ``_ + ``_ :arg name: The name or wildcard expression of the requested data streams @@ -1329,7 +1333,7 @@ class IndicesClient(NamespacedClient): def delete_index_template(self, name, params=None, headers=None): """ Deletes an index template. - ``_ + ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -1349,7 +1353,7 @@ class IndicesClient(NamespacedClient): def exists_index_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - ``_ + ``_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: @@ -1370,7 +1374,7 @@ class IndicesClient(NamespacedClient): def get_index_template(self, name=None, params=None, headers=None): """ Returns an index template. - ``_ + ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -1388,7 +1392,7 @@ class IndicesClient(NamespacedClient): def put_index_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - ``_ + ``_ :arg name: The name of the template :arg body: The template definition diff --git a/elasticsearch/client/ingest.py b/elasticsearch/client/ingest.py index 40fd7a20..3b7ba24f 100644 --- a/elasticsearch/client/ingest.py +++ b/elasticsearch/client/ingest.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class IngestClient(NamespacedClient): def get_pipeline(self, id=None, params=None, headers=None): """ Returns a pipeline. - ``_ + ``_ :arg id: Comma separated list of pipeline ids. Wildcards supported @@ -21,7 +25,7 @@ class IngestClient(NamespacedClient): def put_pipeline(self, id, body, params=None, headers=None): """ Creates or updates a pipeline. - ``_ + ``_ :arg id: Pipeline ID :arg body: The ingest definition @@ -45,7 +49,7 @@ class IngestClient(NamespacedClient): def delete_pipeline(self, id, params=None, headers=None): """ Deletes a pipeline. - ``_ + ``_ :arg id: Pipeline ID :arg master_timeout: Explicit operation timeout for connection @@ -66,7 +70,7 @@ class IngestClient(NamespacedClient): def simulate(self, body, id=None, params=None, headers=None): """ Allows to simulate a pipeline with example documents. - ``_ + ``_ :arg body: The simulate definition :arg id: Pipeline ID @@ -88,7 +92,7 @@ class IngestClient(NamespacedClient): def processor_grok(self, params=None, headers=None): """ Returns a list of the built-in patterns. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers diff --git a/elasticsearch/client/license.py b/elasticsearch/client/license.py index 1564c533..8a1af8a4 100644 --- a/elasticsearch/client/license.py +++ b/elasticsearch/client/license.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params @@ -6,7 +10,7 @@ class LicenseClient(NamespacedClient): def delete(self, params=None, headers=None): """ Deletes licensing information for the cluster - ``_ + ``_ """ return self.transport.perform_request( "DELETE", "/_license", params=params, headers=headers @@ -16,7 +20,7 @@ class LicenseClient(NamespacedClient): 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) @@ -31,7 +35,7 @@ class LicenseClient(NamespacedClient): 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 @@ -41,7 +45,7 @@ class LicenseClient(NamespacedClient): 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 @@ -51,7 +55,7 @@ class LicenseClient(NamespacedClient): 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 @@ -65,7 +69,7 @@ class LicenseClient(NamespacedClient): 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) @@ -78,7 +82,7 @@ class LicenseClient(NamespacedClient): 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) diff --git a/elasticsearch/client/migration.py b/elasticsearch/client/migration.py index ebe9a97a..acc7018a 100644 --- a/elasticsearch/client/migration.py +++ b/elasticsearch/client/migration.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path @@ -8,7 +12,7 @@ class MigrationClient(NamespacedClient): Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. - ``_ + ``_ :arg index: Index pattern """ diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index 52b8d8bc..e3e2919b 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH, _bulk_body @@ -7,7 +11,7 @@ class MlClient(NamespacedClient): """ 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 @@ -33,7 +37,7 @@ class MlClient(NamespacedClient): def delete_calendar(self, calendar_id, params=None, headers=None): """ Deletes a calendar. - ``_ + ``_ :arg calendar_id: The ID of the calendar to delete """ @@ -53,7 +57,7 @@ class MlClient(NamespacedClient): 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 @@ -73,7 +77,7 @@ class MlClient(NamespacedClient): 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 @@ -93,7 +97,7 @@ class MlClient(NamespacedClient): 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 @@ -114,7 +118,7 @@ class MlClient(NamespacedClient): def delete_expired_data(self, params=None, headers=None): """ Deletes expired and unused machine learning data. - ``_ + ``_ """ return self.transport.perform_request( "DELETE", "/_ml/_delete_expired_data", params=params, headers=headers @@ -124,7 +128,7 @@ class MlClient(NamespacedClient): def delete_filter(self, filter_id, params=None, headers=None): """ Deletes a filter. - ``_ + ``_ :arg filter_id: The ID of the filter to delete """ @@ -142,7 +146,7 @@ class MlClient(NamespacedClient): 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 @@ -166,7 +170,7 @@ class MlClient(NamespacedClient): 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 @@ -187,7 +191,7 @@ class MlClient(NamespacedClient): 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 @@ -225,7 +229,7 @@ class MlClient(NamespacedClient): """ 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 @@ -276,7 +280,7 @@ class MlClient(NamespacedClient): 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 @@ -306,7 +310,7 @@ class MlClient(NamespacedClient): 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 @@ -337,7 +341,7 @@ class MlClient(NamespacedClient): 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 @@ -374,7 +378,7 @@ class MlClient(NamespacedClient): 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 @@ -404,7 +408,7 @@ class MlClient(NamespacedClient): 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 @@ -430,7 +434,7 @@ class MlClient(NamespacedClient): ): """ 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 @@ -460,7 +464,7 @@ class MlClient(NamespacedClient): 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 @@ -478,7 +482,7 @@ class MlClient(NamespacedClient): 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 @@ -496,7 +500,7 @@ class MlClient(NamespacedClient): 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 @@ -526,7 +530,7 @@ class MlClient(NamespacedClient): 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 @@ -560,7 +564,7 @@ class MlClient(NamespacedClient): 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 @@ -578,7 +582,7 @@ class MlClient(NamespacedClient): 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 @@ -598,7 +602,7 @@ class MlClient(NamespacedClient): ): """ Retrieves information about model snapshots. - ``_ + ``_ :arg job_id: The ID of the job to fetch :arg body: Model snapshot selection criteria @@ -642,7 +646,7 @@ class MlClient(NamespacedClient): """ 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 @@ -690,7 +694,7 @@ class MlClient(NamespacedClient): 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 @@ -723,7 +727,7 @@ class MlClient(NamespacedClient): 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 @@ -733,7 +737,7 @@ class MlClient(NamespacedClient): 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 """ @@ -751,7 +755,7 @@ class MlClient(NamespacedClient): 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 @@ -772,7 +776,7 @@ class MlClient(NamespacedClient): 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 @@ -798,7 +802,7 @@ class MlClient(NamespacedClient): def preview_datafeed(self, datafeed_id, params=None, headers=None): """ Previews a datafeed. - ``_ + ``_ :arg datafeed_id: The ID of the datafeed to preview """ @@ -818,7 +822,7 @@ class MlClient(NamespacedClient): 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 @@ -840,7 +844,7 @@ class MlClient(NamespacedClient): 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 @@ -862,7 +866,7 @@ class MlClient(NamespacedClient): 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 @@ -892,7 +896,7 @@ class MlClient(NamespacedClient): 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 @@ -913,7 +917,7 @@ class MlClient(NamespacedClient): 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 @@ -936,7 +940,7 @@ class MlClient(NamespacedClient): ): """ 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 @@ -968,7 +972,7 @@ class MlClient(NamespacedClient): """ 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. @@ -983,7 +987,7 @@ class MlClient(NamespacedClient): 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 @@ -1010,7 +1014,7 @@ class MlClient(NamespacedClient): def stop_datafeed(self, datafeed_id, params=None, headers=None): """ Stops one or more datafeeds. - ``_ + ``_ :arg datafeed_id: The ID of the datafeed to stop :arg allow_no_datafeeds: Whether to ignore if a wildcard @@ -1038,7 +1042,7 @@ class MlClient(NamespacedClient): 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 @@ -1068,7 +1072,7 @@ class MlClient(NamespacedClient): 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 @@ -1089,7 +1093,7 @@ class MlClient(NamespacedClient): 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 @@ -1112,7 +1116,7 @@ class MlClient(NamespacedClient): ): """ 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 @@ -1177,7 +1181,7 @@ class MlClient(NamespacedClient): 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 @@ -1196,7 +1200,7 @@ class MlClient(NamespacedClient): def evaluate_data_frame(self, body, params=None, headers=None): """ Evaluates the data frame analytics for an annotated index. - ``_ + ``_ :arg body: The evaluation definition """ @@ -1215,7 +1219,7 @@ class MlClient(NamespacedClient): 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 @@ -1240,7 +1244,7 @@ class MlClient(NamespacedClient): 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 @@ -1265,7 +1269,7 @@ class MlClient(NamespacedClient): 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 @@ -1286,7 +1290,7 @@ class MlClient(NamespacedClient): 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 @@ -1308,7 +1312,7 @@ class MlClient(NamespacedClient): 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 @@ -1336,7 +1340,7 @@ class MlClient(NamespacedClient): """ 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 """ @@ -1356,7 +1360,7 @@ class MlClient(NamespacedClient): ): """ 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 @@ -1380,7 +1384,7 @@ class MlClient(NamespacedClient): 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 @@ -1413,7 +1417,7 @@ class MlClient(NamespacedClient): 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 @@ -1438,7 +1442,7 @@ class MlClient(NamespacedClient): 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 @@ -1459,7 +1463,7 @@ class MlClient(NamespacedClient): 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 diff --git a/elasticsearch/client/monitoring.py b/elasticsearch/client/monitoring.py index 48ca5d50..1bb296b6 100644 --- a/elasticsearch/client/monitoring.py +++ b/elasticsearch/client/monitoring.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH, _bulk_body @@ -6,7 +10,7 @@ class MonitoringClient(NamespacedClient): def bulk(self, body, doc_type=None, params=None, headers=None): """ Used by the monitoring features to send monitoring data. - ``_ + ``_ :arg body: The operation definition and data (action-data pairs), separated by newlines diff --git a/elasticsearch/client/nodes.py b/elasticsearch/client/nodes.py index 175f705c..8754b4f0 100644 --- a/elasticsearch/client/nodes.py +++ b/elasticsearch/client/nodes.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path @@ -8,7 +12,7 @@ class NodesClient(NamespacedClient): ): """ Reloads secure settings. - ``_ + ``_ :arg body: An object containing the password for the elasticsearch keystore @@ -29,7 +33,7 @@ class NodesClient(NamespacedClient): def info(self, node_id=None, metric=None, params=None, headers=None): """ Returns information about nodes in the cluster. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -61,7 +65,7 @@ class NodesClient(NamespacedClient): ): """ Returns statistical information about nodes in the cluster. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -105,7 +109,7 @@ class NodesClient(NamespacedClient): def hot_threads(self, node_id=None, params=None, headers=None): """ Returns information about hot threads on each node in the cluster. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -138,7 +142,7 @@ class NodesClient(NamespacedClient): def usage(self, node_id=None, metric=None, params=None, headers=None): """ Returns low-level information about REST actions usage on nodes. - ``_ + ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from diff --git a/elasticsearch/client/remote.py b/elasticsearch/client/remote.py index 8590313a..3b2d767a 100644 --- a/elasticsearch/client/remote.py +++ b/elasticsearch/client/remote.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params diff --git a/elasticsearch/client/rollup.py b/elasticsearch/client/rollup.py index afcd93ae..59a35f32 100644 --- a/elasticsearch/client/rollup.py +++ b/elasticsearch/client/rollup.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class RollupClient(NamespacedClient): def delete_job(self, id, params=None, headers=None): """ Deletes an existing rollup job. - ``_ + ``_ :arg id: The ID of the job to delete """ @@ -21,7 +25,7 @@ class RollupClient(NamespacedClient): def get_jobs(self, id=None, params=None, headers=None): """ Retrieves the configuration, stats, and status of rollup jobs. - ``_ + ``_ :arg id: The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs @@ -35,7 +39,7 @@ class RollupClient(NamespacedClient): """ Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - ``_ + ``_ :arg id: The ID of the index to check rollup capabilities on, or left blank for all jobs @@ -49,7 +53,7 @@ class RollupClient(NamespacedClient): """ Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - ``_ + ``_ :arg index: The rollup index or index pattern to obtain rollup capabilities from. @@ -65,7 +69,7 @@ class RollupClient(NamespacedClient): def put_job(self, id, body, params=None, headers=None): """ Creates a rollup job. - ``_ + ``_ :arg id: The ID of the job to create :arg body: The job configuration @@ -86,7 +90,7 @@ class RollupClient(NamespacedClient): def rollup_search(self, index, body, doc_type=None, params=None, headers=None): """ Enables searching rolled-up data using the standard query DSL. - ``_ + ``_ :arg index: The indices or index-pattern(s) (containing rollup or regular data) that should be searched @@ -113,7 +117,7 @@ class RollupClient(NamespacedClient): def start_job(self, id, params=None, headers=None): """ Starts an existing, stopped rollup job. - ``_ + ``_ :arg id: The ID of the job to start """ @@ -131,7 +135,7 @@ class RollupClient(NamespacedClient): def stop_job(self, id, params=None, headers=None): """ Stops an existing, started rollup job. - ``_ + ``_ :arg id: The ID of the job to stop :arg timeout: Block for (at maximum) the specified duration diff --git a/elasticsearch/client/searchable_snapshots.py b/elasticsearch/client/searchable_snapshots.py index 62973317..438fb25c 100644 --- a/elasticsearch/client/searchable_snapshots.py +++ b/elasticsearch/client/searchable_snapshots.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -5,7 +9,7 @@ class SearchableSnapshotsClient(NamespacedClient): @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") def clear_cache(self, index=None, params=None, headers=None): """ - ``_ + ``_ :arg index: A comma-separated list of index name to limit the operation @@ -55,7 +59,7 @@ class SearchableSnapshotsClient(NamespacedClient): @query_params() def repository_stats(self, repository, params=None, headers=None): """ - ``_ + ``_ :arg repository: The repository for which to get the stats for """ @@ -72,7 +76,7 @@ class SearchableSnapshotsClient(NamespacedClient): @query_params() def stats(self, index=None, params=None, headers=None): """ - ``_ + ``_ :arg index: A comma-separated list of index names """ diff --git a/elasticsearch/client/security.py b/elasticsearch/client/security.py index 9f54fc33..46f9059a 100644 --- a/elasticsearch/client/security.py +++ b/elasticsearch/client/security.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -7,7 +11,7 @@ class SecurityClient(NamespacedClient): """ Enables authentication as a user and retrieve information about the authenticated user. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_security/_authenticate", params=params, headers=headers @@ -17,7 +21,7 @@ class SecurityClient(NamespacedClient): 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 @@ -43,7 +47,7 @@ class SecurityClient(NamespacedClient): """ 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 @@ -63,7 +67,7 @@ class SecurityClient(NamespacedClient): def clear_cached_roles(self, name, params=None, headers=None): """ Evicts roles from the native role cache. - ``_ + ``_ :arg name: Role name """ @@ -81,7 +85,7 @@ class SecurityClient(NamespacedClient): 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 @@ -100,7 +104,7 @@ class SecurityClient(NamespacedClient): def delete_privileges(self, application, name, params=None, headers=None): """ Removes application privileges. - ``_ + ``_ :arg application: Application name :arg name: Privilege name @@ -124,7 +128,7 @@ class SecurityClient(NamespacedClient): 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 @@ -146,7 +150,7 @@ class SecurityClient(NamespacedClient): 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 @@ -168,7 +172,7 @@ class SecurityClient(NamespacedClient): 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 @@ -190,7 +194,7 @@ class SecurityClient(NamespacedClient): 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 @@ -212,7 +216,7 @@ class SecurityClient(NamespacedClient): 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 @@ -234,7 +238,7 @@ class SecurityClient(NamespacedClient): 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 @@ -253,7 +257,7 @@ class SecurityClient(NamespacedClient): def get_privileges(self, application=None, name=None, params=None, headers=None): """ Retrieves application privileges. - ``_ + ``_ :arg application: Application name :arg name: Privilege name @@ -269,7 +273,7 @@ class SecurityClient(NamespacedClient): def get_role(self, name=None, params=None, headers=None): """ Retrieves roles in the native realm. - ``_ + ``_ :arg name: Role name """ @@ -281,7 +285,7 @@ class SecurityClient(NamespacedClient): def get_role_mapping(self, name=None, params=None, headers=None): """ Retrieves role mappings. - ``_ + ``_ :arg name: Role-Mapping name """ @@ -296,7 +300,7 @@ class SecurityClient(NamespacedClient): 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 """ @@ -311,7 +315,7 @@ class SecurityClient(NamespacedClient): 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 """ @@ -326,7 +330,7 @@ class SecurityClient(NamespacedClient): def get_user_privileges(self, params=None, headers=None): """ Retrieves application privileges. - ``_ + ``_ """ return self.transport.perform_request( "GET", "/_security/user/_privileges", params=params, headers=headers @@ -336,7 +340,7 @@ class SecurityClient(NamespacedClient): 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 @@ -356,7 +360,7 @@ class SecurityClient(NamespacedClient): 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) """ @@ -371,7 +375,7 @@ class SecurityClient(NamespacedClient): def invalidate_token(self, body, params=None, headers=None): """ Invalidates one or more access tokens or refresh tokens. - ``_ + ``_ :arg body: The token to invalidate """ @@ -390,7 +394,7 @@ class SecurityClient(NamespacedClient): 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 @@ -409,7 +413,7 @@ class SecurityClient(NamespacedClient): 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 @@ -434,7 +438,7 @@ class SecurityClient(NamespacedClient): 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 @@ -460,7 +464,7 @@ class SecurityClient(NamespacedClient): """ 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 @@ -486,7 +490,7 @@ class SecurityClient(NamespacedClient): """ 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 diff --git a/elasticsearch/client/slm.py b/elasticsearch/client/slm.py index 576928f3..c4a7720b 100644 --- a/elasticsearch/client/slm.py +++ b/elasticsearch/client/slm.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class SlmClient(NamespacedClient): 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 @@ -26,7 +30,7 @@ class SlmClient(NamespacedClient): """ 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 @@ -46,7 +50,7 @@ class SlmClient(NamespacedClient): """ 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 @@ -57,7 +61,7 @@ class SlmClient(NamespacedClient): """ 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 @@ -74,7 +78,7 @@ class SlmClient(NamespacedClient): """ 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 @@ -84,7 +88,7 @@ class SlmClient(NamespacedClient): 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 @@ -104,7 +108,7 @@ class SlmClient(NamespacedClient): 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 @@ -114,7 +118,7 @@ class SlmClient(NamespacedClient): 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 @@ -124,7 +128,7 @@ class SlmClient(NamespacedClient): 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/snapshot.py b/elasticsearch/client/snapshot.py index 9fc2a411..40f81b2b 100644 --- a/elasticsearch/client/snapshot.py +++ b/elasticsearch/client/snapshot.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class SnapshotClient(NamespacedClient): def create(self, repository, snapshot, body=None, params=None, headers=None): """ Creates a snapshot in a repository. - ``_ + ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -32,7 +36,7 @@ class SnapshotClient(NamespacedClient): def delete(self, repository, snapshot, params=None, headers=None): """ Deletes a snapshot. - ``_ + ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -54,7 +58,7 @@ class SnapshotClient(NamespacedClient): def get(self, repository, snapshot, params=None, headers=None): """ Returns information about a snapshot. - ``_ + ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -81,7 +85,7 @@ class SnapshotClient(NamespacedClient): def delete_repository(self, repository, params=None, headers=None): """ Deletes a repository. - ``_ + ``_ :arg repository: A comma-separated list of repository names :arg master_timeout: Explicit operation timeout for connection @@ -102,7 +106,7 @@ class SnapshotClient(NamespacedClient): def get_repository(self, repository=None, params=None, headers=None): """ Returns information about a repository. - ``_ + ``_ :arg repository: A comma-separated list of repository names :arg local: Return local information, do not retrieve the state @@ -118,7 +122,7 @@ class SnapshotClient(NamespacedClient): def create_repository(self, repository, body, params=None, headers=None): """ Creates a repository. - ``_ + ``_ :arg repository: A repository name :arg body: The repository definition @@ -143,7 +147,7 @@ class SnapshotClient(NamespacedClient): def restore(self, repository, snapshot, body=None, params=None, headers=None): """ Restores a snapshot. - ``_ + ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -169,7 +173,7 @@ class SnapshotClient(NamespacedClient): def status(self, repository=None, snapshot=None, params=None, headers=None): """ Returns information about the status of a snapshot. - ``_ + ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -190,7 +194,7 @@ class SnapshotClient(NamespacedClient): def verify_repository(self, repository, params=None, headers=None): """ Verifies a repository. - ``_ + ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection @@ -211,7 +215,7 @@ class SnapshotClient(NamespacedClient): def cleanup_repository(self, repository, params=None, headers=None): """ Removes stale data from repository. - ``_ + ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection diff --git a/elasticsearch/client/sql.py b/elasticsearch/client/sql.py index eb79e8b4..e6f14ce3 100644 --- a/elasticsearch/client/sql.py +++ b/elasticsearch/client/sql.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, SKIP_IN_PATH @@ -6,7 +10,7 @@ class SqlClient(NamespacedClient): 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. @@ -22,7 +26,7 @@ class SqlClient(NamespacedClient): 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. @@ -40,7 +44,7 @@ class SqlClient(NamespacedClient): def translate(self, body, params=None, headers=None): """ Translates SQL into Elasticsearch queries - ``_ + ``_ :arg body: Specify the query in the `query` element. """ diff --git a/elasticsearch/client/ssl.py b/elasticsearch/client/ssl.py index da6fa0b7..65c007c5 100644 --- a/elasticsearch/client/ssl.py +++ b/elasticsearch/client/ssl.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params @@ -7,7 +11,7 @@ class SslClient(NamespacedClient): """ 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/tasks.py b/elasticsearch/client/tasks.py index 9d1ee497..d70ff748 100644 --- a/elasticsearch/client/tasks.py +++ b/elasticsearch/client/tasks.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import warnings from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -15,7 +19,7 @@ class TasksClient(NamespacedClient): def list(self, params=None, headers=None): """ Returns a list of tasks. - ``_ + ``_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. @@ -39,7 +43,7 @@ class TasksClient(NamespacedClient): def cancel(self, task_id=None, params=None, headers=None): """ Cancels a task, if it can be cancelled through an API. - ``_ + ``_ :arg task_id: Cancel the task with specified task id (node_id:task_number) @@ -65,7 +69,7 @@ class TasksClient(NamespacedClient): def get(self, task_id=None, params=None, headers=None): """ Returns information about a task. - ``_ + ``_ :arg task_id: Return the task with specified id (node_id:task_number) diff --git a/elasticsearch/client/transform.py b/elasticsearch/client/transform.py index 92f472f8..a24916c6 100644 --- a/elasticsearch/client/transform.py +++ b/elasticsearch/client/transform.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class TransformClient(NamespacedClient): 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 @@ -29,7 +33,7 @@ class TransformClient(NamespacedClient): 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 @@ -56,7 +60,7 @@ class TransformClient(NamespacedClient): 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 @@ -87,7 +91,7 @@ class TransformClient(NamespacedClient): def preview_transform(self, body, params=None, headers=None): """ Previews a transform. - ``_ + ``_ :arg body: The definition for the transform to preview """ @@ -102,7 +106,7 @@ class TransformClient(NamespacedClient): 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 @@ -125,7 +129,7 @@ class TransformClient(NamespacedClient): 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 @@ -153,7 +157,7 @@ class TransformClient(NamespacedClient): 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 @@ -184,7 +188,7 @@ class TransformClient(NamespacedClient): 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 diff --git a/elasticsearch/client/utils.py b/elasticsearch/client/utils.py index d2f37e47..11082db4 100644 --- a/elasticsearch/client/utils.py +++ b/elasticsearch/client/utils.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals import weakref diff --git a/elasticsearch/client/watcher.py b/elasticsearch/client/watcher.py index 3a3450dd..2eafd0a5 100644 --- a/elasticsearch/client/watcher.py +++ b/elasticsearch/client/watcher.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH @@ -6,7 +10,7 @@ class WatcherClient(NamespacedClient): 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 @@ -26,7 +30,7 @@ class WatcherClient(NamespacedClient): def activate_watch(self, watch_id, params=None, headers=None): """ Activates a currently inactive watch. - ``_ + ``_ :arg watch_id: Watch ID """ @@ -44,7 +48,7 @@ class WatcherClient(NamespacedClient): def deactivate_watch(self, watch_id, params=None, headers=None): """ Deactivates a currently active watch. - ``_ + ``_ :arg watch_id: Watch ID """ @@ -62,7 +66,7 @@ class WatcherClient(NamespacedClient): def delete_watch(self, id, params=None, headers=None): """ Removes a watch from Watcher. - ``_ + ``_ :arg id: Watch ID """ @@ -80,7 +84,7 @@ class WatcherClient(NamespacedClient): 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 @@ -99,7 +103,7 @@ class WatcherClient(NamespacedClient): def get_watch(self, id, params=None, headers=None): """ Retrieves a watch by its ID. - ``_ + ``_ :arg id: Watch ID """ @@ -114,7 +118,7 @@ class WatcherClient(NamespacedClient): 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 @@ -140,7 +144,7 @@ class WatcherClient(NamespacedClient): 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 @@ -150,7 +154,7 @@ class WatcherClient(NamespacedClient): 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, @@ -169,7 +173,7 @@ class WatcherClient(NamespacedClient): 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 diff --git a/elasticsearch/client/xpack.py b/elasticsearch/client/xpack.py index 2e1a85b4..2a463530 100644 --- a/elasticsearch/client/xpack.py +++ b/elasticsearch/client/xpack.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .utils import NamespacedClient, query_params @@ -10,7 +14,7 @@ class XPackClient(NamespacedClient): def info(self, params=None, headers=None): """ Retrieves information about the installed X-Pack features. - ``_ + ``_ :arg categories: Comma-separated list of info categories. Can be any of: build, license, features @@ -23,7 +27,7 @@ class XPackClient(NamespacedClient): def usage(self, params=None, headers=None): """ Retrieves usage information about the installed X-Pack features. - ``_ + ``_ :arg master_timeout: Specify timeout for watch write operation """ diff --git a/elasticsearch/compat.py b/elasticsearch/compat.py index aba63ea7..31040381 100644 --- a/elasticsearch/compat.py +++ b/elasticsearch/compat.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import sys PY2 = sys.version_info[0] == 2 diff --git a/elasticsearch/connection/__init__.py b/elasticsearch/connection/__init__.py index e56e541d..7785e329 100644 --- a/elasticsearch/connection/__init__.py +++ b/elasticsearch/connection/__init__.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .base import Connection from .http_requests import RequestsHttpConnection from .http_urllib3 import Urllib3HttpConnection, create_ssl_context diff --git a/elasticsearch/connection/base.py b/elasticsearch/connection/base.py index 6da40fa6..6a27b329 100644 --- a/elasticsearch/connection/base.py +++ b/elasticsearch/connection/base.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import logging import binascii import gzip diff --git a/elasticsearch/connection/http_requests.py b/elasticsearch/connection/http_requests.py index 5db73aad..1405c7c9 100644 --- a/elasticsearch/connection/http_requests.py +++ b/elasticsearch/connection/http_requests.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time import warnings diff --git a/elasticsearch/connection/http_urllib3.py b/elasticsearch/connection/http_urllib3.py index d1a5c4c9..1b95ecb1 100644 --- a/elasticsearch/connection/http_urllib3.py +++ b/elasticsearch/connection/http_urllib3.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time import ssl import urllib3 diff --git a/elasticsearch/connection/pooling.py b/elasticsearch/connection/pooling.py index dd5431e1..4f4a4f29 100644 --- a/elasticsearch/connection/pooling.py +++ b/elasticsearch/connection/pooling.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + try: import queue except ImportError: diff --git a/elasticsearch/connection_pool.py b/elasticsearch/connection_pool.py index 6881707c..03f3949b 100644 --- a/elasticsearch/connection_pool.py +++ b/elasticsearch/connection_pool.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time import random import logging diff --git a/elasticsearch/exceptions.py b/elasticsearch/exceptions.py index f3d48ce9..131b27f3 100644 --- a/elasticsearch/exceptions.py +++ b/elasticsearch/exceptions.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + __all__ = [ "ImproperlyConfigured", "ElasticsearchException", diff --git a/elasticsearch/helpers/__init__.py b/elasticsearch/helpers/__init__.py index 28a11c30..7a5f7d81 100644 --- a/elasticsearch/helpers/__init__.py +++ b/elasticsearch/helpers/__init__.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from .errors import BulkIndexError, ScanError from .actions import expand_action, streaming_bulk, bulk, parallel_bulk from .actions import scan, reindex diff --git a/elasticsearch/helpers/actions.py b/elasticsearch/helpers/actions.py index af409c37..8c25c04b 100644 --- a/elasticsearch/helpers/actions.py +++ b/elasticsearch/helpers/actions.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from operator import methodcaller import time diff --git a/elasticsearch/helpers/errors.py b/elasticsearch/helpers/errors.py index 6261822e..1c06da2e 100644 --- a/elasticsearch/helpers/errors.py +++ b/elasticsearch/helpers/errors.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from ..exceptions import ElasticsearchException diff --git a/elasticsearch/helpers/test.py b/elasticsearch/helpers/test.py index aa4b1211..a94ffcbe 100644 --- a/elasticsearch/helpers/test.py +++ b/elasticsearch/helpers/test.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time import os from unittest import TestCase, SkipTest diff --git a/elasticsearch/serializer.py b/elasticsearch/serializer.py index 2ab3191d..50f98c0f 100644 --- a/elasticsearch/serializer.py +++ b/elasticsearch/serializer.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + try: import simplejson as json except ImportError: diff --git a/elasticsearch/transport.py b/elasticsearch/transport.py index 268b5f36..faac81a5 100644 --- a/elasticsearch/transport.py +++ b/elasticsearch/transport.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time from itertools import chain diff --git a/setup.py b/setup.py index 9fd29ed9..0a684aed 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,10 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from os.path import join, dirname from setuptools import setup, find_packages -import sys VERSION = (7, 7, 0) __version__ = VERSION diff --git a/test_elasticsearch/__init__.py b/test_elasticsearch/__init__.py index e69de29b..1a3c439e 100644 --- a/test_elasticsearch/__init__.py +++ b/test_elasticsearch/__init__.py @@ -0,0 +1,3 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information diff --git a/test_elasticsearch/run_tests.py b/test_elasticsearch/run_tests.py index b6a1a25d..e26b9a4c 100755 --- a/test_elasticsearch/run_tests.py +++ b/test_elasticsearch/run_tests.py @@ -1,4 +1,8 @@ #!/usr/bin/env python +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import print_function import sys diff --git a/test_elasticsearch/test_cases.py b/test_elasticsearch/test_cases.py index 72b5dc87..729340e9 100644 --- a/test_elasticsearch/test_cases.py +++ b/test_elasticsearch/test_cases.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from collections import defaultdict from unittest import TestCase from unittest import SkipTest # noqa: F401 diff --git a/test_elasticsearch/test_client/__init__.py b/test_elasticsearch/test_client/__init__.py index 5fa01f76..54f65993 100644 --- a/test_elasticsearch/test_client/__init__.py +++ b/test_elasticsearch/test_client/__init__.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals import warnings diff --git a/test_elasticsearch/test_client/test_cluster.py b/test_elasticsearch/test_client/test_cluster.py index a0b9d741..7341b71a 100644 --- a/test_elasticsearch/test_client/test_cluster.py +++ b/test_elasticsearch/test_client/test_cluster.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from test_elasticsearch.test_cases import ElasticsearchTestCase diff --git a/test_elasticsearch/test_client/test_indices.py b/test_elasticsearch/test_client/test_indices.py index 7fdfc734..e0dabee6 100644 --- a/test_elasticsearch/test_client/test_indices.py +++ b/test_elasticsearch/test_client/test_indices.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from test_elasticsearch.test_cases import ElasticsearchTestCase diff --git a/test_elasticsearch/test_client/test_utils.py b/test_elasticsearch/test_client/test_utils.py index f73f8909..b75c3d50 100644 --- a/test_elasticsearch/test_client/test_utils.py +++ b/test_elasticsearch/test_client/test_utils.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals from elasticsearch.client.utils import _bulk_body, _make_path, _escape, query_params diff --git a/test_elasticsearch/test_connection.py b/test_elasticsearch/test_connection.py index f9504e84..fe85e898 100644 --- a/test_elasticsearch/test_connection.py +++ b/test_elasticsearch/test_connection.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import re import ssl import gzip @@ -397,7 +402,7 @@ class TestUrllib3Connection(TestCase): buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa" con = self._get_mock_connection(response_body=buf) status, headers, data = con.perform_request("GET", "/") - self.assertEqual("你好\uda6a", data) + self.assertEqual(u"你好\uda6a", data) class TestRequestsConnection(TestCase): @@ -782,4 +787,4 @@ class TestRequestsConnection(TestCase): buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa" con = self._get_mock_connection(response_body=buf) status, headers, data = con.perform_request("GET", "/") - self.assertEqual("你好\uda6a", data) + self.assertEqual(u"你好\uda6a", data) diff --git a/test_elasticsearch/test_connection_pool.py b/test_elasticsearch/test_connection_pool.py index f5a5f2d8..b2848202 100644 --- a/test_elasticsearch/test_connection_pool.py +++ b/test_elasticsearch/test_connection_pool.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import time from elasticsearch.connection_pool import ( diff --git a/test_elasticsearch/test_exceptions.py b/test_elasticsearch/test_exceptions.py index 0bb0fe8b..830e101c 100644 --- a/test_elasticsearch/test_exceptions.py +++ b/test_elasticsearch/test_exceptions.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from elasticsearch.exceptions import TransportError from .test_cases import TestCase diff --git a/test_elasticsearch/test_helpers.py b/test_elasticsearch/test_helpers.py index cbacbb53..51b6e011 100644 --- a/test_elasticsearch/test_helpers.py +++ b/test_elasticsearch/test_helpers.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import mock import time import threading diff --git a/test_elasticsearch/test_serializer.py b/test_elasticsearch/test_serializer.py index f07e3d78..5d2172f4 100644 --- a/test_elasticsearch/test_serializer.py +++ b/test_elasticsearch/test_serializer.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + import sys import uuid diff --git a/test_elasticsearch/test_server/__init__.py b/test_elasticsearch/test_server/__init__.py index 159750a6..d7084dd7 100644 --- a/test_elasticsearch/test_server/__init__.py +++ b/test_elasticsearch/test_server/__init__.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from unittest import SkipTest from elasticsearch.helpers import test from elasticsearch.helpers.test import ElasticsearchTestCase as BaseTestCase diff --git a/test_elasticsearch/test_server/test_clients.py b/test_elasticsearch/test_server/test_clients.py index d06eee63..9765a5f6 100644 --- a/test_elasticsearch/test_server/test_clients.py +++ b/test_elasticsearch/test_server/test_clients.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals from . import ElasticsearchTestCase diff --git a/test_elasticsearch/test_server/test_common.py b/test_elasticsearch/test_server/test_common.py index 559ed6e0..ad6f1063 100644 --- a/test_elasticsearch/test_server/test_common.py +++ b/test_elasticsearch/test_server/test_common.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + """ Dynamically generated set of TestCases based on set of yaml files decribing some integration tests. These files are shared among all official Elasticsearch diff --git a/test_elasticsearch/test_server/test_helpers.py b/test_elasticsearch/test_server/test_helpers.py index 7e0fa6c3..6c90805c 100644 --- a/test_elasticsearch/test_server/test_helpers.py +++ b/test_elasticsearch/test_server/test_helpers.py @@ -1,3 +1,7 @@ +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from mock import patch from elasticsearch import helpers, TransportError diff --git a/test_elasticsearch/test_transport.py b/test_elasticsearch/test_transport.py index 4dbb79ce..8fb704bd 100644 --- a/test_elasticsearch/test_transport.py +++ b/test_elasticsearch/test_transport.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# Licensed to Elasticsearch B.V under one or more agreements. +# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +# See the LICENSE file in the project root for more information + from __future__ import unicode_literals import time from mock import patch diff --git a/utils/generate_api.py b/utils/generate_api.py index a6353f19..2b7db566 100644 --- a/utils/generate_api.py +++ b/utils/generate_api.py @@ -3,7 +3,6 @@ # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information - import os import json import re @@ -198,8 +197,8 @@ class API: ((p, parts[p]) for p in parts if parts[p]["required"]), (("body", self.body),) if self.body else (), ((p, parts[p]) for p in parts - if not parts[p]["required"] and - p not in params), + if not parts[p]["required"] + and p not in params), sorted(params.items(), key=lambda x: (x[0] not in parts, x[0])), )