From 5db3482b5c9c27f1d2ef0d878c03ab9d3e8bda58 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Wed, 3 Jun 2020 10:38:35 -0500 Subject: [PATCH] Add typeless API for exists_source --- elasticsearch/_async/client/__init__.py | 150 +++++++++--------- elasticsearch/_async/client/indices.py | 7 +- elasticsearch/_async/client/ml.py | 7 +- elasticsearch/_async/client/snapshot.py | 3 +- elasticsearch/client/__init__.py | 150 +++++++++--------- elasticsearch/client/indices.py | 7 +- elasticsearch/client/ml.py | 7 +- elasticsearch/client/snapshot.py | 3 +- .../overrides/__init__/exists_source | 9 ++ 9 files changed, 183 insertions(+), 160 deletions(-) create mode 100644 utils/templates/overrides/__init__/exists_source diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 14fe93e04..28278e9e4 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -293,11 +293,11 @@ async def create(self, index, id, body, doc_type=None, params=None, headers=None :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults @@ -349,17 +349,17 @@ async def index( number :arg op_type: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests - without an explicit document ID Valid choices: index, create + without an explicit document ID Valid choices: index, create :arg pipeline: The pipeline id to preprocess incoming documents with :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults @@ -414,7 +414,7 @@ async def bulk(self, body, index=None, doc_type=None, params=None, headers=None) :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg wait_for_active_shards: Sets the number of shard copies @@ -492,12 +492,12 @@ async def count( queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled :arg ignore_unavailable: Whether specified concrete indices @@ -548,11 +548,11 @@ async def delete(self, index, id, doc_type=None, params=None, headers=None): :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the delete operation. @@ -631,14 +631,14 @@ async def delete_by_query( queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg conflicts: What to do when the delete by query hits version - conflicts? Valid choices: abort, proceed Default: abort + conflicts? Valid choices: abort, proceed Default: abort :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg from_: Starting offset (default: 0) :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -658,15 +658,15 @@ async def delete_by_query( :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search :arg scroll_size: Size on the scroll request powering the delete - by query Default: 100 + by query Default: 100 :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg size: Deprecated, please use `max_docs` instead :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg sort: A comma-separated list of : pairs :arg stats: Specific 'tag' of the request for logging and statistical purposes @@ -674,7 +674,7 @@ async def delete_by_query( for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg version: Specify whether to return document version as part of a hit :arg wait_for_active_shards: Sets the number of shard copies @@ -684,7 +684,7 @@ async def delete_by_query( or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the delete by query is complete. Default: True + the delete by query is complete. Default: True """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -777,7 +777,7 @@ async def exists(self, index, id, doc_type=None, params=None, headers=None): :arg stored_fields: A comma-separated list of stored fields to return in the response :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -825,18 +825,20 @@ async def exists_source(self, index, id, doc_type=None, params=None, headers=Non performing the operation :arg routing: Specific routing value :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") + if doc_type in SKIP_IN_PATH: + path = _make_path(index, "_source", id) + else: + path = _make_path(index, doc_type, id, "_source") + return await self.transport.perform_request( - "HEAD", - _make_path(index, doc_type, id, "_source"), - params=params, - headers=headers, + "HEAD", path, params=params, headers=headers ) @query_params( @@ -874,7 +876,7 @@ async def explain( queries in the query string query should be analyzed (default: false) :arg analyzer: The analyzer for the query string query :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The default field for query string query (default: _all) :arg lenient: Specify whether format-based query failures (such @@ -918,8 +920,8 @@ async def field_caps(self, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg fields: A comma-separated list of field names :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -967,7 +969,7 @@ async def get(self, index, id, doc_type=None, params=None, headers=None): :arg stored_fields: A comma-separated list of stored fields to return in the response :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -1031,7 +1033,7 @@ async def get_source(self, index, id, doc_type=None, params=None, headers=None): performing the operation :arg routing: Specific routing value :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -1116,13 +1118,13 @@ async def msearch(self, body, index=None, doc_type=None, params=None, headers=No as default :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg max_concurrent_searches: Controls the maximum number of concurrent searches the multi search api will execute :arg max_concurrent_shard_requests: The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests Default: 5 + order to limit the number of concurrent shard requests Default: 5 :arg pre_filter_shard_size: A threshold that enforces a pre- filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the @@ -1132,7 +1134,7 @@ async def msearch(self, body, index=None, doc_type=None, params=None, headers=No shard bounds and the query are disjoint. :arg rest_total_hits_as_int: Indicates whether hits.total should be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1172,12 +1174,12 @@ async def msearch_template( as default :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg max_concurrent_searches: Controls the maximum number of concurrent searches the multi search api will execute :arg rest_total_hits_as_int: Indicates whether hits.total should be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1224,7 +1226,7 @@ async def mtermvectors( :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified - in body "params" or "docs". Default: True + in body "params" or "docs". Default: True :arg fields: A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". @@ -1232,13 +1234,13 @@ async def mtermvectors( define ids as parameter or set "ids" or "docs" in the request body :arg offsets: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg payloads: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg positions: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg preference: Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". @@ -1250,7 +1252,7 @@ async def mtermvectors( document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ if doc_type in SKIP_IN_PATH: @@ -1303,11 +1305,11 @@ async def rank_eval(self, body, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch """ if body in SKIP_IN_PATH: @@ -1349,16 +1351,16 @@ async def reindex(self, body, params=None, headers=None): Default: 5m :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the reindex is complete. Default: True + the reindex is complete. Default: True """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1513,7 +1515,7 @@ async def search( expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout Default: + be returned if there is a partial search failure or timeout Default: True :arg analyze_wildcard: Specify whether wildcard and prefix queries should be analyzed (default: false) @@ -1525,16 +1527,16 @@ async def search( Default: 512 :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg docvalue_fields: A comma-separated list of fields to return as the docvalue representation of a field for each hit :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg explain: Specify whether to return detailed information about score computation as part of a hit :arg from_: Starting offset (default: 0) @@ -1547,7 +1549,7 @@ async def search( :arg max_concurrent_shard_requests: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests Default: 5 + to limit the number of concurrent shard requests Default: 5 :arg pre_filter_shard_size: A threshold that enforces a pre- filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the @@ -1565,7 +1567,7 @@ async def search( :arg routing: A comma-separated list of specific routing values :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg seq_no_primary_term: Specify whether to return sequence number and primary term of the last modification of each hit @@ -1576,8 +1578,8 @@ async def search( :arg stored_fields: A comma-separated list of stored fields to return as part of a hit :arg suggest_field: Specify which field to use for suggestions - :arg suggest_mode: Specify suggest mode Valid choices: - missing, popular, always Default: missing + :arg suggest_mode: Specify suggest mode Valid choices: missing, + popular, always Default: missing :arg suggest_size: How many suggestions to return in response :arg suggest_text: The source text for which the suggestions should be returned @@ -1626,8 +1628,8 @@ async def search_shards(self, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state @@ -1672,10 +1674,10 @@ async def search_template( string or when no indices have been specified) :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg explain: Specify whether to return detailed information about score computation as part of a hit :arg ignore_throttled: Whether specified concrete, expanded or @@ -1690,7 +1692,7 @@ async def search_template( :arg routing: A comma-separated list of specific routing values :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1736,7 +1738,7 @@ async def termvectors( should be supplied. :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be - returned. Default: True + returned. Default: True :arg fields: A comma-separated list of fields to return. :arg offsets: Specifies if term offsets should be returned. Default: True @@ -1752,7 +1754,7 @@ async def termvectors( :arg term_statistics: Specifies if total term frequency and document frequency should be returned. :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ if index in SKIP_IN_PATH: @@ -1806,7 +1808,7 @@ async def update(self, index, id, body, doc_type=None, params=None, headers=None :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg retry_on_conflict: Specify how many times should the operation be retried when a conflict occurs (default: 0) :arg routing: Specific routing value @@ -1893,14 +1895,14 @@ async def update_by_query( queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg conflicts: What to do when the update by query hits version - conflicts? Valid choices: abort, proceed Default: abort + conflicts? Valid choices: abort, proceed Default: abort :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg from_: Starting offset (default: 0) :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1922,15 +1924,15 @@ async def update_by_query( :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search :arg scroll_size: Size on the scroll request powering the update - by query Default: 100 + by query Default: 100 :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg size: Deprecated, please use `max_docs` instead :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg sort: A comma-separated list of : pairs :arg stats: Specific 'tag' of the request for logging and statistical purposes @@ -1938,7 +1940,7 @@ async def update_by_query( for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg version: Specify whether to return document version as part of a hit :arg version_type: Should the document increment the version @@ -1950,7 +1952,7 @@ async def update_by_query( or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the update by query operation is complete. Default: True + the update by query operation is complete. Default: True """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 9b27fc9ef..14f64131d 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -1276,7 +1276,7 @@ async def reload_search_analyzers(self, index, params=None, headers=None): ) @query_params() - async def create_data_stream(self, name, body, params=None, headers=None): + async def create_data_stream(self, name, body=None, params=None, headers=None): """ Creates or updates a data stream ``_ @@ -1284,9 +1284,8 @@ async def create_data_stream(self, name, body, params=None, headers=None): :arg name: The name of the data stream :arg body: The data stream definition """ - for param in (name, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'name'.") return await self.transport.perform_request( "PUT", diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index d8e27711e..7837a51f9 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -318,7 +318,7 @@ async def flush_job(self, job_id, body=None, params=None, headers=None): body=body, ) - @query_params("duration", "expires_in") + @query_params("duration", "expires_in", "max_model_memory") async def forecast(self, job_id, params=None, headers=None): """ Predicts the future behavior of a time series by using its historical behavior. @@ -328,6 +328,8 @@ async def forecast(self, job_id, params=None, headers=None): :arg duration: The duration of the forecast :arg expires_in: The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. + :arg max_model_memory: The max memory able to be used by the + forecast. Default is 20mb. """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") @@ -1396,6 +1398,7 @@ async def explain_data_frame_analytics( @query_params( "allow_no_match", "decompress_definition", + "for_export", "from_", "include_model_definition", "size", @@ -1413,6 +1416,8 @@ async def get_trained_models(self, model_id=None, params=None, headers=None): :arg decompress_definition: Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. Default: True + :arg for_export: Omits fields that are illegal to set on model + PUT :arg from_: skips a number of trained models :arg include_model_definition: Should the full model definition be included in the results. These definitions can be large. So be diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 366a28935..6a9e8b844 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -87,7 +87,8 @@ async def delete_repository(self, repository, params=None, headers=None): Deletes a repository. ``_ - :arg repository: A comma-separated list of repository names + :arg repository: Name of the snapshot repository to unregister. + Wildcard (`*`) patterns are supported. :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 639b9466a..3a1e2e99d 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -293,11 +293,11 @@ def create(self, index, id, body, doc_type=None, params=None, headers=None): :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults @@ -347,17 +347,17 @@ def index(self, index, body, doc_type=None, id=None, params=None, headers=None): number :arg op_type: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests - without an explicit document ID Valid choices: index, create + without an explicit document ID Valid choices: index, create :arg pipeline: The pipeline id to preprocess incoming documents with :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults @@ -412,7 +412,7 @@ def bulk(self, body, index=None, doc_type=None, params=None, headers=None): :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg wait_for_active_shards: Sets the number of shard copies @@ -488,12 +488,12 @@ def count(self, body=None, index=None, doc_type=None, params=None, headers=None) queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled :arg ignore_unavailable: Whether specified concrete indices @@ -544,11 +544,11 @@ def delete(self, index, id, doc_type=None, params=None, headers=None): :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg routing: Specific routing value :arg timeout: Explicit operation timeout :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the delete operation. @@ -625,14 +625,14 @@ def delete_by_query(self, index, body, doc_type=None, params=None, headers=None) queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg conflicts: What to do when the delete by query hits version - conflicts? Valid choices: abort, proceed Default: abort + conflicts? Valid choices: abort, proceed Default: abort :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg from_: Starting offset (default: 0) :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -652,15 +652,15 @@ def delete_by_query(self, index, body, doc_type=None, params=None, headers=None) :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search :arg scroll_size: Size on the scroll request powering the delete - by query Default: 100 + by query Default: 100 :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg size: Deprecated, please use `max_docs` instead :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg sort: A comma-separated list of : pairs :arg stats: Specific 'tag' of the request for logging and statistical purposes @@ -668,7 +668,7 @@ def delete_by_query(self, index, body, doc_type=None, params=None, headers=None) for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg version: Specify whether to return document version as part of a hit :arg wait_for_active_shards: Sets the number of shard copies @@ -678,7 +678,7 @@ def delete_by_query(self, index, body, doc_type=None, params=None, headers=None) or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the delete by query is complete. Default: True + the delete by query is complete. Default: True """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -771,7 +771,7 @@ def exists(self, index, id, doc_type=None, params=None, headers=None): :arg stored_fields: A comma-separated list of stored fields to return in the response :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -819,18 +819,20 @@ def exists_source(self, index, id, doc_type=None, params=None, headers=None): performing the operation :arg routing: Specific routing value :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") + if doc_type in SKIP_IN_PATH: + path = _make_path(index, "_source", id) + else: + path = _make_path(index, doc_type, id, "_source") + return self.transport.perform_request( - "HEAD", - _make_path(index, doc_type, id, "_source"), - params=params, - headers=headers, + "HEAD", path, params=params, headers=headers ) @query_params( @@ -866,7 +868,7 @@ def explain(self, index, id, body=None, doc_type=None, params=None, headers=None queries in the query string query should be analyzed (default: false) :arg analyzer: The analyzer for the query string query :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The default field for query string query (default: _all) :arg lenient: Specify whether format-based query failures (such @@ -910,8 +912,8 @@ def field_caps(self, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg fields: A comma-separated list of field names :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -959,7 +961,7 @@ def get(self, index, id, doc_type=None, params=None, headers=None): :arg stored_fields: A comma-separated list of stored fields to return in the response :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -1023,7 +1025,7 @@ def get_source(self, index, id, doc_type=None, params=None, headers=None): performing the operation :arg routing: Specific routing value :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ for param in (index, id): @@ -1108,13 +1110,13 @@ def msearch(self, body, index=None, doc_type=None, params=None, headers=None): as default :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg max_concurrent_searches: Controls the maximum number of concurrent searches the multi search api will execute :arg max_concurrent_shard_requests: The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests Default: 5 + order to limit the number of concurrent shard requests Default: 5 :arg pre_filter_shard_size: A threshold that enforces a pre- filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the @@ -1124,7 +1126,7 @@ def msearch(self, body, index=None, doc_type=None, params=None, headers=None): shard bounds and the query are disjoint. :arg rest_total_hits_as_int: Indicates whether hits.total should be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1164,12 +1166,12 @@ def msearch_template( as default :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg max_concurrent_searches: Controls the maximum number of concurrent searches the multi search api will execute :arg rest_total_hits_as_int: Indicates whether hits.total should be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1216,7 +1218,7 @@ def mtermvectors( :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified - in body "params" or "docs". Default: True + in body "params" or "docs". Default: True :arg fields: A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". @@ -1224,13 +1226,13 @@ def mtermvectors( define ids as parameter or set "ids" or "docs" in the request body :arg offsets: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg payloads: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg positions: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + "params" or "docs". Default: True :arg preference: Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". @@ -1242,7 +1244,7 @@ def mtermvectors( document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ if doc_type in SKIP_IN_PATH: @@ -1295,11 +1297,11 @@ def rank_eval(self, body, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch """ if body in SKIP_IN_PATH: @@ -1341,16 +1343,16 @@ def reindex(self, body, params=None, headers=None): Default: 5m :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg wait_for_active_shards: Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the reindex is complete. Default: True + the reindex is complete. Default: True """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1501,7 +1503,7 @@ def search(self, body=None, index=None, doc_type=None, params=None, headers=None expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout Default: + be returned if there is a partial search failure or timeout Default: True :arg analyze_wildcard: Specify whether wildcard and prefix queries should be analyzed (default: false) @@ -1513,16 +1515,16 @@ def search(self, body=None, index=None, doc_type=None, params=None, headers=None Default: 512 :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg docvalue_fields: A comma-separated list of fields to return as the docvalue representation of a field for each hit :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg explain: Specify whether to return detailed information about score computation as part of a hit :arg from_: Starting offset (default: 0) @@ -1535,7 +1537,7 @@ def search(self, body=None, index=None, doc_type=None, params=None, headers=None :arg max_concurrent_shard_requests: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests Default: 5 + to limit the number of concurrent shard requests Default: 5 :arg pre_filter_shard_size: A threshold that enforces a pre- filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the @@ -1553,7 +1555,7 @@ def search(self, body=None, index=None, doc_type=None, params=None, headers=None :arg routing: A comma-separated list of specific routing values :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg seq_no_primary_term: Specify whether to return sequence number and primary term of the last modification of each hit @@ -1564,8 +1566,8 @@ def search(self, body=None, index=None, doc_type=None, params=None, headers=None :arg stored_fields: A comma-separated list of stored fields to return as part of a hit :arg suggest_field: Specify which field to use for suggestions - :arg suggest_mode: Specify suggest mode Valid choices: - missing, popular, always Default: missing + :arg suggest_mode: Specify suggest mode Valid choices: missing, + popular, always Default: missing :arg suggest_size: How many suggestions to return in response :arg suggest_text: The source text for which the suggestions should be returned @@ -1614,8 +1616,8 @@ def search_shards(self, index=None, params=None, headers=None): expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state @@ -1660,10 +1662,10 @@ def search_template( string or when no indices have been specified) :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution Default: true :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg explain: Specify whether to return detailed information about score computation as part of a hit :arg ignore_throttled: Whether specified concrete, expanded or @@ -1678,7 +1680,7 @@ def search_template( :arg routing: A comma-separated list of specific routing values :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch :arg typed_keys: Specify whether aggregation and suggester names @@ -1724,7 +1726,7 @@ def termvectors( should be supplied. :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be - returned. Default: True + returned. Default: True :arg fields: A comma-separated list of fields to return. :arg offsets: Specifies if term offsets should be returned. Default: True @@ -1740,7 +1742,7 @@ def termvectors( :arg term_statistics: Specifies if total term frequency and document frequency should be returned. :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: + :arg version_type: Specific version type Valid choices: internal, external, external_gte, force """ if index in SKIP_IN_PATH: @@ -1794,7 +1796,7 @@ def update(self, index, id, body, doc_type=None, params=None, headers=None): :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices: true, false, wait_for :arg retry_on_conflict: Specify how many times should the operation be retried when a conflict occurs (default: 0) :arg routing: Specific routing value @@ -1881,14 +1883,14 @@ def update_by_query( queries should be analyzed (default: false) :arg analyzer: The analyzer to use for the query string :arg conflicts: What to do when the update by query hits version - conflicts? Valid choices: abort, proceed Default: abort + conflicts? Valid choices: abort, proceed Default: abort :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR) Valid choices: AND, OR Default: OR :arg df: The field to use as default where no field prefix is given in the query string :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open :arg from_: Starting offset (default: 0) :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -1910,15 +1912,15 @@ def update_by_query( :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search :arg scroll_size: Size on the scroll request powering the update - by query Default: 100 + by query Default: 100 :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: + :arg search_type: Search operation type Valid choices: query_then_fetch, dfs_query_then_fetch :arg size: Deprecated, please use `max_docs` instead :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default: 1 :arg sort: A comma-separated list of : pairs :arg stats: Specific 'tag' of the request for logging and statistical purposes @@ -1926,7 +1928,7 @@ def update_by_query( for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default: 1m :arg version: Specify whether to return document version as part of a hit :arg version_type: Should the document increment the version @@ -1938,7 +1940,7 @@ def update_by_query( or equal to the total number of copies for the shard (number of replicas + 1) :arg wait_for_completion: Should the request should block until - the update by query operation is complete. Default: True + the update by query operation is complete. Default: True """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 2d426b939..83642903c 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -1272,7 +1272,7 @@ def reload_search_analyzers(self, index, params=None, headers=None): ) @query_params() - def create_data_stream(self, name, body, params=None, headers=None): + def create_data_stream(self, name, body=None, params=None, headers=None): """ Creates or updates a data stream ``_ @@ -1280,9 +1280,8 @@ def create_data_stream(self, name, body, params=None, headers=None): :arg name: The name of the data stream :arg body: The data stream definition """ - for param in (name, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'name'.") return self.transport.perform_request( "PUT", diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index 6f5341e44..192261e72 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -312,7 +312,7 @@ def flush_job(self, job_id, body=None, params=None, headers=None): body=body, ) - @query_params("duration", "expires_in") + @query_params("duration", "expires_in", "max_model_memory") def forecast(self, job_id, params=None, headers=None): """ Predicts the future behavior of a time series by using its historical behavior. @@ -322,6 +322,8 @@ def forecast(self, job_id, params=None, headers=None): :arg duration: The duration of the forecast :arg expires_in: The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. + :arg max_model_memory: The max memory able to be used by the + forecast. Default is 20mb. """ if job_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'job_id'.") @@ -1384,6 +1386,7 @@ def explain_data_frame_analytics( @query_params( "allow_no_match", "decompress_definition", + "for_export", "from_", "include_model_definition", "size", @@ -1401,6 +1404,8 @@ def get_trained_models(self, model_id=None, params=None, headers=None): :arg decompress_definition: Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. Default: True + :arg for_export: Omits fields that are illegal to set on model + PUT :arg from_: skips a number of trained models :arg include_model_definition: Should the full model definition be included in the results. These definitions can be large. So be diff --git a/elasticsearch/client/snapshot.py b/elasticsearch/client/snapshot.py index d4d71e0b7..27c0abdac 100644 --- a/elasticsearch/client/snapshot.py +++ b/elasticsearch/client/snapshot.py @@ -87,7 +87,8 @@ def delete_repository(self, repository, params=None, headers=None): Deletes a repository. ``_ - :arg repository: A comma-separated list of repository names + :arg repository: Name of the snapshot repository to unregister. + Wildcard (`*`) patterns are supported. :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout diff --git a/utils/templates/overrides/__init__/exists_source b/utils/templates/overrides/__init__/exists_source new file mode 100644 index 000000000..0ca1f55e8 --- /dev/null +++ b/utils/templates/overrides/__init__/exists_source @@ -0,0 +1,9 @@ +{% extends "base" %} +{% block request %} + if doc_type in SKIP_IN_PATH: + path = _make_path(index, "_source", id) + else: + path = _make_path(index, doc_type, id, "_source") + + return await self.transport.perform_request("{{ api.method }}", path, params=params, headers=headers) +{% endblock %} \ No newline at end of file