From 25de99a3339d524ec2970c729e7ec43906efa1b8 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 7 Mar 2024 06:06:14 +0000 Subject: [PATCH] Auto-generated API code --- elasticsearch/_async/client/__init__.py | 95 ++++----- elasticsearch/_async/client/async_search.py | 9 +- elasticsearch/_async/client/autoscaling.py | 9 +- elasticsearch/_async/client/cat.py | 53 ++--- elasticsearch/_async/client/ccr.py | 27 +-- elasticsearch/_async/client/cluster.py | 33 ++-- .../_async/client/dangling_indices.py | 7 +- elasticsearch/_async/client/enrich.py | 11 +- elasticsearch/_async/client/eql.py | 9 +- elasticsearch/_async/client/esql.py | 3 +- elasticsearch/_async/client/features.py | 5 +- elasticsearch/_async/client/fleet.py | 3 +- elasticsearch/_async/client/graph.py | 3 +- elasticsearch/_async/client/ilm.py | 23 +-- elasticsearch/_async/client/indices.py | 186 ++++++++++++------ elasticsearch/_async/client/inference.py | 101 ++++++---- elasticsearch/_async/client/ingest.py | 13 +- elasticsearch/_async/client/license.py | 15 +- elasticsearch/_async/client/logstash.py | 7 +- elasticsearch/_async/client/migration.py | 7 +- elasticsearch/_async/client/ml.py | 145 +++++++------- elasticsearch/_async/client/monitoring.py | 3 +- elasticsearch/_async/client/nodes.py | 15 +- elasticsearch/_async/client/query_ruleset.py | 9 +- elasticsearch/_async/client/rollup.py | 17 +- .../_async/client/search_application.py | 17 +- .../_async/client/searchable_snapshots.py | 9 +- elasticsearch/_async/client/security.py | 103 +++++----- elasticsearch/_async/client/shutdown.py | 1 + elasticsearch/_async/client/slm.py | 19 +- elasticsearch/_async/client/snapshot.py | 54 +++-- elasticsearch/_async/client/sql.py | 13 +- elasticsearch/_async/client/ssl.py | 3 +- elasticsearch/_async/client/synonyms.py | 17 +- elasticsearch/_async/client/tasks.py | 7 +- elasticsearch/_async/client/text_structure.py | 60 +++++- elasticsearch/_async/client/transform.py | 23 +-- elasticsearch/_async/client/watcher.py | 23 +-- elasticsearch/_async/client/xpack.py | 4 +- elasticsearch/_sync/client/__init__.py | 95 ++++----- elasticsearch/_sync/client/async_search.py | 9 +- elasticsearch/_sync/client/autoscaling.py | 9 +- elasticsearch/_sync/client/cat.py | 53 ++--- elasticsearch/_sync/client/ccr.py | 27 +-- elasticsearch/_sync/client/cluster.py | 33 ++-- .../_sync/client/dangling_indices.py | 7 +- elasticsearch/_sync/client/enrich.py | 11 +- elasticsearch/_sync/client/eql.py | 9 +- elasticsearch/_sync/client/esql.py | 3 +- elasticsearch/_sync/client/features.py | 5 +- elasticsearch/_sync/client/fleet.py | 3 +- elasticsearch/_sync/client/graph.py | 3 +- elasticsearch/_sync/client/ilm.py | 23 +-- elasticsearch/_sync/client/indices.py | 186 ++++++++++++------ elasticsearch/_sync/client/inference.py | 101 ++++++---- elasticsearch/_sync/client/ingest.py | 13 +- elasticsearch/_sync/client/license.py | 15 +- elasticsearch/_sync/client/logstash.py | 7 +- elasticsearch/_sync/client/migration.py | 7 +- elasticsearch/_sync/client/ml.py | 145 +++++++------- elasticsearch/_sync/client/monitoring.py | 3 +- elasticsearch/_sync/client/nodes.py | 15 +- elasticsearch/_sync/client/query_ruleset.py | 9 +- elasticsearch/_sync/client/rollup.py | 17 +- .../_sync/client/search_application.py | 17 +- .../_sync/client/searchable_snapshots.py | 9 +- elasticsearch/_sync/client/security.py | 103 +++++----- elasticsearch/_sync/client/shutdown.py | 1 + elasticsearch/_sync/client/slm.py | 19 +- elasticsearch/_sync/client/snapshot.py | 54 +++-- elasticsearch/_sync/client/sql.py | 13 +- elasticsearch/_sync/client/ssl.py | 3 +- elasticsearch/_sync/client/synonyms.py | 17 +- elasticsearch/_sync/client/tasks.py | 7 +- elasticsearch/_sync/client/text_structure.py | 60 +++++- elasticsearch/_sync/client/transform.py | 23 +-- elasticsearch/_sync/client/watcher.py | 23 +-- elasticsearch/_sync/client/xpack.py | 4 +- 78 files changed, 1340 insertions(+), 982 deletions(-) diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 0324d4fbe..cc8b2a40b 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -640,7 +640,7 @@ async def bulk( """ Allows to perform multiple index/update/delete operations in a single request. - ``_ + ``_ :param operations: :param index: Name of the data stream, index, or index alias to perform bulk @@ -730,7 +730,7 @@ async def clear_scroll( """ Explicitly clears the search context for a scroll. - ``_ + ``_ :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`. """ @@ -773,7 +773,7 @@ async def close_point_in_time( """ Close a point in time - ``_ + ``_ :param id: The ID of the point-in-time. """ @@ -840,7 +840,7 @@ async def count( """ Returns number of documents matching a query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this @@ -965,7 +965,7 @@ async def create( Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ + ``_ :param index: Name of the data stream or index to target. If the target doesn’t exist and matches the name or wildcard (`*`) pattern of an index template @@ -1062,7 +1062,7 @@ async def delete( """ Removes a document from the index. - ``_ + ``_ :param index: Name of the target index. :param id: Unique identifier for the document. @@ -1180,7 +1180,7 @@ async def delete_by_query( """ Deletes documents matching the provided query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this @@ -1351,7 +1351,7 @@ async def delete_by_query_rethrottle( """ Changes the number of requests per second for a particular Delete By Query operation. - ``_ + ``_ :param task_id: The ID for the task. :param requests_per_second: The throttle for this request in sub-requests per @@ -1393,7 +1393,7 @@ async def delete_script( """ Deletes a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. :param master_timeout: Period to wait for a connection to the master node. If @@ -1455,7 +1455,7 @@ async def exists( """ Returns information about whether a document exists in an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1550,7 +1550,7 @@ async def exists_source( """ Returns information about whether a document source exists in an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1644,7 +1644,7 @@ async def explain( """ Returns information about why a specific matches (or doesn't match) a query. - ``_ + ``_ :param index: Index names used to limit the request. Only a single index name can be provided to this parameter. @@ -1745,6 +1745,7 @@ async def field_caps( filters: t.Optional[str] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, + include_empty_fields: t.Optional[bool] = None, include_unmapped: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1755,7 +1756,7 @@ async def field_caps( """ Returns the information about the capabilities of fields among multiple indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams @@ -1774,6 +1775,7 @@ async def field_caps( :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. + :param include_empty_fields: If false, empty fields are not included in the response. :param include_unmapped: If true, unmapped fields are included in the response. :param index_filter: Allows to filter indices if the provided query rewrites to match_none on every shard. @@ -1804,6 +1806,8 @@ async def field_caps( __query["human"] = human if ignore_unavailable is not None: __query["ignore_unavailable"] = ignore_unavailable + if include_empty_fields is not None: + __query["include_empty_fields"] = include_empty_fields if include_unmapped is not None: __query["include_unmapped"] = include_unmapped if pretty is not None: @@ -1858,7 +1862,7 @@ async def get( """ Returns a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -1937,7 +1941,7 @@ async def get_script( """ Returns a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. :param master_timeout: Specify timeout for connection to master @@ -1973,7 +1977,7 @@ async def get_script_context( """ Returns all script contexts. - ``_ + ``_ """ __path = "/_script_context" __query: t.Dict[str, t.Any] = {} @@ -2002,7 +2006,7 @@ async def get_script_languages( """ Returns available script types, languages and contexts - ``_ + ``_ """ __path = "/_script_language" __query: t.Dict[str, t.Any] = {} @@ -2051,7 +2055,7 @@ async def get_source( """ Returns the source of a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -2128,7 +2132,7 @@ async def health_report( """ Returns the health of the cluster. - ``_ + ``_ :param feature: A feature of the cluster, as returned by the top-level health report API. @@ -2195,7 +2199,7 @@ async def index( """ Creates or updates a document in an index. - ``_ + ``_ :param index: Name of the data stream or index to target. :param document: @@ -2295,7 +2299,7 @@ async def info( """ Returns basic information about the cluster. - ``_ + ``_ """ __path = "/" __query: t.Dict[str, t.Any] = {} @@ -2345,7 +2349,7 @@ async def knn_search( """ Performs a kNN search. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or to perform the operation on all indices @@ -2438,7 +2442,7 @@ async def mget( """ Allows to get multiple documents in one request. - ``_ + ``_ :param index: Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. @@ -2543,7 +2547,7 @@ async def msearch( """ Allows to execute several search operations in one request. - ``_ + ``_ :param searches: :param index: Comma-separated list of data streams, indices, and index aliases @@ -2657,7 +2661,7 @@ async def msearch_template( """ Allows to execute several search template operations in one request. - ``_ + ``_ :param search_templates: :param index: Comma-separated list of data streams, indices, and aliases to search. @@ -2743,7 +2747,7 @@ async def mtermvectors( """ Returns multiple termvectors in one request. - ``_ + ``_ :param index: Name of the index that contains the documents. :param docs: Array of existing or artificial documents. @@ -2841,7 +2845,7 @@ async def open_point_in_time( """ Open a point in time that can be used in subsequent searches - ``_ + ``_ :param index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices @@ -2907,7 +2911,7 @@ async def put_script( """ Creates or updates a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. Must be unique within the cluster. @@ -2984,7 +2988,7 @@ async def rank_eval( Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ + ``_ :param requests: A set of typical search requests, together with their provided ratings. @@ -3071,7 +3075,7 @@ async def reindex( source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ + ``_ :param dest: The destination you are copying to. :param source: The source you are copying from. @@ -3160,7 +3164,7 @@ async def reindex_rethrottle( """ Changes the number of requests per second for a particular Reindex operation. - ``_ + ``_ :param task_id: Identifier for the task. :param requests_per_second: The throttle for this request in sub-requests per @@ -3205,7 +3209,7 @@ async def render_search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param id: ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. @@ -3264,7 +3268,7 @@ async def scripts_painless_execute( """ Allows an arbitrary script to be executed and a result to be returned - ``_ + ``_ :param context: The context that the script should run in. :param context_setup: Additional parameters for the `context`. @@ -3315,7 +3319,7 @@ async def scroll( """ Allows to retrieve a large numbers of results from a single search request. - ``_ + ``_ :param scroll_id: Scroll ID of the search. :param rest_total_hits_as_int: If true, the API response’s hit.total property @@ -3494,7 +3498,7 @@ async def search( """ Returns results matching a query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this @@ -3896,7 +3900,7 @@ async def search_mvt( Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, or aliases to search :param field: Field containing geospatial data to return @@ -4038,7 +4042,7 @@ async def search_shards( Returns information about the indices and shards that a search request would be executed against. - ``_ + ``_ :param index: Returns the indices and shards that a search request would be executed against. @@ -4131,7 +4135,7 @@ async def search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). @@ -4256,7 +4260,7 @@ async def terms_enum( the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported. @@ -4348,7 +4352,7 @@ async def termvectors( Returns information and statistics about terms in the fields of a particular document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -4481,7 +4485,7 @@ async def update( """ Updates a document with a script or partial document. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -4637,10 +4641,11 @@ async def update_by_query( body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ - Performs an update on every document in the index without changing the source, - for example to pick up a mapping change. + Updates documents that match the specified query. If no query is specified, performs + an update on every document in the index without changing the source, for example + to pick up a mapping change. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this @@ -4826,7 +4831,7 @@ async def update_by_query_rethrottle( """ Changes the number of requests per second for a particular Update By Query operation. - ``_ + ``_ :param task_id: The ID for the task. :param requests_per_second: The throttle for this request in sub-requests per diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py index ce6da8a18..a24e9ded3 100644 --- a/elasticsearch/_async/client/async_search.py +++ b/elasticsearch/_async/client/async_search.py @@ -24,6 +24,7 @@ class AsyncSearchClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, @@ -38,7 +39,7 @@ async def delete( 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. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -78,7 +79,7 @@ async def get( Retrieves the results of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. :param keep_alive: Specifies how long the async search should be available in @@ -133,7 +134,7 @@ async def status( Retrieves the status of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -299,7 +300,7 @@ async def submit( """ Executes a search request asynchronously. - ``_ + ``_ :param 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/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py index 4a569d190..0217821e3 100644 --- a/elasticsearch/_async/client/autoscaling.py +++ b/elasticsearch/_async/client/autoscaling.py @@ -24,6 +24,7 @@ class AutoscalingClient(NamespacedClient): + @_rewrite_parameters() async def delete_autoscaling_policy( self, @@ -38,7 +39,7 @@ async def delete_autoscaling_policy( Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -72,7 +73,7 @@ async def get_autoscaling_capacity( Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ """ __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} @@ -103,7 +104,7 @@ async def get_autoscaling_policy( Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -142,7 +143,7 @@ async def put_autoscaling_policy( Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy :param policy: diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index 7c72d0984..f0de2a115 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -24,6 +24,7 @@ class CatClient(NamespacedClient): + @_rewrite_parameters() async def aliases( self, @@ -55,7 +56,7 @@ async def aliases( Shows information about currently configured aliases to indices including filter and routing infos. - ``_ + ``_ :param name: A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. @@ -136,7 +137,7 @@ async def allocation( Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ + ``_ :param node_id: Comma-separated list of node identifiers or names used to limit the returned information. @@ -212,7 +213,7 @@ async def component_templates( """ Returns information about existing component_templates templates. - ``_ + ``_ :param name: The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned. @@ -286,7 +287,7 @@ async def count( Provides quick access to the document count of the entire cluster, or individual indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -364,7 +365,7 @@ async def fielddata( Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ + ``_ :param fields: Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. @@ -443,7 +444,7 @@ async def health( """ Returns a concise representation of the cluster health. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -516,7 +517,7 @@ async def help( """ Returns help for the Cat APIs. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -602,7 +603,7 @@ async def indices( Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -695,7 +696,7 @@ async def master( """ Returns information about the master node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -794,7 +795,7 @@ async def ml_data_frame_analytics( """ Gets configuration and usage information about data frame analytics jobs. - ``_ + ``_ :param id: The ID of the data frame analytics to fetch :param allow_no_match: Whether to ignore if a wildcard expression matches no @@ -905,7 +906,7 @@ async def ml_datafeeds( """ Gets configuration and usage information about datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. @@ -1022,7 +1023,7 @@ async def ml_jobs( """ Gets configuration and usage information about anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param allow_no_match: Specifies what to do when the request: * Contains wildcard @@ -1142,7 +1143,7 @@ async def ml_trained_models( """ Gets configuration and usage information about inference trained models. - ``_ + ``_ :param model_id: A unique identifier for the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -1230,7 +1231,7 @@ async def nodeattrs( """ Returns information about custom node attributes. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1302,7 +1303,7 @@ async def nodes( """ Returns basic statistics about performance of cluster nodes. - ``_ + ``_ :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set @@ -1380,7 +1381,7 @@ async def pending_tasks( """ Returns a concise representation of the cluster pending tasks. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1447,7 +1448,7 @@ async def plugins( """ Returns information about installed plugins across nodes node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1520,7 +1521,7 @@ async def recovery( """ Returns information about index shard recoveries, both on-going completed. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1603,7 +1604,7 @@ async def repositories( """ Returns information about snapshot repositories registered in the cluster. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1674,7 +1675,7 @@ async def segments( """ Provides low-level information about the segments in the shards of an index. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1754,7 +1755,7 @@ async def shards( """ Provides a detailed view of shard allocation on nodes. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1832,7 +1833,7 @@ async def snapshots( """ Returns all snapshots in a specific repository. - ``_ + ``_ :param repository: A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. @@ -1914,7 +1915,7 @@ async def tasks( Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ + ``_ :param actions: The task action names, which are used to limit the response. :param detailed: If `true`, the response includes detailed information about @@ -1996,7 +1997,7 @@ async def templates( """ Returns information about existing templates. - ``_ + ``_ :param name: The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. @@ -2073,7 +2074,7 @@ async def thread_pool( Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ + ``_ :param thread_pool_patterns: A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. @@ -2183,7 +2184,7 @@ async def transforms( """ Gets configuration and usage information about transforms. - ``_ + ``_ :param transform_id: A transform identifier or a wildcard expression. If you do not specify one of these options, the API returns information for all diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py index 33e121a4c..7c65dbeac 100644 --- a/elasticsearch/_async/client/ccr.py +++ b/elasticsearch/_async/client/ccr.py @@ -24,6 +24,7 @@ class CcrClient(NamespacedClient): + @_rewrite_parameters() async def delete_auto_follow_pattern( self, @@ -37,7 +38,7 @@ async def delete_auto_follow_pattern( """ Deletes auto-follow patterns. - ``_ + ``_ :param name: The name of the auto follow pattern. """ @@ -106,7 +107,7 @@ async def follow( """ Creates a new follower index configured to follow the referenced leader index. - ``_ + ``_ :param index: The name of the follower index :param leader_index: @@ -191,7 +192,7 @@ async def follow_info( Retrieves information about all follower indices, including parameters and status for each follower index - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -227,7 +228,7 @@ async def follow_stats( Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -274,7 +275,7 @@ async def forget_follower( """ Removes the follower retention leases from the leader. - ``_ + ``_ :param index: the name of the leader index for which specified follower retention leases should be removed @@ -324,7 +325,7 @@ async def get_auto_follow_pattern( Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - ``_ + ``_ :param name: Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections. @@ -360,7 +361,7 @@ async def pause_auto_follow_pattern( """ Pauses an auto-follow pattern - ``_ + ``_ :param name: The name of the auto follow pattern that should pause discovering new indices to follow. @@ -396,7 +397,7 @@ async def pause_follow( Pauses a follower index. The follower index will not fetch any additional operations from the leader index. - ``_ + ``_ :param index: The name of the follower index that should pause following its leader index. @@ -471,7 +472,7 @@ async def put_auto_follow_pattern( cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. - ``_ + ``_ :param name: The name of the collection of auto-follow patterns. :param remote_cluster: The remote cluster containing the leader indices to match @@ -588,7 +589,7 @@ async def resume_auto_follow_pattern( """ Resumes an auto-follow pattern that has been paused - ``_ + ``_ :param name: The name of the auto follow pattern to resume discovering new indices to follow. @@ -651,7 +652,7 @@ async def resume_follow( """ Resumes a follower index that has been paused - ``_ + ``_ :param index: The name of the follow index to resume following. :param max_outstanding_read_requests: @@ -726,7 +727,7 @@ async def stats( """ Gets all stats related to cross-cluster replication. - ``_ + ``_ """ __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} @@ -757,7 +758,7 @@ async def unfollow( Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. - ``_ + ``_ :param index: The name of the follower index that should be turned into a regular index. diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index bdf76c27e..4ab157c66 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -24,6 +24,7 @@ class ClusterClient(NamespacedClient): + @_rewrite_parameters( body_fields=("current_node", "index", "primary", "shard"), ) @@ -45,7 +46,7 @@ async def allocation_explain( """ Provides explanations for shard allocations in the cluster. - ``_ + ``_ :param current_node: Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. @@ -109,7 +110,7 @@ async def delete_component_template( """ Deletes a component template - ``_ + ``_ :param name: Comma-separated list or wildcard expression of component template names used to limit the request. @@ -153,7 +154,7 @@ async def delete_voting_config_exclusions( """ Clears cluster voting config exclusions. - ``_ + ``_ :param wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions @@ -196,7 +197,7 @@ async def exists_component_template( """ Returns information about whether a particular component template exist - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (*) expressions are supported. @@ -247,7 +248,7 @@ async def get_component_template( """ Returns one or more component templates - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (`*`) expressions are supported. @@ -304,7 +305,7 @@ async def get_settings( """ Returns cluster settings. - ``_ + ``_ :param flat_settings: If `true`, returns settings in flat format. :param include_defaults: If `true`, returns default cluster settings from the @@ -382,7 +383,7 @@ async def health( """ Returns basic information about the health of the cluster. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target @@ -480,7 +481,7 @@ async def info( """ Returns different information about the cluster. - ``_ + ``_ :param target: Limits the information returned to the specific target. Supports a comma-separated list, such as http,ingest. @@ -519,7 +520,7 @@ async def pending_tasks( Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ + ``_ :param local: If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the master node. @@ -561,7 +562,7 @@ async def post_voting_config_exclusions( """ Updates the cluster voting config exclusions by node ids or node names. - ``_ + ``_ :param node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify @@ -619,7 +620,7 @@ async def put_component_template( """ Creates or updates a component template - ``_ + ``_ :param name: Name of the component template to create. Elasticsearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; @@ -705,7 +706,7 @@ async def put_settings( """ Updates the cluster settings. - ``_ + ``_ :param flat_settings: Return settings in flat format (default: false) :param master_timeout: Explicit operation timeout for connection to master node @@ -752,7 +753,7 @@ async def remote_info( """ Returns the information about configured remote clusters. - ``_ + ``_ """ __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} @@ -793,7 +794,7 @@ async def reroute( """ Allows to manually change the allocation of individual shards in the cluster. - ``_ + ``_ :param commands: Defines the commands to perform. :param dry_run: If true, then the request simulates the operation only and returns @@ -877,7 +878,7 @@ async def state( """ Returns a comprehensive information about the state of the cluster. - ``_ + ``_ :param metric: Limit the information returned to the specified metrics :param index: A comma-separated list of index names; use `_all` or empty string @@ -951,7 +952,7 @@ async def stats( """ Returns high-level overview of cluster statistics. - ``_ + ``_ :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. diff --git a/elasticsearch/_async/client/dangling_indices.py b/elasticsearch/_async/client/dangling_indices.py index c3ae86410..7dc8543ee 100644 --- a/elasticsearch/_async/client/dangling_indices.py +++ b/elasticsearch/_async/client/dangling_indices.py @@ -24,6 +24,7 @@ class DanglingIndicesClient(NamespacedClient): + @_rewrite_parameters() async def delete_dangling_index( self, @@ -42,7 +43,7 @@ async def delete_dangling_index( """ Deletes the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to delete the dangling @@ -93,7 +94,7 @@ async def import_dangling_index( """ Imports the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to import the dangling @@ -138,7 +139,7 @@ async def list_dangling_indices( """ Returns all dangling indices. - ``_ + ``_ """ __path = "/_dangling" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/enrich.py b/elasticsearch/_async/client/enrich.py index 65fbc6885..174fc17ba 100644 --- a/elasticsearch/_async/client/enrich.py +++ b/elasticsearch/_async/client/enrich.py @@ -24,6 +24,7 @@ class EnrichClient(NamespacedClient): + @_rewrite_parameters() async def delete_policy( self, @@ -37,7 +38,7 @@ async def delete_policy( """ Deletes an existing enrich policy and its enrich index. - ``_ + ``_ :param name: Enrich policy to delete. """ @@ -72,7 +73,7 @@ async def execute_policy( """ Creates the enrich index for an existing enrich policy. - ``_ + ``_ :param name: Enrich policy to execute. :param wait_for_completion: If `true`, the request blocks other enrich policy @@ -110,7 +111,7 @@ async def get_policy( """ Gets information about an enrich policy. - ``_ + ``_ :param name: Comma-separated list of enrich policy names used to limit the request. To return information for all enrich policies, omit this parameter. @@ -152,7 +153,7 @@ async def put_policy( """ Creates a new enrich policy. - ``_ + ``_ :param name: Name of the enrich policy to create or update. :param geo_match: Matches enrich data to incoming documents based on a `geo_shape` @@ -199,7 +200,7 @@ async def stats( Gets enrich coordinator statistics and information about enrich policies that are currently executing. - ``_ + ``_ """ __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py index da3580f92..df6f8d1b3 100644 --- a/elasticsearch/_async/client/eql.py +++ b/elasticsearch/_async/client/eql.py @@ -24,6 +24,7 @@ class EqlClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, @@ -38,7 +39,7 @@ async def delete( Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ :param id: Identifier for the search to delete. A search ID is provided in the EQL search API's response for an async search. A search ID is also provided @@ -78,7 +79,7 @@ async def get( """ Returns async results from previously executed Event Query Language (EQL) search - ``_ + ``_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -123,7 +124,7 @@ async def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - ``_ + ``_ :param id: Identifier for the search. """ @@ -205,7 +206,7 @@ async def search( """ Returns results matching a query expressed in Event Query Language (EQL) - ``_ + ``_ :param index: The name of the index to scope the operation :param query: EQL query you wish to run. diff --git a/elasticsearch/_async/client/esql.py b/elasticsearch/_async/client/esql.py index 9fe070f75..4cd50e2e3 100644 --- a/elasticsearch/_async/client/esql.py +++ b/elasticsearch/_async/client/esql.py @@ -24,6 +24,7 @@ class EsqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=("query", "columnar", "filter", "locale", "params"), ignore_deprecated_options={"params"}, @@ -47,7 +48,7 @@ async def query( """ Executes an ESQL request - ``_ + ``_ :param query: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. diff --git a/elasticsearch/_async/client/features.py b/elasticsearch/_async/client/features.py index 6c374e17c..c7c2242a1 100644 --- a/elasticsearch/_async/client/features.py +++ b/elasticsearch/_async/client/features.py @@ -24,6 +24,7 @@ class FeaturesClient(NamespacedClient): + @_rewrite_parameters() async def get_features( self, @@ -37,7 +38,7 @@ async def get_features( Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ + ``_ """ __path = "/_features" __query: t.Dict[str, t.Any] = {} @@ -66,7 +67,7 @@ async def reset_features( """ Resets the internal state of features, usually by deleting system indices - ``_ + ``_ """ __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py index 889b8b328..3f948791b 100644 --- a/elasticsearch/_async/client/fleet.py +++ b/elasticsearch/_async/client/fleet.py @@ -24,6 +24,7 @@ class FleetClient(NamespacedClient): + @_rewrite_parameters() async def global_checkpoints( self, @@ -42,7 +43,7 @@ async def global_checkpoints( Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. - ``_ + ``_ :param index: A single index or index alias that resolves to a single index. :param checkpoints: A comma separated list of previous global checkpoints. When diff --git a/elasticsearch/_async/client/graph.py b/elasticsearch/_async/client/graph.py index fce864005..87ef452ae 100644 --- a/elasticsearch/_async/client/graph.py +++ b/elasticsearch/_async/client/graph.py @@ -24,6 +24,7 @@ class GraphClient(NamespacedClient): + @_rewrite_parameters( body_fields=("connections", "controls", "query", "vertices"), ) @@ -47,7 +48,7 @@ async def explore( Explore extracted and summarized information about the documents and terms in an index. - ``_ + ``_ :param index: Name of the index. :param connections: Specifies or more fields from which you want to extract terms diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py index 5bd6833fc..27fe5090c 100644 --- a/elasticsearch/_async/client/ilm.py +++ b/elasticsearch/_async/client/ilm.py @@ -24,6 +24,7 @@ class IlmClient(NamespacedClient): + @_rewrite_parameters() async def delete_lifecycle( self, @@ -42,7 +43,7 @@ async def delete_lifecycle( Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -92,7 +93,7 @@ async def explain_lifecycle( Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (`*`). To target all data streams and indices, use `*` @@ -151,7 +152,7 @@ async def get_lifecycle( Returns the specified policy definition. Includes the policy version and last modified date. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -194,7 +195,7 @@ async def get_status( """ Retrieves the current index lifecycle management (ILM) status. - ``_ + ``_ """ __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} @@ -230,7 +231,7 @@ async def migrate_to_data_tiers( Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing - ``_ + ``_ :param dry_run: If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. This provides @@ -283,7 +284,7 @@ async def move_to_step( """ Manually moves an index into the specified step and executes that step. - ``_ + ``_ :param index: The name of the index whose lifecycle step is to change :param current_step: @@ -337,7 +338,7 @@ async def put_lifecycle( """ Creates a lifecycle policy - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -389,7 +390,7 @@ async def remove_policy( """ Removes the assigned lifecycle policy and stops managing the specified index - ``_ + ``_ :param index: The name of the index to remove policy on """ @@ -423,7 +424,7 @@ async def retry( """ Retries executing the policy for an index that is in the ERROR step. - ``_ + ``_ :param index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry @@ -461,7 +462,7 @@ async def start( """ Start the index lifecycle management (ILM) plugin. - ``_ + ``_ :param master_timeout: :param timeout: @@ -502,7 +503,7 @@ async def stop( Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin - ``_ + ``_ :param master_timeout: :param timeout: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 69fa9ab04..ccce5b597 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -24,6 +24,7 @@ class IndicesClient(NamespacedClient): + @_rewrite_parameters() async def add_block( self, @@ -52,7 +53,7 @@ async def add_block( """ Adds a block to an index. - ``_ + ``_ :param index: A comma separated list of indices to add a block to :param block: The block to add (one of read, write, read_only or metadata) @@ -131,7 +132,7 @@ async def analyze( Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ + ``_ :param index: Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the @@ -223,7 +224,7 @@ async def clear_cache( """ Clears all or specific caches for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -302,7 +303,7 @@ async def clone( """ Clones an index - ``_ + ``_ :param index: Name of the source index to clone. :param target: Name of the target index to create. @@ -382,7 +383,7 @@ async def close( """ Closes an index. - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. @@ -459,7 +460,7 @@ async def create( """ Creates an index with optional settings and mappings. - ``_ + ``_ :param index: Name of the index you wish to create. :param aliases: Aliases for the index. @@ -523,7 +524,7 @@ async def create_data_stream( """ Creates a data stream - ``_ + ``_ :param name: Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, @@ -569,7 +570,7 @@ async def data_streams_stats( """ Provides statistics on operations happening in a data stream. - ``_ + ``_ :param name: Comma-separated list of data streams used to limit the request. Wildcard expressions (`*`) are supported. To target all data streams in a @@ -624,7 +625,7 @@ async def delete( """ Deletes an index. - ``_ + ``_ :param index: Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. @@ -690,7 +691,7 @@ async def delete_alias( """ Deletes an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). @@ -750,7 +751,7 @@ async def delete_data_lifecycle( """ Deletes the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams @@ -803,7 +804,7 @@ async def delete_data_stream( """ Deletes a data stream. - ``_ + ``_ :param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. @@ -846,7 +847,7 @@ async def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -894,7 +895,7 @@ async def delete_template( """ Deletes an index template. - ``_ + ``_ :param name: The name of the legacy index template to delete. Wildcard (`*`) expressions are supported. @@ -950,7 +951,7 @@ async def disk_usage( """ Analyzes the disk usage of each field of an index or data stream - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single @@ -1017,7 +1018,7 @@ async def downsample( """ Downsample an index - ``_ + ``_ :param index: Name of the time series index to downsample. :param target_index: Name of the index to create. @@ -1075,7 +1076,7 @@ async def exists( """ Returns information about whether a particular index exists. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1147,7 +1148,7 @@ async def exists_alias( """ Returns information about whether a particular alias exists. - ``_ + ``_ :param name: Comma-separated list of aliases to check. Supports wildcards (`*`). :param index: Comma-separated list of data streams or indices used to limit the @@ -1211,7 +1212,7 @@ async def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1256,7 +1257,7 @@ async def exists_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: The comma separated names of the index templates :param flat_settings: Return settings in flat format (default: false) @@ -1305,7 +1306,7 @@ async def explain_data_lifecycle( Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - ``_ + ``_ :param index: The name of the index to explain :param include_defaults: indicates if the API should return the default values @@ -1364,7 +1365,7 @@ async def field_usage_stats( """ Returns the field usage stats for each field of an index - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. @@ -1446,7 +1447,7 @@ async def flush( """ Performs the flush operation on one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to flush. Supports wildcards (`*`). To flush all data streams and indices, omit this @@ -1521,7 +1522,7 @@ async def forcemerge( """ Performs the force merge operation on one or more indices. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1610,7 +1611,7 @@ async def get( """ Returns information about one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. @@ -1693,7 +1694,7 @@ async def get_alias( """ Returns an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). To target all data streams and indices, @@ -1764,7 +1765,7 @@ async def get_data_lifecycle( """ Returns the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: Comma-separated list of data streams to limit the request. Supports wildcards (`*`). To target all data streams, omit this parameter or use `*` @@ -1817,7 +1818,7 @@ async def get_data_stream( """ Returns data streams. - ``_ + ``_ :param name: Comma-separated list of data stream names used to limit the request. Wildcard (`*`) expressions are supported. If omitted, all data streams are @@ -1875,7 +1876,7 @@ async def get_field_mapping( """ Returns mapping for one or more fields. - ``_ + ``_ :param fields: Comma-separated list or wildcard expression of fields used to limit returned information. @@ -1946,7 +1947,7 @@ async def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -2013,7 +2014,7 @@ async def get_mapping( """ Returns mappings for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -2091,7 +2092,7 @@ async def get_settings( """ Returns settings for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -2170,7 +2171,7 @@ async def get_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (`*`) expressions are supported. To return all index templates, @@ -2219,7 +2220,7 @@ async def migrate_to_data_stream( """ Migrates an alias to a data stream - ``_ + ``_ :param name: Name of the index alias to convert to a data stream. """ @@ -2256,7 +2257,7 @@ async def modify_data_stream( """ Modifies a data stream - ``_ + ``_ :param actions: Actions to perform. """ @@ -2311,7 +2312,7 @@ async def open( """ Opens an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). By default, you must explicitly @@ -2380,7 +2381,7 @@ async def promote_data_stream( Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ + ``_ :param name: The name of the data stream """ @@ -2433,7 +2434,7 @@ async def put_alias( """ Creates or updates an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indices @@ -2532,7 +2533,7 @@ async def put_data_lifecycle( """ Updates the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: Comma-separated list of data streams used to limit the request. Supports wildcards (`*`). To target all data streams use `*` or `_all`. @@ -2618,7 +2619,7 @@ async def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name :param composed_of: An ordered list of component template names. Component templates @@ -2744,7 +2745,7 @@ async def put_mapping( """ Updates the index mappings. - ``_ + ``_ :param index: A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. @@ -2868,7 +2869,7 @@ async def put_settings( """ Updates the index settings. - ``_ + ``_ :param settings: :param index: Comma-separated list of data streams, indices, and aliases used @@ -2966,7 +2967,7 @@ async def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. @@ -3043,7 +3044,7 @@ async def recovery( """ Returns information about ongoing index shard recoveries. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3097,7 +3098,7 @@ async def refresh( """ Performs the refresh operation in one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3159,7 +3160,7 @@ async def reload_search_analyzers( """ Reloads an index's search analyzers and their resources. - ``_ + ``_ :param index: A comma-separated list of index names to reload analyzers for :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -3193,6 +3194,75 @@ async def reload_search_analyzers( "POST", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + async def resolve_cluster( + self, + *, + name: t.Union[str, t.Sequence[str]], + allow_no_indices: t.Optional[bool] = None, + error_trace: t.Optional[bool] = None, + expand_wildcards: t.Optional[ + t.Union[ + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] + ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], + ] + ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + ignore_throttled: t.Optional[bool] = None, + ignore_unavailable: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Resolves the specified index expressions to return information about each cluster, + including the local cluster, if included. + + ``_ + + :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, + and data streams to resolve. Resources on remote clusters can be specified + using the ``:`` syntax. + :param allow_no_indices: If false, the request returns an error if any wildcard + expression, index alias, or _all value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting foo*,bar* returns an error if an index starts + with foo but no index starts with bar. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored + when frozen. Defaults to false. + :param ignore_unavailable: If false, the request returns an error if it targets + a missing or closed index. Defaults to false. + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'name'") + __path = f"/_resolve/cluster/{_quote(name)}" + __query: t.Dict[str, t.Any] = {} + if allow_no_indices is not None: + __query["allow_no_indices"] = allow_no_indices + if error_trace is not None: + __query["error_trace"] = error_trace + if expand_wildcards is not None: + __query["expand_wildcards"] = expand_wildcards + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if ignore_throttled is not None: + __query["ignore_throttled"] = ignore_throttled + if ignore_unavailable is not None: + __query["ignore_unavailable"] = ignore_unavailable + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() async def resolve_index( self, @@ -3214,7 +3284,7 @@ async def resolve_index( """ Returns information about any matching indices, aliases, and data streams - ``_ + ``_ :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified @@ -3273,7 +3343,7 @@ async def rollover( Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ + ``_ :param alias: Name of the data stream or index alias to roll over. :param new_index: Name of the index to create. Supports date math. Data streams @@ -3369,7 +3439,7 @@ async def segments( """ Provides low-level information about segments in a Lucene index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3440,7 +3510,7 @@ async def shard_stores( """ Provides store information for shard copies of indices. - ``_ + ``_ :param index: List of data streams, indices, and aliases used to limit the request. :param allow_no_indices: If false, the request returns an error if any wildcard @@ -3505,7 +3575,7 @@ async def shrink( """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ + ``_ :param index: Name of the source index to shrink. :param target: Name of the target index to create. @@ -3594,7 +3664,7 @@ async def simulate_index_template( """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ :param name: Index or template name to simulate :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` @@ -3699,7 +3769,7 @@ async def simulate_template( """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template @@ -3776,7 +3846,7 @@ async def split( """ Allows you to split an existing index into a new index with more primary shards. - ``_ + ``_ :param index: Name of the source index to split. :param target: Name of the target index to create. @@ -3858,7 +3928,7 @@ async def stats( """ Provides statistics on operations happening in an index. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -3954,7 +4024,7 @@ async def unfreeze( Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ + ``_ :param index: Identifier for the index. :param allow_no_indices: If `false`, the request returns an error if any wildcard @@ -4024,7 +4094,7 @@ async def update_aliases( """ Updates index aliases. - ``_ + ``_ :param actions: Actions to perform. :param master_timeout: Period to wait for a connection to the master node. If @@ -4092,7 +4162,7 @@ async def validate_query( """ Allows a user to validate a potentially expensive query without executing it. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this diff --git a/elasticsearch/_async/client/inference.py b/elasticsearch/_async/client/inference.py index 9269f7a42..b8593afa7 100644 --- a/elasticsearch/_async/client/inference.py +++ b/elasticsearch/_async/client/inference.py @@ -24,12 +24,15 @@ class InferenceClient(NamespacedClient): + @_rewrite_parameters() async def delete_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -38,16 +41,19 @@ async def delete_model( """ Delete model in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace @@ -66,8 +72,10 @@ async def delete_model( async def get_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -76,16 +84,19 @@ async def get_model( """ Get a model in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace @@ -106,9 +117,11 @@ async def get_model( async def inference( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, input: t.Optional[t.Union[str, t.Sequence[str]]] = None, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -119,20 +132,23 @@ async def inference( """ Perform inference on a model - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id :param input: Text input to the model. Either a string or an array of strings. + :param task_type: The task type :param task_settings: Optional task settings """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") if input is None and body is None: raise ValueError("Empty value passed for parameter 'input'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: @@ -163,8 +179,10 @@ async def inference( async def put_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -175,23 +193,26 @@ async def put_model( """ Configure a model for use in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type :param model_config: """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") if model_config is None and body is None: raise ValueError( "Empty value passed for parameters 'model_config' and 'body', one of them should be set." ) elif model_config is not None and body is not None: raise ValueError("Cannot set both 'model_config' and 'body'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index 7e9293477..4f755f291 100644 --- a/elasticsearch/_async/client/ingest.py +++ b/elasticsearch/_async/client/ingest.py @@ -24,6 +24,7 @@ class IngestClient(NamespacedClient): + @_rewrite_parameters() async def delete_pipeline( self, @@ -41,7 +42,7 @@ async def delete_pipeline( """ Deletes a pipeline. - ``_ + ``_ :param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of `*`. @@ -84,7 +85,7 @@ async def geo_ip_stats( """ Returns statistical information about geoip databases - ``_ + ``_ """ __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} @@ -118,7 +119,7 @@ async def get_pipeline( """ Returns a pipeline. - ``_ + ``_ :param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions are supported. To get all ingest pipelines, omit this parameter or use `*`. @@ -161,7 +162,7 @@ async def processor_grok( """ Returns a list of the built-in patterns. - ``_ + ``_ """ __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} @@ -205,7 +206,7 @@ async def put_pipeline( """ Creates or updates a pipeline. - ``_ + ``_ :param id: ID of the ingest pipeline to create or update. :param description: Description of the ingest pipeline. @@ -284,7 +285,7 @@ async def simulate( """ Allows to simulate a pipeline with example documents. - ``_ + ``_ :param id: Pipeline to test. If you don’t specify a `pipeline` in the request body, this parameter is required. diff --git a/elasticsearch/_async/client/license.py b/elasticsearch/_async/client/license.py index 889b58b4e..d9b271c86 100644 --- a/elasticsearch/_async/client/license.py +++ b/elasticsearch/_async/client/license.py @@ -24,6 +24,7 @@ class LicenseClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, @@ -36,7 +37,7 @@ async def delete( """ Deletes licensing information for the cluster - ``_ + ``_ """ __path = "/_license" __query: t.Dict[str, t.Any] = {} @@ -67,7 +68,7 @@ async def get( """ Retrieves licensing information for the cluster - ``_ + ``_ :param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum @@ -107,7 +108,7 @@ async def get_basic_status( """ Retrieves information about the status of the basic license. - ``_ + ``_ """ __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} @@ -136,7 +137,7 @@ async def get_trial_status( """ Retrieves information about the status of the trial license. - ``_ + ``_ """ __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} @@ -171,7 +172,7 @@ async def post( """ Updates the license for the cluster. - ``_ + ``_ :param acknowledge: Specifies whether you acknowledge the license changes. :param license: @@ -218,7 +219,7 @@ async def post_start_basic( """ Starts an indefinite basic license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) @@ -254,7 +255,7 @@ async def post_start_trial( """ starts a limited time trial license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) diff --git a/elasticsearch/_async/client/logstash.py b/elasticsearch/_async/client/logstash.py index d629fbeed..fad83e720 100644 --- a/elasticsearch/_async/client/logstash.py +++ b/elasticsearch/_async/client/logstash.py @@ -24,6 +24,7 @@ class LogstashClient(NamespacedClient): + @_rewrite_parameters() async def delete_pipeline( self, @@ -37,7 +38,7 @@ async def delete_pipeline( """ Deletes Logstash Pipelines used by Central Management - ``_ + ``_ :param id: Identifier for the pipeline. """ @@ -71,7 +72,7 @@ async def get_pipeline( """ Retrieves Logstash Pipelines used by Central Management - ``_ + ``_ :param id: Comma-separated list of pipeline identifiers. """ @@ -110,7 +111,7 @@ async def put_pipeline( """ Adds and updates Logstash Pipelines used for Central Management - ``_ + ``_ :param id: Identifier for the pipeline. :param pipeline: diff --git a/elasticsearch/_async/client/migration.py b/elasticsearch/_async/client/migration.py index efea85d47..76d77ddf5 100644 --- a/elasticsearch/_async/client/migration.py +++ b/elasticsearch/_async/client/migration.py @@ -24,6 +24,7 @@ class MigrationClient(NamespacedClient): + @_rewrite_parameters() async def deprecations( self, @@ -39,7 +40,7 @@ async def deprecations( that use deprecated features that will be removed or changed in the next major version. - ``_ + ``_ :param index: Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported. @@ -74,7 +75,7 @@ async def get_feature_upgrade_status( """ Find out whether system features need to be upgraded or not - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} @@ -103,7 +104,7 @@ async def post_feature_upgrade( """ Begin upgrades for system features - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 5b937222d..03c274566 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -24,6 +24,7 @@ class MlClient(NamespacedClient): + @_rewrite_parameters() async def clear_trained_model_deployment_cache( self, @@ -37,7 +38,7 @@ async def clear_trained_model_deployment_cache( """ Clear the cached results from a trained model deployment - ``_ + ``_ :param model_id: The unique identifier of the trained model. """ @@ -78,7 +79,7 @@ async def close_job( Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection @@ -132,7 +133,7 @@ async def delete_calendar( """ Deletes a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. """ @@ -167,7 +168,7 @@ async def delete_calendar_event( """ Deletes scheduled events from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param event_id: Identifier for the scheduled event. You can obtain this identifier @@ -206,7 +207,7 @@ async def delete_calendar_job( """ Deletes anomaly detection jobs from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -246,7 +247,7 @@ async def delete_data_frame_analytics( """ Deletes an existing data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param force: If `true`, it deletes a job that is not stopped; this method is @@ -288,7 +289,7 @@ async def delete_datafeed( """ Deletes an existing datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -334,7 +335,7 @@ async def delete_expired_data( """ Deletes expired and unused machine learning data. - ``_ + ``_ :param job_id: Identifier for an anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. @@ -384,7 +385,7 @@ async def delete_filter( """ Deletes a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. """ @@ -421,7 +422,7 @@ async def delete_forecast( """ Deletes forecasts from a machine learning job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param forecast_id: A comma-separated list of forecast identifiers. If you do @@ -477,7 +478,7 @@ async def delete_job( """ Deletes an existing anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param delete_user_annotations: Specifies whether annotations that have been @@ -525,7 +526,7 @@ async def delete_model_snapshot( """ Deletes an existing model snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -564,7 +565,7 @@ async def delete_trained_model( Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param force: Forcefully deletes a trained model that is referenced by ingest @@ -603,7 +604,7 @@ async def delete_trained_model_alias( """ Deletes a model alias that refers to the trained model - ``_ + ``_ :param model_id: The trained model ID to which the model alias refers. :param model_alias: The model alias to delete. @@ -649,7 +650,7 @@ async def estimate_model_memory( """ Estimates the model memory - ``_ + ``_ :param analysis_config: For a list of the properties that you can specify in the `analysis_config` component of the body of this API. @@ -707,7 +708,7 @@ async def evaluate_data_frame( """ Evaluates the data frame analytics for an annotated index. - ``_ + ``_ :param evaluation: Defines the type of evaluation you want to perform. :param index: Defines the `index` in which the evaluation will be performed. @@ -774,7 +775,7 @@ async def explain_data_frame_analytics( """ Explains a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -865,7 +866,7 @@ async def flush_job( """ Forces any buffered data to be processed by the job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param advance_time: Refer to the description for the `advance_time` query parameter. @@ -926,7 +927,7 @@ async def forecast( """ Predicts the future behavior of a time series by using its historical behavior. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs. @@ -1001,7 +1002,7 @@ async def get_buckets( """ Retrieves anomaly detection job results for one or more buckets. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timestamp: The timestamp of a single bucket result. If you do not specify @@ -1087,7 +1088,7 @@ async def get_calendar_events( """ Retrieves information about the scheduled events in calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1147,7 +1148,7 @@ async def get_calendars( """ Retrieves configuration information for calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1211,7 +1212,7 @@ async def get_categories( """ Retrieves anomaly detection job results for one or more categories. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param category_id: Identifier for the category, which is unique in the job. @@ -1279,7 +1280,7 @@ async def get_data_frame_analytics( """ Retrieves configuration information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1343,7 +1344,7 @@ async def get_data_frame_analytics_stats( """ Retrieves usage information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1400,7 +1401,7 @@ async def get_datafeed_stats( """ Retrieves usage information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1448,7 +1449,7 @@ async def get_datafeeds( """ Retrieves configuration information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1503,7 +1504,7 @@ async def get_filters( """ Retrieves filters. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param from_: Skips the specified number of filters. @@ -1557,7 +1558,7 @@ async def get_influencers( """ Retrieves anomaly detection job results for one or more influencers. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: If true, the results are sorted in descending order. @@ -1631,7 +1632,7 @@ async def get_job_stats( """ Retrieves usage information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If @@ -1680,7 +1681,7 @@ async def get_jobs( """ Retrieves configuration information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these @@ -1735,7 +1736,7 @@ async def get_memory_stats( """ Returns information on how ML is using memory. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. For example, `nodeId1,nodeId2` or `ml:true` @@ -1782,7 +1783,7 @@ async def get_model_snapshot_upgrade_stats( """ Gets stats for anomaly detection job model snapshot upgrades that are in progress. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1844,7 +1845,7 @@ async def get_model_snapshots( """ Retrieves information about model snapshots. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1934,7 +1935,7 @@ async def get_overall_buckets( Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. @@ -2022,7 +2023,7 @@ async def get_records( """ Retrieves anomaly records for an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: Refer to the description for the `desc` query parameter. @@ -2104,7 +2105,7 @@ async def get_trained_models( """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: - Contains wildcard @@ -2176,7 +2177,7 @@ async def get_trained_models_stats( """ Retrieves usage information for trained inference models. - ``_ + ``_ :param model_id: The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression. @@ -2231,7 +2232,7 @@ async def infer_trained_model( """ Evaluate a trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param docs: An array of objects to pass to the model for inference. The objects @@ -2281,7 +2282,7 @@ async def info( """ Returns defaults and limits used by machine learning. - ``_ + ``_ """ __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} @@ -2315,7 +2316,7 @@ async def open_job( """ Opens one or more anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timeout: Refer to the description for the `timeout` query parameter. @@ -2362,7 +2363,7 @@ async def post_calendar_events( """ Posts scheduled events in a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param events: A list of one of more scheduled events. The event’s start and @@ -2411,7 +2412,7 @@ async def post_data( """ Sends data to an anomaly detection job for analysis. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. @@ -2467,7 +2468,7 @@ async def preview_data_frame_analytics( """ Previews that will be analyzed given a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param config: A data frame analytics config as described in create data frame @@ -2520,7 +2521,7 @@ async def preview_datafeed( """ Previews a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -2587,7 +2588,7 @@ async def put_calendar( """ Instantiates a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param description: A description of the calendar. @@ -2634,7 +2635,7 @@ async def put_calendar_job( """ Adds an anomaly detection job to a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -2697,7 +2698,7 @@ async def put_data_frame_analytics( """ Instantiates a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -2858,7 +2859,7 @@ async def put_datafeed( """ Instantiates a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3004,7 +3005,7 @@ async def put_filter( """ Instantiates a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param description: A description of the filter. @@ -3083,7 +3084,7 @@ async def put_job( """ Instantiates an anomaly detection job. - ``_ + ``_ :param job_id: The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and @@ -3253,7 +3254,7 @@ async def put_trained_model( """ Creates an inference trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param compressed_definition: The compressed (GZipped and Base64 encoded) inference @@ -3342,7 +3343,7 @@ async def put_trained_model_alias( Creates a new model alias (or reassigns an existing one) to refer to the trained model - ``_ + ``_ :param model_id: The identifier for the trained model that the alias refers to. :param model_alias: The alias to create or update. This value cannot end in numbers. @@ -3391,7 +3392,7 @@ async def put_trained_model_definition_part( """ Creates part of a trained model definition - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param part: The definition part number. When the definition is loaded for inference @@ -3458,7 +3459,7 @@ async def put_trained_model_vocabulary( """ Creates a trained model vocabulary - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. @@ -3507,7 +3508,7 @@ async def reset_job( """ Resets an existing anomaly detection job. - ``_ + ``_ :param job_id: The ID of the job to reset. :param delete_user_annotations: Specifies whether annotations that have been @@ -3555,7 +3556,7 @@ async def revert_model_snapshot( """ Reverts to a specific snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: You can specify `empty` as the . Reverting to @@ -3606,7 +3607,7 @@ async def set_upgrade_mode( Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. - ``_ + ``_ :param enabled: When `true`, it enables `upgrade_mode` which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from @@ -3646,7 +3647,7 @@ async def start_data_frame_analytics( """ Starts a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3692,7 +3693,7 @@ async def start_datafeed( """ Starts one or more datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3754,7 +3755,7 @@ async def start_trained_model_deployment( """ Start a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. Currently, only PyTorch models are supported. @@ -3831,7 +3832,7 @@ async def stop_data_frame_analytics( """ Stops one or more data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3890,7 +3891,7 @@ async def stop_datafeed( """ Stops one or more datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a @@ -3945,7 +3946,7 @@ async def stop_trained_model_deployment( """ Stop a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -4004,7 +4005,7 @@ async def update_data_frame_analytics( """ Updates certain properties of a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -4105,7 +4106,7 @@ async def update_datafeed( """ Updates certain properties of a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -4261,7 +4262,7 @@ async def update_filter( """ Updates the description of a filter, adds items, or removes items. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param add_items: The items to add to the filter. @@ -4344,7 +4345,7 @@ async def update_job( """ Updates certain properties of an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the job. :param allow_lazy_open: Advanced configuration option. Specifies whether this @@ -4465,7 +4466,7 @@ async def update_model_snapshot( """ Updates certain properties of a snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -4515,7 +4516,7 @@ async def upgrade_job_snapshot( """ Upgrades a given job snapshot to the current major version. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -4582,7 +4583,7 @@ async def validate( """ Validates an anomaly detection job. - ``_ + ``_ :param analysis_config: :param analysis_limits: @@ -4645,7 +4646,7 @@ async def validate_detector( """ Validates an anomaly detection detector. - ``_ + ``_ :param detector: """ diff --git a/elasticsearch/_async/client/monitoring.py b/elasticsearch/_async/client/monitoring.py index 34b4126c9..17093ee1b 100644 --- a/elasticsearch/_async/client/monitoring.py +++ b/elasticsearch/_async/client/monitoring.py @@ -24,6 +24,7 @@ class MonitoringClient(NamespacedClient): + @_rewrite_parameters( body_name="operations", ) @@ -43,7 +44,7 @@ async def bulk( """ Used by the monitoring features to send monitoring data. - ``_ + ``_ :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload :param operations: diff --git a/elasticsearch/_async/client/nodes.py b/elasticsearch/_async/client/nodes.py index de75d83ec..a0d5bb73a 100644 --- a/elasticsearch/_async/client/nodes.py +++ b/elasticsearch/_async/client/nodes.py @@ -24,6 +24,7 @@ class NodesClient(NamespacedClient): + @_rewrite_parameters() async def clear_repositories_metering_archive( self, @@ -38,7 +39,7 @@ async def clear_repositories_metering_archive( """ Removes the archived repositories metering information present in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -77,7 +78,7 @@ async def get_repositories_metering_info( """ Returns cluster repositories metering information. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -126,7 +127,7 @@ async def hot_threads( """ Returns information about hot threads on each node in the cluster. - ``_ + ``_ :param node_id: List of node IDs or names used to limit returned information. :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket @@ -195,7 +196,7 @@ async def info( """ Returns information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -254,7 +255,7 @@ async def reload_secure_settings( """ Reloads secure settings. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. :param secure_settings_password: The password for the Elasticsearch keystore. @@ -318,7 +319,7 @@ async def stats( """ Returns statistical information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -414,7 +415,7 @@ async def usage( """ Returns low-level information about REST actions usage on nodes. - ``_ + ``_ :param node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting diff --git a/elasticsearch/_async/client/query_ruleset.py b/elasticsearch/_async/client/query_ruleset.py index 687a0146e..652318c86 100644 --- a/elasticsearch/_async/client/query_ruleset.py +++ b/elasticsearch/_async/client/query_ruleset.py @@ -24,6 +24,7 @@ class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, @@ -37,7 +38,7 @@ async def delete( """ Deletes a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset to delete """ @@ -71,7 +72,7 @@ async def get( """ Returns the details about a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset """ @@ -108,7 +109,7 @@ async def list( """ Lists query rulesets. - ``_ + ``_ :param from_: Starting offset (default: 0) :param size: specifies a max number of results to get @@ -149,7 +150,7 @@ async def put( """ Creates or updates a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset to be created or updated diff --git a/elasticsearch/_async/client/rollup.py b/elasticsearch/_async/client/rollup.py index 00d824dc9..a6a2f2909 100644 --- a/elasticsearch/_async/client/rollup.py +++ b/elasticsearch/_async/client/rollup.py @@ -24,6 +24,7 @@ class RollupClient(NamespacedClient): + @_rewrite_parameters() async def delete_job( self, @@ -37,7 +38,7 @@ async def delete_job( """ Deletes an existing rollup job. - ``_ + ``_ :param id: Identifier for the job. """ @@ -71,7 +72,7 @@ async def get_jobs( """ Retrieves the configuration, stats, and status of rollup jobs. - ``_ + ``_ :param id: Identifier for the rollup job. If it is `_all` or omitted, the API returns all rollup jobs. @@ -108,7 +109,7 @@ async def get_rollup_caps( Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - ``_ + ``_ :param id: Index, indices or index-pattern to return rollup capabilities for. `_all` may be used to fetch rollup capabilities from all jobs. @@ -145,7 +146,7 @@ async def get_rollup_index_caps( Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - ``_ + ``_ :param index: Data stream or index to check for rollup capabilities. Wildcard (`*`) expressions are supported. @@ -201,7 +202,7 @@ async def put_job( """ Creates a rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. @@ -310,7 +311,7 @@ async def rollup_search( """ Enables searching rolled-up data using the standard query DSL. - ``_ + ``_ :param index: Enables searching rolled-up data using the standard Query DSL. :param aggregations: Specifies aggregations. @@ -366,7 +367,7 @@ async def start_job( """ Starts an existing, stopped rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. """ @@ -402,7 +403,7 @@ async def stop_job( """ Stops an existing, started rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. :param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum) diff --git a/elasticsearch/_async/client/search_application.py b/elasticsearch/_async/client/search_application.py index 42970c607..56d29acc5 100644 --- a/elasticsearch/_async/client/search_application.py +++ b/elasticsearch/_async/client/search_application.py @@ -24,6 +24,7 @@ class SearchApplicationClient(NamespacedClient): + @_rewrite_parameters() async def delete( self, @@ -37,7 +38,7 @@ async def delete( """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -71,7 +72,7 @@ async def delete_behavioral_analytics( """ Delete a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be deleted """ @@ -105,7 +106,7 @@ async def get( """ Returns the details about a search application. - ``_ + ``_ :param name: The name of the search application """ @@ -139,7 +140,7 @@ async def get_behavioral_analytics( """ Returns the existing behavioral analytics collections. - ``_ + ``_ :param name: A list of analytics collections to limit the returned information """ @@ -178,7 +179,7 @@ async def list( """ Returns the existing search applications. - ``_ + ``_ :param from_: Starting offset. :param q: Query in the Lucene query string syntax. @@ -223,7 +224,7 @@ async def put( """ Creates or updates a search application. - ``_ + ``_ :param name: The name of the search application to be created or updated. :param search_application: @@ -269,7 +270,7 @@ async def put_behavioral_analytics( """ Creates a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be created or updated. """ @@ -308,7 +309,7 @@ async def search( """ Perform a search against a search application - ``_ + ``_ :param name: The name of the search application to be searched. :param params: Query parameters specific to this request, which will override diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py index 68d25d310..7ca726863 100644 --- a/elasticsearch/_async/client/searchable_snapshots.py +++ b/elasticsearch/_async/client/searchable_snapshots.py @@ -24,6 +24,7 @@ class SearchableSnapshotsClient(NamespacedClient): + @_rewrite_parameters() async def cache_stats( self, @@ -40,7 +41,7 @@ async def cache_stats( """ Retrieve node-level cache statistics about searchable snapshots. - ``_ + ``_ :param node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting @@ -90,7 +91,7 @@ async def clear_cache( """ Clear the cache of searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -156,7 +157,7 @@ async def mount( """ Mount a snapshot as a searchable index. - ``_ + ``_ :param repository: The name of the repository containing the snapshot of the index to mount @@ -224,7 +225,7 @@ async def stats( """ Retrieve shard-level statistics about searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param level: Return stats aggregated at cluster, index or shard level diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index 6de8fa8ef..7f15f7a9f 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -24,6 +24,7 @@ class SecurityClient(NamespacedClient): + @_rewrite_parameters( body_fields=("grant_type", "access_token", "password", "username"), ) @@ -45,7 +46,7 @@ async def activate_user_profile( """ Creates or updates the user profile on behalf of another user. - ``_ + ``_ :param grant_type: :param access_token: @@ -92,7 +93,7 @@ async def authenticate( Enables authentication as a user and retrieve information about the authenticated user. - ``_ + ``_ """ __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} @@ -130,7 +131,7 @@ async def change_password( """ Changes the passwords of users in the native realm and built-in users. - ``_ + ``_ :param username: The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user. @@ -183,7 +184,7 @@ async def clear_api_key_cache( """ Clear a subset or all entries from the API key cache. - ``_ + ``_ :param ids: Comma-separated list of API key IDs to evict from the API key cache. To evict all API keys, use `*`. Does not support other wildcard patterns. @@ -218,7 +219,7 @@ async def clear_cached_privileges( """ Evicts application privileges from the native application privileges cache. - ``_ + ``_ :param application: A comma-separated list of application names """ @@ -254,7 +255,7 @@ async def clear_cached_realms( Evicts users from the user cache. Can completely clear the cache or evict specific users. - ``_ + ``_ :param realms: Comma-separated list of realms to clear :param usernames: Comma-separated list of usernames to clear from the cache @@ -291,7 +292,7 @@ async def clear_cached_roles( """ Evicts roles from the native role cache. - ``_ + ``_ :param name: Role name """ @@ -327,7 +328,7 @@ async def clear_cached_service_tokens( """ Evicts tokens from the service account token caches. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -376,7 +377,7 @@ async def create_api_key( """ Creates an API key for access without requiring basic authentication. - ``_ + ``_ :param expiration: Expiration time for the API key. By default, API keys never expire. @@ -441,7 +442,7 @@ async def create_service_token( """ Creates a service account token for access without requiring basic authentication. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -499,7 +500,7 @@ async def delete_privileges( """ Removes application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -544,7 +545,7 @@ async def delete_role( """ Removes roles in the native realm. - ``_ + ``_ :param name: Role name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -586,7 +587,7 @@ async def delete_role_mapping( """ Removes role mappings. - ``_ + ``_ :param name: Role-mapping name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -630,7 +631,7 @@ async def delete_service_token( """ Deletes a service account token. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -678,7 +679,7 @@ async def delete_user( """ Deletes users from the native realm. - ``_ + ``_ :param username: username :param refresh: If `true` (the default) then refresh the affected shards to make @@ -720,7 +721,7 @@ async def disable_user( """ Disables users in the native realm. - ``_ + ``_ :param username: The username of the user to disable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -762,7 +763,7 @@ async def disable_user_profile( """ Disables a user profile so it's not visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -804,7 +805,7 @@ async def enable_user( """ Enables users in the native realm. - ``_ + ``_ :param username: The username of the user to enable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -846,7 +847,7 @@ async def enable_user_profile( """ Enables a user profile so it's visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -885,7 +886,7 @@ async def enroll_kibana( Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. - ``_ + ``_ """ __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} @@ -914,7 +915,7 @@ async def enroll_node( """ Allows a new node to enroll to an existing cluster with security enabled. - ``_ + ``_ """ __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} @@ -950,7 +951,7 @@ async def get_api_key( """ Retrieves information for one or more API keys. - ``_ + ``_ :param active_only: A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, @@ -1015,7 +1016,7 @@ async def get_builtin_privileges( Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. - ``_ + ``_ """ __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} @@ -1046,7 +1047,7 @@ async def get_privileges( """ Retrieves application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -1084,7 +1085,7 @@ async def get_role( """ Retrieves roles in the native realm. - ``_ + ``_ :param name: The name of the role. You can specify multiple roles as a comma-separated list. If you do not specify this parameter, the API returns information about @@ -1121,7 +1122,7 @@ async def get_role_mapping( """ Retrieves role mappings. - ``_ + ``_ :param name: The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does @@ -1161,7 +1162,7 @@ async def get_service_accounts( """ Retrieves information about service accounts. - ``_ + ``_ :param namespace: Name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit @@ -1203,7 +1204,7 @@ async def get_service_credentials( """ Retrieves information of all service credentials for a service account. - ``_ + ``_ :param namespace: Name of the namespace. :param service: Name of the service name. @@ -1260,7 +1261,7 @@ async def get_token( """ Creates a bearer token for access without requiring basic authentication. - ``_ + ``_ :param grant_type: :param kerberos_ticket: @@ -1312,7 +1313,7 @@ async def get_user( """ Retrieves information about users in the native realm and built-in users. - ``_ + ``_ :param username: An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves @@ -1355,7 +1356,7 @@ async def get_user_privileges( """ Retrieves security privileges for the logged in user. - ``_ + ``_ :param application: The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, @@ -1399,7 +1400,7 @@ async def get_user_profile( """ Retrieves user profiles for the given unique ID(s). - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: List of filters for the `data` field of the profile document. To @@ -1457,7 +1458,7 @@ async def grant_api_key( """ Creates an API key on behalf of another user. - ``_ + ``_ :param api_key: Defines the API key. :param grant_type: The type of grant. Supported grant types are: `access_token`, @@ -1531,7 +1532,7 @@ async def has_privileges( """ Determines whether the specified user has a specified list of privileges. - ``_ + ``_ :param user: Username :param application: @@ -1582,7 +1583,7 @@ async def has_privileges_user_profile( Determines whether the users associated with the specified profile IDs have all the requested privileges. - ``_ + ``_ :param privileges: :param uids: A list of profile IDs. The privileges are checked for associated @@ -1634,7 +1635,7 @@ async def invalidate_api_key( """ Invalidates one or more API keys. - ``_ + ``_ :param id: :param ids: A list of API key ids. This parameter cannot be used with any of @@ -1698,7 +1699,7 @@ async def invalidate_token( """ Invalidates one or more access tokens or refresh tokens. - ``_ + ``_ :param realm_name: :param refresh_token: @@ -1751,7 +1752,7 @@ async def put_privileges( """ Adds or updates application privileges. - ``_ + ``_ :param privileges: :param refresh: If `true` (the default) then refresh the affected shards to make @@ -1824,7 +1825,7 @@ async def put_role( """ Adds and updates roles in the native realm. - ``_ + ``_ :param name: The name of the role. :param applications: A list of application privilege entries. @@ -1914,7 +1915,7 @@ async def put_role_mapping( """ Creates and updates role mappings. - ``_ + ``_ :param name: Role-mapping name :param enabled: @@ -1995,7 +1996,7 @@ async def put_user( Adds and updates users in the native realm. These users are commonly referred to as native users. - ``_ + ``_ :param username: The username of the User :param email: @@ -2073,7 +2074,7 @@ async def query_api_keys( """ Retrieves information for API keys using a subset of query DSL - ``_ + ``_ :param from_: Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more @@ -2156,7 +2157,7 @@ async def saml_authenticate( Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair - ``_ + ``_ :param content: The SAML response as it was sent by the user’s browser, usually a Base64 encoded XML document. @@ -2211,7 +2212,7 @@ async def saml_complete_logout( """ Verifies the logout response sent from the SAML IdP - ``_ + ``_ :param ids: A json array with all the valid SAML Request Ids that the caller of the API has for the current user. @@ -2270,7 +2271,7 @@ async def saml_invalidate( """ Consumes a SAML LogoutRequest - ``_ + ``_ :param query_string: The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout. This query should include @@ -2331,7 +2332,7 @@ async def saml_logout( Invalidates an access token and a refresh token that were generated via the SAML Authenticate API - ``_ + ``_ :param token: The access token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent token that was received @@ -2381,7 +2382,7 @@ async def saml_prepare_authentication( """ Creates a SAML authentication request - ``_ + ``_ :param acs: The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication @@ -2429,7 +2430,7 @@ async def saml_service_provider_metadata( """ Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider - ``_ + ``_ :param realm_name: The name of the SAML realm in Elasticsearch. """ @@ -2469,7 +2470,7 @@ async def suggest_user_profiles( """ Get suggestions for user profiles that match specified search criteria. - ``_ + ``_ :param data: List of filters for the `data` field of the profile document. To return all content use `data=*`. To return a subset of content use `data=` @@ -2531,7 +2532,7 @@ async def update_api_key( """ Updates attributes of an existing API key. - ``_ + ``_ :param id: The ID of the API key to update. :param expiration: Expiration time for the API key. @@ -2599,7 +2600,7 @@ async def update_user_profile_data( """ Update application specific data for the user profile of the given unique ID. - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: Non-searchable data that you want to associate with the user profile. diff --git a/elasticsearch/_async/client/shutdown.py b/elasticsearch/_async/client/shutdown.py index f2ee7aeee..0bf76e4a6 100644 --- a/elasticsearch/_async/client/shutdown.py +++ b/elasticsearch/_async/client/shutdown.py @@ -24,6 +24,7 @@ class ShutdownClient(NamespacedClient): + @_rewrite_parameters() async def delete_node( self, diff --git a/elasticsearch/_async/client/slm.py b/elasticsearch/_async/client/slm.py index 7c9b51521..5a8e297e5 100644 --- a/elasticsearch/_async/client/slm.py +++ b/elasticsearch/_async/client/slm.py @@ -24,6 +24,7 @@ class SlmClient(NamespacedClient): + @_rewrite_parameters() async def delete_lifecycle( self, @@ -37,7 +38,7 @@ async def delete_lifecycle( """ Deletes an existing snapshot lifecycle policy. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to remove """ @@ -72,7 +73,7 @@ async def execute_lifecycle( Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to be executed """ @@ -105,7 +106,7 @@ async def execute_retention( """ Deletes any snapshots that are expired according to the policy's retention rules. - ``_ + ``_ """ __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} @@ -136,7 +137,7 @@ async def get_lifecycle( Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. - ``_ + ``_ :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve """ @@ -171,7 +172,7 @@ async def get_stats( Returns global and policy-level statistics about actions taken by snapshot lifecycle management. - ``_ + ``_ """ __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} @@ -200,7 +201,7 @@ async def get_status( """ Retrieves the status of snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} @@ -242,7 +243,7 @@ async def put_lifecycle( """ Creates or updates a snapshot lifecycle policy. - ``_ + ``_ :param policy_id: ID for the snapshot lifecycle policy you want to create or update. @@ -312,7 +313,7 @@ async def start( """ Turns on snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} @@ -341,7 +342,7 @@ async def stop( """ Turns off snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 3fb568545..f78b92d03 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -24,6 +24,7 @@ class SnapshotClient(NamespacedClient): + @_rewrite_parameters() async def cleanup_repository( self, @@ -41,7 +42,7 @@ async def cleanup_repository( """ Removes stale data from repository. - ``_ + ``_ :param name: Snapshot repository to clean up. :param master_timeout: Period to wait for a connection to the master node. @@ -91,7 +92,7 @@ async def clone( """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ + ``_ :param repository: A repository name :param snapshot: The name of the snapshot to clone from @@ -165,7 +166,7 @@ async def create( """ Creates a snapshot in a repository. - ``_ + ``_ :param repository: Repository for the snapshot. :param snapshot: Name of the snapshot. Must be unique in the repository. @@ -240,14 +241,14 @@ async def create( ) @_rewrite_parameters( - body_fields=("settings", "type", "repository"), + body_name="repository", ) async def create_repository( self, *, name: str, - settings: t.Optional[t.Mapping[str, t.Any]] = None, - type: t.Optional[str] = None, + repository: t.Optional[t.Mapping[str, t.Any]] = None, + body: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -255,33 +256,30 @@ async def create_repository( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - repository: t.Optional[t.Mapping[str, t.Any]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, verify: t.Optional[bool] = None, - body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a repository. - ``_ + ``_ :param name: A repository name - :param settings: - :param type: - :param master_timeout: Explicit operation timeout for connection to master node :param repository: + :param master_timeout: Explicit operation timeout for connection to master node :param timeout: Explicit operation timeout :param verify: Whether to verify the repository after creation """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - if settings is None and body is None: - raise ValueError("Empty value passed for parameter 'settings'") - if type is None and body is None: - raise ValueError("Empty value passed for parameter 'type'") + if repository is None and body is None: + raise ValueError( + "Empty value passed for parameters 'repository' and 'body', one of them should be set." + ) + elif repository is not None and body is not None: + raise ValueError("Cannot set both 'repository' and 'body'") __path = f"/_snapshot/{_quote(name)}" __query: t.Dict[str, t.Any] = {} - __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -296,13 +294,7 @@ async def create_repository( __query["timeout"] = timeout if verify is not None: __query["verify"] = verify - if not __body: - if settings is not None: - __body["settings"] = settings - if type is not None: - __body["type"] = type - if repository is not None: - __body["repository"] = repository + __body = repository if repository is not None else body __headers = {"accept": "application/json", "content-type": "application/json"} return await self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body @@ -325,7 +317,7 @@ async def delete( """ Deletes one or more snapshots. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -369,7 +361,7 @@ async def delete_repository( """ Deletes a repository. - ``_ + ``_ :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -431,7 +423,7 @@ async def get( """ Returns information about a snapshot. - ``_ + ``_ :param repository: Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. @@ -536,7 +528,7 @@ async def get_repository( """ Returns information about a repository. - ``_ + ``_ :param name: A comma-separated list of repository names :param local: Return local information, do not retrieve the state from master @@ -607,7 +599,7 @@ async def restore( """ Restores a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A snapshot name @@ -692,7 +684,7 @@ async def status( """ Returns information about the status of a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -741,7 +733,7 @@ async def verify_repository( """ Verifies a repository. - ``_ + ``_ :param name: A repository name :param master_timeout: Explicit operation timeout for connection to master node diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py index 9b05a6b88..08f4de9af 100644 --- a/elasticsearch/_async/client/sql.py +++ b/elasticsearch/_async/client/sql.py @@ -24,6 +24,7 @@ class SqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=("cursor",), ) @@ -40,7 +41,7 @@ async def clear_cursor( """ Clears the SQL cursor - ``_ + ``_ :param cursor: Cursor to clear. """ @@ -79,7 +80,7 @@ async def delete_async( Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - ``_ + ``_ :param id: Identifier for the search. """ @@ -120,7 +121,7 @@ async def get_async( Returns the current status and available results for an async SQL search or stored synchronous SQL search - ``_ + ``_ :param id: Identifier for the search. :param delimiter: Separator for CSV results. The API only supports this parameter @@ -172,7 +173,7 @@ async def get_async_status( Returns the current status of an async SQL search or a stored synchronous SQL search - ``_ + ``_ :param id: Identifier for the search. """ @@ -247,7 +248,7 @@ async def query( """ Executes a SQL request - ``_ + ``_ :param catalog: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. @@ -350,7 +351,7 @@ async def translate( """ Translates SQL into Elasticsearch queries - ``_ + ``_ :param query: SQL query to run. :param fetch_size: The maximum number of rows (or entries) to return in one response. diff --git a/elasticsearch/_async/client/ssl.py b/elasticsearch/_async/client/ssl.py index ceaf8b692..8700662a0 100644 --- a/elasticsearch/_async/client/ssl.py +++ b/elasticsearch/_async/client/ssl.py @@ -24,6 +24,7 @@ class SslClient(NamespacedClient): + @_rewrite_parameters() async def certificates( self, @@ -37,7 +38,7 @@ async def certificates( Retrieves information about the X.509 certificates used to encrypt communications in the cluster. - ``_ + ``_ """ __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/synonyms.py b/elasticsearch/_async/client/synonyms.py index aa9c35715..3d074023a 100644 --- a/elasticsearch/_async/client/synonyms.py +++ b/elasticsearch/_async/client/synonyms.py @@ -24,6 +24,7 @@ class SynonymsClient(NamespacedClient): + @_rewrite_parameters() async def delete_synonym( self, @@ -37,7 +38,7 @@ async def delete_synonym( """ Deletes a synonym set - ``_ + ``_ :param id: The id of the synonyms set to be deleted """ @@ -72,7 +73,7 @@ async def delete_synonym_rule( """ Deletes a synonym rule in a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to be updated :param rule_id: The id of the synonym rule to be deleted @@ -113,7 +114,7 @@ async def get_synonym( """ Retrieves a synonym set - ``_ + ``_ :param id: "The id of the synonyms set to be retrieved :param from_: Starting offset for query rules to be retrieved @@ -154,7 +155,7 @@ async def get_synonym_rule( """ Retrieves a synonym rule from a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to retrieve the synonym rule from :param rule_id: The id of the synonym rule to retrieve @@ -194,7 +195,7 @@ async def get_synonyms_sets( """ Retrieves a summary of all defined synonym sets - ``_ + ``_ :param from_: Starting offset :param size: specifies a max number of results to get @@ -235,7 +236,7 @@ async def put_synonym( """ Creates or updates a synonyms set - ``_ + ``_ :param id: The id of the synonyms set to be created or updated :param synonyms_set: The synonym set information to update @@ -271,7 +272,7 @@ async def put_synonym_rule( *, set_id: str, rule_id: str, - synonyms: t.Optional[t.Sequence[str]] = None, + synonyms: t.Optional[str] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -281,7 +282,7 @@ async def put_synonym_rule( """ Creates or updates a synonym rule in a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to be updated with the synonym rule :param rule_id: The id of the synonym rule to be updated or created diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index 24a647875..ffef31090 100644 --- a/elasticsearch/_async/client/tasks.py +++ b/elasticsearch/_async/client/tasks.py @@ -24,6 +24,7 @@ class TasksClient(NamespacedClient): + @_rewrite_parameters() async def cancel( self, @@ -41,7 +42,7 @@ async def cancel( """ Cancels a task, if it can be cancelled through an API. - ``_ + ``_ :param task_id: ID of the task. :param actions: Comma-separated list or wildcard expression of actions used to @@ -92,7 +93,7 @@ async def get( """ Returns information about a task. - ``_ + ``_ :param task_id: ID of the task. :param timeout: Period to wait for a response. If no response is received before @@ -145,7 +146,7 @@ async def list( """ Returns a list of tasks. - ``_ + ``_ :param actions: Comma-separated list or wildcard expression of actions used to limit the request. diff --git a/elasticsearch/_async/client/text_structure.py b/elasticsearch/_async/client/text_structure.py index 2995f5df9..8bad62538 100644 --- a/elasticsearch/_async/client/text_structure.py +++ b/elasticsearch/_async/client/text_structure.py @@ -24,6 +24,7 @@ class TextStructureClient(NamespacedClient): + @_rewrite_parameters( body_name="text_files", ) @@ -35,6 +36,7 @@ async def find_structure( charset: t.Optional[str] = None, column_names: t.Optional[str] = None, delimiter: t.Optional[str] = None, + ecs_compatibility: t.Optional[str] = None, explain: t.Optional[bool] = None, format: t.Optional[str] = None, grok_pattern: t.Optional[str] = None, @@ -51,7 +53,7 @@ async def find_structure( Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. - ``_ + ``_ :param text_files: :param charset: The text’s character set. It must be a character set that is @@ -70,6 +72,8 @@ async def find_structure( default scenario, all rows must have the same number of fields for the delimited format to be detected. If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns + (disabled or v1, default: disabled). :param explain: If this parameter is set to true, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result. @@ -131,6 +135,8 @@ async def find_structure( __query["column_names"] = column_names if delimiter is not None: __query["delimiter"] = delimiter + if ecs_compatibility is not None: + __query["ecs_compatibility"] = ecs_compatibility if explain is not None: __query["explain"] = explain if format is not None: @@ -161,3 +167,55 @@ async def find_structure( return await self.perform_request( # type: ignore[return-value] "POST", __path, params=__query, headers=__headers, body=__body ) + + @_rewrite_parameters( + body_fields=("grok_pattern", "text"), + ) + async def test_grok_pattern( + self, + *, + grok_pattern: t.Optional[str] = None, + text: t.Optional[t.Sequence[str]] = None, + ecs_compatibility: t.Optional[str] = None, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + body: t.Optional[t.Dict[str, t.Any]] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Tests a Grok pattern on some text. + + ``_ + + :param grok_pattern: Grok pattern to run on the text. + :param text: Lines of text to run the Grok pattern on. + :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns + (disabled or v1, default: disabled). + """ + if grok_pattern is None and body is None: + raise ValueError("Empty value passed for parameter 'grok_pattern'") + if text is None and body is None: + raise ValueError("Empty value passed for parameter 'text'") + __path = "/_text_structure/test_grok_pattern" + __query: t.Dict[str, t.Any] = {} + __body: t.Dict[str, t.Any] = body if body is not None else {} + if ecs_compatibility is not None: + __query["ecs_compatibility"] = ecs_compatibility + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if not __body: + if grok_pattern is not None: + __body["grok_pattern"] = grok_pattern + if text is not None: + __body["text"] = text + __headers = {"accept": "application/json", "content-type": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "POST", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py index 14ab3ae9c..7754b8457 100644 --- a/elasticsearch/_async/client/transform.py +++ b/elasticsearch/_async/client/transform.py @@ -24,6 +24,7 @@ class TransformClient(NamespacedClient): + @_rewrite_parameters() async def delete_transform( self, @@ -40,7 +41,7 @@ async def delete_transform( """ Deletes an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param delete_dest_index: If this value is true, the destination index is deleted @@ -94,7 +95,7 @@ async def get_transform( """ Retrieves configuration information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -155,7 +156,7 @@ async def get_transform_stats( """ Retrieves usage information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -230,7 +231,7 @@ async def preview_transform( """ Previews a transform. - ``_ + ``_ :param transform_id: Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in @@ -338,7 +339,7 @@ async def put_transform( """ Instantiates a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -431,7 +432,7 @@ async def reset_transform( """ Resets an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -473,7 +474,7 @@ async def schedule_now_transform( """ Schedules now a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param timeout: Controls the time to wait for the scheduling to take place @@ -514,7 +515,7 @@ async def start_transform( """ Starts one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. :param from_: Restricts the set of transformed entities to those changed after @@ -562,7 +563,7 @@ async def stop_transform( """ Stops one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, @@ -649,7 +650,7 @@ async def update_transform( """ Updates certain properties of a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param defer_validation: When true, deferrable validations are not run. This @@ -723,7 +724,7 @@ async def upgrade_transforms( """ Upgrades all transforms. - ``_ + ``_ :param dry_run: When true, the request checks for updates but does not run them. :param timeout: Period to wait for a response. If no response is received before diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py index e2615f704..be166d248 100644 --- a/elasticsearch/_async/client/watcher.py +++ b/elasticsearch/_async/client/watcher.py @@ -24,6 +24,7 @@ class WatcherClient(NamespacedClient): + @_rewrite_parameters() async def ack_watch( self, @@ -38,7 +39,7 @@ async def ack_watch( """ Acknowledges a watch, manually throttling the execution of the watch's actions. - ``_ + ``_ :param watch_id: Watch ID :param action_id: A comma-separated list of the action ids to be acked @@ -78,7 +79,7 @@ async def activate_watch( """ Activates a currently inactive watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -112,7 +113,7 @@ async def deactivate_watch( """ Deactivates a currently active watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -146,7 +147,7 @@ async def delete_watch( """ Removes a watch from Watcher. - ``_ + ``_ :param id: Watch ID """ @@ -207,7 +208,7 @@ async def execute_watch( """ Forces the execution of a stored watch. - ``_ + ``_ :param id: Identifier for the watch. :param action_modes: Determines how to handle the watch actions as part of the @@ -281,7 +282,7 @@ async def get_watch( """ Retrieves a watch by its ID. - ``_ + ``_ :param id: Watch ID """ @@ -337,7 +338,7 @@ async def put_watch( """ Creates a new watch, or updates an existing one. - ``_ + ``_ :param id: Watch ID :param actions: @@ -427,7 +428,7 @@ async def query_watches( """ Retrieves stored watches. - ``_ + ``_ :param from_: The offset from the first result to fetch. Needs to be non-negative. :param query: Optional, query filter watches to be returned. @@ -490,7 +491,7 @@ async def start( """ Starts Watcher if it is not already running. - ``_ + ``_ """ __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} @@ -534,7 +535,7 @@ async def stats( """ Retrieves the current Watcher metrics. - ``_ + ``_ :param metric: Defines which additional metrics are included in the response. :param emit_stacktraces: Defines whether stack traces are generated for each @@ -572,7 +573,7 @@ async def stop( """ Stops Watcher if it is running. - ``_ + ``_ """ __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/xpack.py b/elasticsearch/_async/client/xpack.py index 31bb1f253..93308c7da 100644 --- a/elasticsearch/_async/client/xpack.py +++ b/elasticsearch/_async/client/xpack.py @@ -43,7 +43,7 @@ async def info( """ Retrieves information about the installed X-Pack features. - ``_ + ``_ :param accept_enterprise: If this param is used it must be set to true :param categories: A comma-separated list of the information categories to include @@ -83,7 +83,7 @@ async def usage( """ Retrieves usage information about the installed X-Pack features. - ``_ + ``_ :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and diff --git a/elasticsearch/_sync/client/__init__.py b/elasticsearch/_sync/client/__init__.py index 7d595dacf..6eda21719 100644 --- a/elasticsearch/_sync/client/__init__.py +++ b/elasticsearch/_sync/client/__init__.py @@ -638,7 +638,7 @@ def bulk( """ Allows to perform multiple index/update/delete operations in a single request. - ``_ + ``_ :param operations: :param index: Name of the data stream, index, or index alias to perform bulk @@ -728,7 +728,7 @@ def clear_scroll( """ Explicitly clears the search context for a scroll. - ``_ + ``_ :param scroll_id: Scroll IDs to clear. To clear all scroll IDs, use `_all`. """ @@ -771,7 +771,7 @@ def close_point_in_time( """ Close a point in time - ``_ + ``_ :param id: The ID of the point-in-time. """ @@ -838,7 +838,7 @@ def count( """ Returns number of documents matching a query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this @@ -963,7 +963,7 @@ def create( Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ + ``_ :param index: Name of the data stream or index to target. If the target doesn’t exist and matches the name or wildcard (`*`) pattern of an index template @@ -1060,7 +1060,7 @@ def delete( """ Removes a document from the index. - ``_ + ``_ :param index: Name of the target index. :param id: Unique identifier for the document. @@ -1178,7 +1178,7 @@ def delete_by_query( """ Deletes documents matching the provided query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this @@ -1349,7 +1349,7 @@ def delete_by_query_rethrottle( """ Changes the number of requests per second for a particular Delete By Query operation. - ``_ + ``_ :param task_id: The ID for the task. :param requests_per_second: The throttle for this request in sub-requests per @@ -1391,7 +1391,7 @@ def delete_script( """ Deletes a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. :param master_timeout: Period to wait for a connection to the master node. If @@ -1453,7 +1453,7 @@ def exists( """ Returns information about whether a document exists in an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1548,7 +1548,7 @@ def exists_source( """ Returns information about whether a document source exists in an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1642,7 +1642,7 @@ def explain( """ Returns information about why a specific matches (or doesn't match) a query. - ``_ + ``_ :param index: Index names used to limit the request. Only a single index name can be provided to this parameter. @@ -1743,6 +1743,7 @@ def field_caps( filters: t.Optional[str] = None, human: t.Optional[bool] = None, ignore_unavailable: t.Optional[bool] = None, + include_empty_fields: t.Optional[bool] = None, include_unmapped: t.Optional[bool] = None, index_filter: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, @@ -1753,7 +1754,7 @@ def field_caps( """ Returns the information about the capabilities of fields among multiple indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams @@ -1772,6 +1773,7 @@ def field_caps( :param filters: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. + :param include_empty_fields: If false, empty fields are not included in the response. :param include_unmapped: If true, unmapped fields are included in the response. :param index_filter: Allows to filter indices if the provided query rewrites to match_none on every shard. @@ -1802,6 +1804,8 @@ def field_caps( __query["human"] = human if ignore_unavailable is not None: __query["ignore_unavailable"] = ignore_unavailable + if include_empty_fields is not None: + __query["include_empty_fields"] = include_empty_fields if include_unmapped is not None: __query["include_unmapped"] = include_unmapped if pretty is not None: @@ -1856,7 +1860,7 @@ def get( """ Returns a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -1935,7 +1939,7 @@ def get_script( """ Returns a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. :param master_timeout: Specify timeout for connection to master @@ -1971,7 +1975,7 @@ def get_script_context( """ Returns all script contexts. - ``_ + ``_ """ __path = "/_script_context" __query: t.Dict[str, t.Any] = {} @@ -2000,7 +2004,7 @@ def get_script_languages( """ Returns available script types, languages and contexts - ``_ + ``_ """ __path = "/_script_language" __query: t.Dict[str, t.Any] = {} @@ -2049,7 +2053,7 @@ def get_source( """ Returns the source of a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -2126,7 +2130,7 @@ def health_report( """ Returns the health of the cluster. - ``_ + ``_ :param feature: A feature of the cluster, as returned by the top-level health report API. @@ -2193,7 +2197,7 @@ def index( """ Creates or updates a document in an index. - ``_ + ``_ :param index: Name of the data stream or index to target. :param document: @@ -2293,7 +2297,7 @@ def info( """ Returns basic information about the cluster. - ``_ + ``_ """ __path = "/" __query: t.Dict[str, t.Any] = {} @@ -2343,7 +2347,7 @@ def knn_search( """ Performs a kNN search. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or to perform the operation on all indices @@ -2436,7 +2440,7 @@ def mget( """ Allows to get multiple documents in one request. - ``_ + ``_ :param index: Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. @@ -2541,7 +2545,7 @@ def msearch( """ Allows to execute several search operations in one request. - ``_ + ``_ :param searches: :param index: Comma-separated list of data streams, indices, and index aliases @@ -2655,7 +2659,7 @@ def msearch_template( """ Allows to execute several search template operations in one request. - ``_ + ``_ :param search_templates: :param index: Comma-separated list of data streams, indices, and aliases to search. @@ -2741,7 +2745,7 @@ def mtermvectors( """ Returns multiple termvectors in one request. - ``_ + ``_ :param index: Name of the index that contains the documents. :param docs: Array of existing or artificial documents. @@ -2839,7 +2843,7 @@ def open_point_in_time( """ Open a point in time that can be used in subsequent searches - ``_ + ``_ :param index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices @@ -2905,7 +2909,7 @@ def put_script( """ Creates or updates a script. - ``_ + ``_ :param id: Identifier for the stored script or search template. Must be unique within the cluster. @@ -2982,7 +2986,7 @@ def rank_eval( Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ + ``_ :param requests: A set of typical search requests, together with their provided ratings. @@ -3069,7 +3073,7 @@ def reindex( source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ + ``_ :param dest: The destination you are copying to. :param source: The source you are copying from. @@ -3158,7 +3162,7 @@ def reindex_rethrottle( """ Changes the number of requests per second for a particular Reindex operation. - ``_ + ``_ :param task_id: Identifier for the task. :param requests_per_second: The throttle for this request in sub-requests per @@ -3203,7 +3207,7 @@ def render_search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param id: ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. @@ -3262,7 +3266,7 @@ def scripts_painless_execute( """ Allows an arbitrary script to be executed and a result to be returned - ``_ + ``_ :param context: The context that the script should run in. :param context_setup: Additional parameters for the `context`. @@ -3313,7 +3317,7 @@ def scroll( """ Allows to retrieve a large numbers of results from a single search request. - ``_ + ``_ :param scroll_id: Scroll ID of the search. :param rest_total_hits_as_int: If true, the API response’s hit.total property @@ -3492,7 +3496,7 @@ def search( """ Returns results matching a query. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this @@ -3894,7 +3898,7 @@ def search_mvt( Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, or aliases to search :param field: Field containing geospatial data to return @@ -4036,7 +4040,7 @@ def search_shards( Returns information about the indices and shards that a search request would be executed against. - ``_ + ``_ :param index: Returns the indices and shards that a search request would be executed against. @@ -4129,7 +4133,7 @@ def search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). @@ -4254,7 +4258,7 @@ def terms_enum( the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported. @@ -4346,7 +4350,7 @@ def termvectors( Returns information and statistics about terms in the fields of a particular document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -4479,7 +4483,7 @@ def update( """ Updates a document with a script or partial document. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -4635,10 +4639,11 @@ def update_by_query( body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ - Performs an update on every document in the index without changing the source, - for example to pick up a mapping change. + Updates documents that match the specified query. If no query is specified, performs + an update on every document in the index without changing the source, for example + to pick up a mapping change. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this @@ -4824,7 +4829,7 @@ def update_by_query_rethrottle( """ Changes the number of requests per second for a particular Update By Query operation. - ``_ + ``_ :param task_id: The ID for the task. :param requests_per_second: The throttle for this request in sub-requests per diff --git a/elasticsearch/_sync/client/async_search.py b/elasticsearch/_sync/client/async_search.py index 8df1abdab..9882b2b81 100644 --- a/elasticsearch/_sync/client/async_search.py +++ b/elasticsearch/_sync/client/async_search.py @@ -24,6 +24,7 @@ class AsyncSearchClient(NamespacedClient): + @_rewrite_parameters() def delete( self, @@ -38,7 +39,7 @@ def delete( 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. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -78,7 +79,7 @@ def get( Retrieves the results of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. :param keep_alive: Specifies how long the async search should be available in @@ -133,7 +134,7 @@ def status( Retrieves the status of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -299,7 +300,7 @@ def submit( """ Executes a search request asynchronously. - ``_ + ``_ :param 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/_sync/client/autoscaling.py b/elasticsearch/_sync/client/autoscaling.py index 36edb3c10..e441b9d9c 100644 --- a/elasticsearch/_sync/client/autoscaling.py +++ b/elasticsearch/_sync/client/autoscaling.py @@ -24,6 +24,7 @@ class AutoscalingClient(NamespacedClient): + @_rewrite_parameters() def delete_autoscaling_policy( self, @@ -38,7 +39,7 @@ def delete_autoscaling_policy( Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -72,7 +73,7 @@ def get_autoscaling_capacity( Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ """ __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} @@ -103,7 +104,7 @@ def get_autoscaling_policy( Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -142,7 +143,7 @@ def put_autoscaling_policy( Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy :param policy: diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index 5c5f278c8..c174c7719 100644 --- a/elasticsearch/_sync/client/cat.py +++ b/elasticsearch/_sync/client/cat.py @@ -24,6 +24,7 @@ class CatClient(NamespacedClient): + @_rewrite_parameters() def aliases( self, @@ -55,7 +56,7 @@ def aliases( Shows information about currently configured aliases to indices including filter and routing infos. - ``_ + ``_ :param name: A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. @@ -136,7 +137,7 @@ def allocation( Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ + ``_ :param node_id: Comma-separated list of node identifiers or names used to limit the returned information. @@ -212,7 +213,7 @@ def component_templates( """ Returns information about existing component_templates templates. - ``_ + ``_ :param name: The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned. @@ -286,7 +287,7 @@ def count( Provides quick access to the document count of the entire cluster, or individual indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -364,7 +365,7 @@ def fielddata( Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ + ``_ :param fields: Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. @@ -443,7 +444,7 @@ def health( """ Returns a concise representation of the cluster health. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -516,7 +517,7 @@ def help( """ Returns help for the Cat APIs. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -602,7 +603,7 @@ def indices( Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -695,7 +696,7 @@ def master( """ Returns information about the master node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -794,7 +795,7 @@ def ml_data_frame_analytics( """ Gets configuration and usage information about data frame analytics jobs. - ``_ + ``_ :param id: The ID of the data frame analytics to fetch :param allow_no_match: Whether to ignore if a wildcard expression matches no @@ -905,7 +906,7 @@ def ml_datafeeds( """ Gets configuration and usage information about datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. @@ -1022,7 +1023,7 @@ def ml_jobs( """ Gets configuration and usage information about anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param allow_no_match: Specifies what to do when the request: * Contains wildcard @@ -1142,7 +1143,7 @@ def ml_trained_models( """ Gets configuration and usage information about inference trained models. - ``_ + ``_ :param model_id: A unique identifier for the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -1230,7 +1231,7 @@ def nodeattrs( """ Returns information about custom node attributes. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1302,7 +1303,7 @@ def nodes( """ Returns basic statistics about performance of cluster nodes. - ``_ + ``_ :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set @@ -1380,7 +1381,7 @@ def pending_tasks( """ Returns a concise representation of the cluster pending tasks. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1447,7 +1448,7 @@ def plugins( """ Returns information about installed plugins across nodes node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1520,7 +1521,7 @@ def recovery( """ Returns information about index shard recoveries, both on-going completed. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1603,7 +1604,7 @@ def repositories( """ Returns information about snapshot repositories registered in the cluster. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1674,7 +1675,7 @@ def segments( """ Provides low-level information about the segments in the shards of an index. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1754,7 +1755,7 @@ def shards( """ Provides a detailed view of shard allocation on nodes. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1832,7 +1833,7 @@ def snapshots( """ Returns all snapshots in a specific repository. - ``_ + ``_ :param repository: A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. @@ -1914,7 +1915,7 @@ def tasks( Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ + ``_ :param actions: The task action names, which are used to limit the response. :param detailed: If `true`, the response includes detailed information about @@ -1996,7 +1997,7 @@ def templates( """ Returns information about existing templates. - ``_ + ``_ :param name: The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. @@ -2073,7 +2074,7 @@ def thread_pool( Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ + ``_ :param thread_pool_patterns: A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. @@ -2183,7 +2184,7 @@ def transforms( """ Gets configuration and usage information about transforms. - ``_ + ``_ :param transform_id: A transform identifier or a wildcard expression. If you do not specify one of these options, the API returns information for all diff --git a/elasticsearch/_sync/client/ccr.py b/elasticsearch/_sync/client/ccr.py index 8cd218d44..a121a8274 100644 --- a/elasticsearch/_sync/client/ccr.py +++ b/elasticsearch/_sync/client/ccr.py @@ -24,6 +24,7 @@ class CcrClient(NamespacedClient): + @_rewrite_parameters() def delete_auto_follow_pattern( self, @@ -37,7 +38,7 @@ def delete_auto_follow_pattern( """ Deletes auto-follow patterns. - ``_ + ``_ :param name: The name of the auto follow pattern. """ @@ -106,7 +107,7 @@ def follow( """ Creates a new follower index configured to follow the referenced leader index. - ``_ + ``_ :param index: The name of the follower index :param leader_index: @@ -191,7 +192,7 @@ def follow_info( Retrieves information about all follower indices, including parameters and status for each follower index - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -227,7 +228,7 @@ def follow_stats( Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -274,7 +275,7 @@ def forget_follower( """ Removes the follower retention leases from the leader. - ``_ + ``_ :param index: the name of the leader index for which specified follower retention leases should be removed @@ -324,7 +325,7 @@ def get_auto_follow_pattern( Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - ``_ + ``_ :param name: Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections. @@ -360,7 +361,7 @@ def pause_auto_follow_pattern( """ Pauses an auto-follow pattern - ``_ + ``_ :param name: The name of the auto follow pattern that should pause discovering new indices to follow. @@ -396,7 +397,7 @@ def pause_follow( Pauses a follower index. The follower index will not fetch any additional operations from the leader index. - ``_ + ``_ :param index: The name of the follower index that should pause following its leader index. @@ -471,7 +472,7 @@ def put_auto_follow_pattern( cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. - ``_ + ``_ :param name: The name of the collection of auto-follow patterns. :param remote_cluster: The remote cluster containing the leader indices to match @@ -588,7 +589,7 @@ def resume_auto_follow_pattern( """ Resumes an auto-follow pattern that has been paused - ``_ + ``_ :param name: The name of the auto follow pattern to resume discovering new indices to follow. @@ -651,7 +652,7 @@ def resume_follow( """ Resumes a follower index that has been paused - ``_ + ``_ :param index: The name of the follow index to resume following. :param max_outstanding_read_requests: @@ -726,7 +727,7 @@ def stats( """ Gets all stats related to cross-cluster replication. - ``_ + ``_ """ __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} @@ -757,7 +758,7 @@ def unfollow( Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. - ``_ + ``_ :param index: The name of the follower index that should be turned into a regular index. diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index cb68d9efe..f8eecb4a5 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -24,6 +24,7 @@ class ClusterClient(NamespacedClient): + @_rewrite_parameters( body_fields=("current_node", "index", "primary", "shard"), ) @@ -45,7 +46,7 @@ def allocation_explain( """ Provides explanations for shard allocations in the cluster. - ``_ + ``_ :param current_node: Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. @@ -109,7 +110,7 @@ def delete_component_template( """ Deletes a component template - ``_ + ``_ :param name: Comma-separated list or wildcard expression of component template names used to limit the request. @@ -153,7 +154,7 @@ def delete_voting_config_exclusions( """ Clears cluster voting config exclusions. - ``_ + ``_ :param wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions @@ -196,7 +197,7 @@ def exists_component_template( """ Returns information about whether a particular component template exist - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (*) expressions are supported. @@ -247,7 +248,7 @@ def get_component_template( """ Returns one or more component templates - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (`*`) expressions are supported. @@ -304,7 +305,7 @@ def get_settings( """ Returns cluster settings. - ``_ + ``_ :param flat_settings: If `true`, returns settings in flat format. :param include_defaults: If `true`, returns default cluster settings from the @@ -382,7 +383,7 @@ def health( """ Returns basic information about the health of the cluster. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target @@ -480,7 +481,7 @@ def info( """ Returns different information about the cluster. - ``_ + ``_ :param target: Limits the information returned to the specific target. Supports a comma-separated list, such as http,ingest. @@ -519,7 +520,7 @@ def pending_tasks( Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ + ``_ :param local: If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the master node. @@ -561,7 +562,7 @@ def post_voting_config_exclusions( """ Updates the cluster voting config exclusions by node ids or node names. - ``_ + ``_ :param node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify @@ -619,7 +620,7 @@ def put_component_template( """ Creates or updates a component template - ``_ + ``_ :param name: Name of the component template to create. Elasticsearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; @@ -705,7 +706,7 @@ def put_settings( """ Updates the cluster settings. - ``_ + ``_ :param flat_settings: Return settings in flat format (default: false) :param master_timeout: Explicit operation timeout for connection to master node @@ -752,7 +753,7 @@ def remote_info( """ Returns the information about configured remote clusters. - ``_ + ``_ """ __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} @@ -793,7 +794,7 @@ def reroute( """ Allows to manually change the allocation of individual shards in the cluster. - ``_ + ``_ :param commands: Defines the commands to perform. :param dry_run: If true, then the request simulates the operation only and returns @@ -877,7 +878,7 @@ def state( """ Returns a comprehensive information about the state of the cluster. - ``_ + ``_ :param metric: Limit the information returned to the specified metrics :param index: A comma-separated list of index names; use `_all` or empty string @@ -951,7 +952,7 @@ def stats( """ Returns high-level overview of cluster statistics. - ``_ + ``_ :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. diff --git a/elasticsearch/_sync/client/dangling_indices.py b/elasticsearch/_sync/client/dangling_indices.py index 96bb95f53..995d46847 100644 --- a/elasticsearch/_sync/client/dangling_indices.py +++ b/elasticsearch/_sync/client/dangling_indices.py @@ -24,6 +24,7 @@ class DanglingIndicesClient(NamespacedClient): + @_rewrite_parameters() def delete_dangling_index( self, @@ -42,7 +43,7 @@ def delete_dangling_index( """ Deletes the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to delete the dangling @@ -93,7 +94,7 @@ def import_dangling_index( """ Imports the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to import the dangling @@ -138,7 +139,7 @@ def list_dangling_indices( """ Returns all dangling indices. - ``_ + ``_ """ __path = "/_dangling" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/enrich.py b/elasticsearch/_sync/client/enrich.py index d4ba21113..f98f162c4 100644 --- a/elasticsearch/_sync/client/enrich.py +++ b/elasticsearch/_sync/client/enrich.py @@ -24,6 +24,7 @@ class EnrichClient(NamespacedClient): + @_rewrite_parameters() def delete_policy( self, @@ -37,7 +38,7 @@ def delete_policy( """ Deletes an existing enrich policy and its enrich index. - ``_ + ``_ :param name: Enrich policy to delete. """ @@ -72,7 +73,7 @@ def execute_policy( """ Creates the enrich index for an existing enrich policy. - ``_ + ``_ :param name: Enrich policy to execute. :param wait_for_completion: If `true`, the request blocks other enrich policy @@ -110,7 +111,7 @@ def get_policy( """ Gets information about an enrich policy. - ``_ + ``_ :param name: Comma-separated list of enrich policy names used to limit the request. To return information for all enrich policies, omit this parameter. @@ -152,7 +153,7 @@ def put_policy( """ Creates a new enrich policy. - ``_ + ``_ :param name: Name of the enrich policy to create or update. :param geo_match: Matches enrich data to incoming documents based on a `geo_shape` @@ -199,7 +200,7 @@ def stats( Gets enrich coordinator statistics and information about enrich policies that are currently executing. - ``_ + ``_ """ __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/eql.py b/elasticsearch/_sync/client/eql.py index 34bbf3cf8..a1ad470f8 100644 --- a/elasticsearch/_sync/client/eql.py +++ b/elasticsearch/_sync/client/eql.py @@ -24,6 +24,7 @@ class EqlClient(NamespacedClient): + @_rewrite_parameters() def delete( self, @@ -38,7 +39,7 @@ def delete( Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ :param id: Identifier for the search to delete. A search ID is provided in the EQL search API's response for an async search. A search ID is also provided @@ -78,7 +79,7 @@ def get( """ Returns async results from previously executed Event Query Language (EQL) search - ``_ + ``_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -123,7 +124,7 @@ def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - ``_ + ``_ :param id: Identifier for the search. """ @@ -205,7 +206,7 @@ def search( """ Returns results matching a query expressed in Event Query Language (EQL) - ``_ + ``_ :param index: The name of the index to scope the operation :param query: EQL query you wish to run. diff --git a/elasticsearch/_sync/client/esql.py b/elasticsearch/_sync/client/esql.py index 250b0492a..2b5ac804c 100644 --- a/elasticsearch/_sync/client/esql.py +++ b/elasticsearch/_sync/client/esql.py @@ -24,6 +24,7 @@ class EsqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=("query", "columnar", "filter", "locale", "params"), ignore_deprecated_options={"params"}, @@ -47,7 +48,7 @@ def query( """ Executes an ESQL request - ``_ + ``_ :param query: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. diff --git a/elasticsearch/_sync/client/features.py b/elasticsearch/_sync/client/features.py index c22398ae7..6470a3acb 100644 --- a/elasticsearch/_sync/client/features.py +++ b/elasticsearch/_sync/client/features.py @@ -24,6 +24,7 @@ class FeaturesClient(NamespacedClient): + @_rewrite_parameters() def get_features( self, @@ -37,7 +38,7 @@ def get_features( Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ + ``_ """ __path = "/_features" __query: t.Dict[str, t.Any] = {} @@ -66,7 +67,7 @@ def reset_features( """ Resets the internal state of features, usually by deleting system indices - ``_ + ``_ """ __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/fleet.py b/elasticsearch/_sync/client/fleet.py index fe0573038..77d43b90c 100644 --- a/elasticsearch/_sync/client/fleet.py +++ b/elasticsearch/_sync/client/fleet.py @@ -24,6 +24,7 @@ class FleetClient(NamespacedClient): + @_rewrite_parameters() def global_checkpoints( self, @@ -42,7 +43,7 @@ def global_checkpoints( Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. - ``_ + ``_ :param index: A single index or index alias that resolves to a single index. :param checkpoints: A comma separated list of previous global checkpoints. When diff --git a/elasticsearch/_sync/client/graph.py b/elasticsearch/_sync/client/graph.py index da8501605..100080a3f 100644 --- a/elasticsearch/_sync/client/graph.py +++ b/elasticsearch/_sync/client/graph.py @@ -24,6 +24,7 @@ class GraphClient(NamespacedClient): + @_rewrite_parameters( body_fields=("connections", "controls", "query", "vertices"), ) @@ -47,7 +48,7 @@ def explore( Explore extracted and summarized information about the documents and terms in an index. - ``_ + ``_ :param index: Name of the index. :param connections: Specifies or more fields from which you want to extract terms diff --git a/elasticsearch/_sync/client/ilm.py b/elasticsearch/_sync/client/ilm.py index d18a476de..b88a286b1 100644 --- a/elasticsearch/_sync/client/ilm.py +++ b/elasticsearch/_sync/client/ilm.py @@ -24,6 +24,7 @@ class IlmClient(NamespacedClient): + @_rewrite_parameters() def delete_lifecycle( self, @@ -42,7 +43,7 @@ def delete_lifecycle( Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -92,7 +93,7 @@ def explain_lifecycle( Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (`*`). To target all data streams and indices, use `*` @@ -151,7 +152,7 @@ def get_lifecycle( Returns the specified policy definition. Includes the policy version and last modified date. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -194,7 +195,7 @@ def get_status( """ Retrieves the current index lifecycle management (ILM) status. - ``_ + ``_ """ __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} @@ -230,7 +231,7 @@ def migrate_to_data_tiers( Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing - ``_ + ``_ :param dry_run: If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. This provides @@ -283,7 +284,7 @@ def move_to_step( """ Manually moves an index into the specified step and executes that step. - ``_ + ``_ :param index: The name of the index whose lifecycle step is to change :param current_step: @@ -337,7 +338,7 @@ def put_lifecycle( """ Creates a lifecycle policy - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -389,7 +390,7 @@ def remove_policy( """ Removes the assigned lifecycle policy and stops managing the specified index - ``_ + ``_ :param index: The name of the index to remove policy on """ @@ -423,7 +424,7 @@ def retry( """ Retries executing the policy for an index that is in the ERROR step. - ``_ + ``_ :param index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry @@ -461,7 +462,7 @@ def start( """ Start the index lifecycle management (ILM) plugin. - ``_ + ``_ :param master_timeout: :param timeout: @@ -502,7 +503,7 @@ def stop( Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin - ``_ + ``_ :param master_timeout: :param timeout: diff --git a/elasticsearch/_sync/client/indices.py b/elasticsearch/_sync/client/indices.py index 1ff902c1f..452ca8e1c 100644 --- a/elasticsearch/_sync/client/indices.py +++ b/elasticsearch/_sync/client/indices.py @@ -24,6 +24,7 @@ class IndicesClient(NamespacedClient): + @_rewrite_parameters() def add_block( self, @@ -52,7 +53,7 @@ def add_block( """ Adds a block to an index. - ``_ + ``_ :param index: A comma separated list of indices to add a block to :param block: The block to add (one of read, write, read_only or metadata) @@ -131,7 +132,7 @@ def analyze( Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ + ``_ :param index: Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the @@ -223,7 +224,7 @@ def clear_cache( """ Clears all or specific caches for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -302,7 +303,7 @@ def clone( """ Clones an index - ``_ + ``_ :param index: Name of the source index to clone. :param target: Name of the target index to create. @@ -382,7 +383,7 @@ def close( """ Closes an index. - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. @@ -459,7 +460,7 @@ def create( """ Creates an index with optional settings and mappings. - ``_ + ``_ :param index: Name of the index you wish to create. :param aliases: Aliases for the index. @@ -523,7 +524,7 @@ def create_data_stream( """ Creates a data stream - ``_ + ``_ :param name: Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, @@ -569,7 +570,7 @@ def data_streams_stats( """ Provides statistics on operations happening in a data stream. - ``_ + ``_ :param name: Comma-separated list of data streams used to limit the request. Wildcard expressions (`*`) are supported. To target all data streams in a @@ -624,7 +625,7 @@ def delete( """ Deletes an index. - ``_ + ``_ :param index: Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. @@ -690,7 +691,7 @@ def delete_alias( """ Deletes an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). @@ -750,7 +751,7 @@ def delete_data_lifecycle( """ Deletes the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams @@ -803,7 +804,7 @@ def delete_data_stream( """ Deletes a data stream. - ``_ + ``_ :param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. @@ -846,7 +847,7 @@ def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -894,7 +895,7 @@ def delete_template( """ Deletes an index template. - ``_ + ``_ :param name: The name of the legacy index template to delete. Wildcard (`*`) expressions are supported. @@ -950,7 +951,7 @@ def disk_usage( """ Analyzes the disk usage of each field of an index or data stream - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single @@ -1017,7 +1018,7 @@ def downsample( """ Downsample an index - ``_ + ``_ :param index: Name of the time series index to downsample. :param target_index: Name of the index to create. @@ -1075,7 +1076,7 @@ def exists( """ Returns information about whether a particular index exists. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). @@ -1147,7 +1148,7 @@ def exists_alias( """ Returns information about whether a particular alias exists. - ``_ + ``_ :param name: Comma-separated list of aliases to check. Supports wildcards (`*`). :param index: Comma-separated list of data streams or indices used to limit the @@ -1211,7 +1212,7 @@ def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1256,7 +1257,7 @@ def exists_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: The comma separated names of the index templates :param flat_settings: Return settings in flat format (default: false) @@ -1305,7 +1306,7 @@ def explain_data_lifecycle( Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - ``_ + ``_ :param index: The name of the index to explain :param include_defaults: indicates if the API should return the default values @@ -1364,7 +1365,7 @@ def field_usage_stats( """ Returns the field usage stats for each field of an index - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. @@ -1446,7 +1447,7 @@ def flush( """ Performs the flush operation on one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to flush. Supports wildcards (`*`). To flush all data streams and indices, omit this @@ -1521,7 +1522,7 @@ def forcemerge( """ Performs the force merge operation on one or more indices. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1610,7 +1611,7 @@ def get( """ Returns information about one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. @@ -1693,7 +1694,7 @@ def get_alias( """ Returns an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). To target all data streams and indices, @@ -1764,7 +1765,7 @@ def get_data_lifecycle( """ Returns the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: Comma-separated list of data streams to limit the request. Supports wildcards (`*`). To target all data streams, omit this parameter or use `*` @@ -1817,7 +1818,7 @@ def get_data_stream( """ Returns data streams. - ``_ + ``_ :param name: Comma-separated list of data stream names used to limit the request. Wildcard (`*`) expressions are supported. If omitted, all data streams are @@ -1875,7 +1876,7 @@ def get_field_mapping( """ Returns mapping for one or more fields. - ``_ + ``_ :param fields: Comma-separated list or wildcard expression of fields used to limit returned information. @@ -1946,7 +1947,7 @@ def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -2013,7 +2014,7 @@ def get_mapping( """ Returns mappings for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -2091,7 +2092,7 @@ def get_settings( """ Returns settings for one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -2170,7 +2171,7 @@ def get_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (`*`) expressions are supported. To return all index templates, @@ -2219,7 +2220,7 @@ def migrate_to_data_stream( """ Migrates an alias to a data stream - ``_ + ``_ :param name: Name of the index alias to convert to a data stream. """ @@ -2256,7 +2257,7 @@ def modify_data_stream( """ Modifies a data stream - ``_ + ``_ :param actions: Actions to perform. """ @@ -2311,7 +2312,7 @@ def open( """ Opens an index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). By default, you must explicitly @@ -2380,7 +2381,7 @@ def promote_data_stream( Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ + ``_ :param name: The name of the data stream """ @@ -2433,7 +2434,7 @@ def put_alias( """ Creates or updates an alias. - ``_ + ``_ :param index: Comma-separated list of data streams or indices to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indices @@ -2532,7 +2533,7 @@ def put_data_lifecycle( """ Updates the data stream lifecycle of the selected data streams. - ``_ + ``_ :param name: Comma-separated list of data streams used to limit the request. Supports wildcards (`*`). To target all data streams use `*` or `_all`. @@ -2618,7 +2619,7 @@ def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name :param composed_of: An ordered list of component template names. Component templates @@ -2744,7 +2745,7 @@ def put_mapping( """ Updates the index mappings. - ``_ + ``_ :param index: A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. @@ -2868,7 +2869,7 @@ def put_settings( """ Updates the index settings. - ``_ + ``_ :param settings: :param index: Comma-separated list of data streams, indices, and aliases used @@ -2966,7 +2967,7 @@ def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. @@ -3043,7 +3044,7 @@ def recovery( """ Returns information about ongoing index shard recoveries. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3097,7 +3098,7 @@ def refresh( """ Performs the refresh operation in one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3159,7 +3160,7 @@ def reload_search_analyzers( """ Reloads an index's search analyzers and their resources. - ``_ + ``_ :param index: A comma-separated list of index names to reload analyzers for :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -3193,6 +3194,75 @@ def reload_search_analyzers( "POST", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + def resolve_cluster( + self, + *, + name: t.Union[str, t.Sequence[str]], + allow_no_indices: t.Optional[bool] = None, + error_trace: t.Optional[bool] = None, + expand_wildcards: t.Optional[ + t.Union[ + t.Sequence[ + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str] + ], + t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str], + ] + ] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + ignore_throttled: t.Optional[bool] = None, + ignore_unavailable: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Resolves the specified index expressions to return information about each cluster, + including the local cluster, if included. + + ``_ + + :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, + and data streams to resolve. Resources on remote clusters can be specified + using the ``:`` syntax. + :param allow_no_indices: If false, the request returns an error if any wildcard + expression, index alias, or _all value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting foo*,bar* returns an error if an index starts + with foo but no index starts with bar. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored + when frozen. Defaults to false. + :param ignore_unavailable: If false, the request returns an error if it targets + a missing or closed index. Defaults to false. + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'name'") + __path = f"/_resolve/cluster/{_quote(name)}" + __query: t.Dict[str, t.Any] = {} + if allow_no_indices is not None: + __query["allow_no_indices"] = allow_no_indices + if error_trace is not None: + __query["error_trace"] = error_trace + if expand_wildcards is not None: + __query["expand_wildcards"] = expand_wildcards + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if ignore_throttled is not None: + __query["ignore_throttled"] = ignore_throttled + if ignore_unavailable is not None: + __query["ignore_unavailable"] = ignore_unavailable + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() def resolve_index( self, @@ -3214,7 +3284,7 @@ def resolve_index( """ Returns information about any matching indices, aliases, and data streams - ``_ + ``_ :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified @@ -3273,7 +3343,7 @@ def rollover( Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ + ``_ :param alias: Name of the data stream or index alias to roll over. :param new_index: Name of the index to create. Supports date math. Data streams @@ -3369,7 +3439,7 @@ def segments( """ Provides low-level information about segments in a Lucene index. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -3440,7 +3510,7 @@ def shard_stores( """ Provides store information for shard copies of indices. - ``_ + ``_ :param index: List of data streams, indices, and aliases used to limit the request. :param allow_no_indices: If false, the request returns an error if any wildcard @@ -3505,7 +3575,7 @@ def shrink( """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ + ``_ :param index: Name of the source index to shrink. :param target: Name of the target index to create. @@ -3594,7 +3664,7 @@ def simulate_index_template( """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ :param name: Index or template name to simulate :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` @@ -3699,7 +3769,7 @@ def simulate_template( """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template @@ -3776,7 +3846,7 @@ def split( """ Allows you to split an existing index into a new index with more primary shards. - ``_ + ``_ :param index: Name of the source index to split. :param target: Name of the target index to create. @@ -3858,7 +3928,7 @@ def stats( """ Provides statistics on operations happening in an index. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -3954,7 +4024,7 @@ def unfreeze( Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ + ``_ :param index: Identifier for the index. :param allow_no_indices: If `false`, the request returns an error if any wildcard @@ -4024,7 +4094,7 @@ def update_aliases( """ Updates index aliases. - ``_ + ``_ :param actions: Actions to perform. :param master_timeout: Period to wait for a connection to the master node. If @@ -4092,7 +4162,7 @@ def validate_query( """ Allows a user to validate a potentially expensive query without executing it. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this diff --git a/elasticsearch/_sync/client/inference.py b/elasticsearch/_sync/client/inference.py index 8f1f6b619..a7f0ac1df 100644 --- a/elasticsearch/_sync/client/inference.py +++ b/elasticsearch/_sync/client/inference.py @@ -24,12 +24,15 @@ class InferenceClient(NamespacedClient): + @_rewrite_parameters() def delete_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -38,16 +41,19 @@ def delete_model( """ Delete model in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace @@ -66,8 +72,10 @@ def delete_model( def get_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -76,16 +84,19 @@ def get_model( """ Get a model in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace @@ -106,9 +117,11 @@ def get_model( def inference( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, input: t.Optional[t.Union[str, t.Sequence[str]]] = None, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -119,20 +132,23 @@ def inference( """ Perform inference on a model - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id :param input: Text input to the model. Either a string or an array of strings. + :param task_type: The task type :param task_settings: Optional task settings """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") if input is None and body is None: raise ValueError("Empty value passed for parameter 'input'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: @@ -163,8 +179,10 @@ def inference( def put_model( self, *, - task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str], - model_id: str, + inference_id: str, + task_type: t.Optional[ + t.Union["t.Literal['sparse_embedding', 'text_embedding']", str] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -175,23 +193,26 @@ def put_model( """ Configure a model for use in the Inference API - ``_ + ``_ - :param task_type: The model task type - :param model_id: The unique identifier of the inference model. + :param inference_id: The inference Id + :param task_type: The task type :param model_config: """ - if task_type in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'task_type'") - if model_id in SKIP_IN_PATH: - raise ValueError("Empty value passed for parameter 'model_id'") + if inference_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'inference_id'") if model_config is None and body is None: raise ValueError( "Empty value passed for parameters 'model_config' and 'body', one of them should be set." ) elif model_config is not None and body is not None: raise ValueError("Cannot set both 'model_config' and 'body'") - __path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}" + if task_type not in SKIP_IN_PATH and inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(task_type)}/{_quote(inference_id)}" + elif inference_id not in SKIP_IN_PATH: + __path = f"/_inference/{_quote(inference_id)}" + else: + raise ValueError("Couldn't find a path for the given parameters") __query: t.Dict[str, t.Any] = {} if error_trace is not None: __query["error_trace"] = error_trace diff --git a/elasticsearch/_sync/client/ingest.py b/elasticsearch/_sync/client/ingest.py index b986bd3b2..d871e88bd 100644 --- a/elasticsearch/_sync/client/ingest.py +++ b/elasticsearch/_sync/client/ingest.py @@ -24,6 +24,7 @@ class IngestClient(NamespacedClient): + @_rewrite_parameters() def delete_pipeline( self, @@ -41,7 +42,7 @@ def delete_pipeline( """ Deletes a pipeline. - ``_ + ``_ :param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of `*`. @@ -84,7 +85,7 @@ def geo_ip_stats( """ Returns statistical information about geoip databases - ``_ + ``_ """ __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} @@ -118,7 +119,7 @@ def get_pipeline( """ Returns a pipeline. - ``_ + ``_ :param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions are supported. To get all ingest pipelines, omit this parameter or use `*`. @@ -161,7 +162,7 @@ def processor_grok( """ Returns a list of the built-in patterns. - ``_ + ``_ """ __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} @@ -205,7 +206,7 @@ def put_pipeline( """ Creates or updates a pipeline. - ``_ + ``_ :param id: ID of the ingest pipeline to create or update. :param description: Description of the ingest pipeline. @@ -284,7 +285,7 @@ def simulate( """ Allows to simulate a pipeline with example documents. - ``_ + ``_ :param id: Pipeline to test. If you don’t specify a `pipeline` in the request body, this parameter is required. diff --git a/elasticsearch/_sync/client/license.py b/elasticsearch/_sync/client/license.py index e70cfb571..62197f383 100644 --- a/elasticsearch/_sync/client/license.py +++ b/elasticsearch/_sync/client/license.py @@ -24,6 +24,7 @@ class LicenseClient(NamespacedClient): + @_rewrite_parameters() def delete( self, @@ -36,7 +37,7 @@ def delete( """ Deletes licensing information for the cluster - ``_ + ``_ """ __path = "/_license" __query: t.Dict[str, t.Any] = {} @@ -67,7 +68,7 @@ def get( """ Retrieves licensing information for the cluster - ``_ + ``_ :param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum @@ -107,7 +108,7 @@ def get_basic_status( """ Retrieves information about the status of the basic license. - ``_ + ``_ """ __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} @@ -136,7 +137,7 @@ def get_trial_status( """ Retrieves information about the status of the trial license. - ``_ + ``_ """ __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} @@ -171,7 +172,7 @@ def post( """ Updates the license for the cluster. - ``_ + ``_ :param acknowledge: Specifies whether you acknowledge the license changes. :param license: @@ -218,7 +219,7 @@ def post_start_basic( """ Starts an indefinite basic license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) @@ -254,7 +255,7 @@ def post_start_trial( """ starts a limited time trial license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) diff --git a/elasticsearch/_sync/client/logstash.py b/elasticsearch/_sync/client/logstash.py index 67ad8c35a..dbd45e308 100644 --- a/elasticsearch/_sync/client/logstash.py +++ b/elasticsearch/_sync/client/logstash.py @@ -24,6 +24,7 @@ class LogstashClient(NamespacedClient): + @_rewrite_parameters() def delete_pipeline( self, @@ -37,7 +38,7 @@ def delete_pipeline( """ Deletes Logstash Pipelines used by Central Management - ``_ + ``_ :param id: Identifier for the pipeline. """ @@ -71,7 +72,7 @@ def get_pipeline( """ Retrieves Logstash Pipelines used by Central Management - ``_ + ``_ :param id: Comma-separated list of pipeline identifiers. """ @@ -110,7 +111,7 @@ def put_pipeline( """ Adds and updates Logstash Pipelines used for Central Management - ``_ + ``_ :param id: Identifier for the pipeline. :param pipeline: diff --git a/elasticsearch/_sync/client/migration.py b/elasticsearch/_sync/client/migration.py index db763246f..090c1cbf4 100644 --- a/elasticsearch/_sync/client/migration.py +++ b/elasticsearch/_sync/client/migration.py @@ -24,6 +24,7 @@ class MigrationClient(NamespacedClient): + @_rewrite_parameters() def deprecations( self, @@ -39,7 +40,7 @@ def deprecations( that use deprecated features that will be removed or changed in the next major version. - ``_ + ``_ :param index: Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported. @@ -74,7 +75,7 @@ def get_feature_upgrade_status( """ Find out whether system features need to be upgraded or not - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} @@ -103,7 +104,7 @@ def post_feature_upgrade( """ Begin upgrades for system features - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index fe9821b87..14fd4bc8c 100644 --- a/elasticsearch/_sync/client/ml.py +++ b/elasticsearch/_sync/client/ml.py @@ -24,6 +24,7 @@ class MlClient(NamespacedClient): + @_rewrite_parameters() def clear_trained_model_deployment_cache( self, @@ -37,7 +38,7 @@ def clear_trained_model_deployment_cache( """ Clear the cached results from a trained model deployment - ``_ + ``_ :param model_id: The unique identifier of the trained model. """ @@ -78,7 +79,7 @@ def close_job( Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection @@ -132,7 +133,7 @@ def delete_calendar( """ Deletes a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. """ @@ -167,7 +168,7 @@ def delete_calendar_event( """ Deletes scheduled events from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param event_id: Identifier for the scheduled event. You can obtain this identifier @@ -206,7 +207,7 @@ def delete_calendar_job( """ Deletes anomaly detection jobs from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -246,7 +247,7 @@ def delete_data_frame_analytics( """ Deletes an existing data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param force: If `true`, it deletes a job that is not stopped; this method is @@ -288,7 +289,7 @@ def delete_datafeed( """ Deletes an existing datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -334,7 +335,7 @@ def delete_expired_data( """ Deletes expired and unused machine learning data. - ``_ + ``_ :param job_id: Identifier for an anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. @@ -384,7 +385,7 @@ def delete_filter( """ Deletes a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. """ @@ -421,7 +422,7 @@ def delete_forecast( """ Deletes forecasts from a machine learning job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param forecast_id: A comma-separated list of forecast identifiers. If you do @@ -477,7 +478,7 @@ def delete_job( """ Deletes an existing anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param delete_user_annotations: Specifies whether annotations that have been @@ -525,7 +526,7 @@ def delete_model_snapshot( """ Deletes an existing model snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -564,7 +565,7 @@ def delete_trained_model( Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param force: Forcefully deletes a trained model that is referenced by ingest @@ -603,7 +604,7 @@ def delete_trained_model_alias( """ Deletes a model alias that refers to the trained model - ``_ + ``_ :param model_id: The trained model ID to which the model alias refers. :param model_alias: The model alias to delete. @@ -649,7 +650,7 @@ def estimate_model_memory( """ Estimates the model memory - ``_ + ``_ :param analysis_config: For a list of the properties that you can specify in the `analysis_config` component of the body of this API. @@ -707,7 +708,7 @@ def evaluate_data_frame( """ Evaluates the data frame analytics for an annotated index. - ``_ + ``_ :param evaluation: Defines the type of evaluation you want to perform. :param index: Defines the `index` in which the evaluation will be performed. @@ -774,7 +775,7 @@ def explain_data_frame_analytics( """ Explains a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -865,7 +866,7 @@ def flush_job( """ Forces any buffered data to be processed by the job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param advance_time: Refer to the description for the `advance_time` query parameter. @@ -926,7 +927,7 @@ def forecast( """ Predicts the future behavior of a time series by using its historical behavior. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs. @@ -1001,7 +1002,7 @@ def get_buckets( """ Retrieves anomaly detection job results for one or more buckets. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timestamp: The timestamp of a single bucket result. If you do not specify @@ -1087,7 +1088,7 @@ def get_calendar_events( """ Retrieves information about the scheduled events in calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1147,7 +1148,7 @@ def get_calendars( """ Retrieves configuration information for calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1211,7 +1212,7 @@ def get_categories( """ Retrieves anomaly detection job results for one or more categories. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param category_id: Identifier for the category, which is unique in the job. @@ -1279,7 +1280,7 @@ def get_data_frame_analytics( """ Retrieves configuration information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1343,7 +1344,7 @@ def get_data_frame_analytics_stats( """ Retrieves usage information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1400,7 +1401,7 @@ def get_datafeed_stats( """ Retrieves usage information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1448,7 +1449,7 @@ def get_datafeeds( """ Retrieves configuration information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1503,7 +1504,7 @@ def get_filters( """ Retrieves filters. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param from_: Skips the specified number of filters. @@ -1557,7 +1558,7 @@ def get_influencers( """ Retrieves anomaly detection job results for one or more influencers. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: If true, the results are sorted in descending order. @@ -1631,7 +1632,7 @@ def get_job_stats( """ Retrieves usage information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If @@ -1680,7 +1681,7 @@ def get_jobs( """ Retrieves configuration information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these @@ -1735,7 +1736,7 @@ def get_memory_stats( """ Returns information on how ML is using memory. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. For example, `nodeId1,nodeId2` or `ml:true` @@ -1782,7 +1783,7 @@ def get_model_snapshot_upgrade_stats( """ Gets stats for anomaly detection job model snapshot upgrades that are in progress. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1844,7 +1845,7 @@ def get_model_snapshots( """ Retrieves information about model snapshots. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1934,7 +1935,7 @@ def get_overall_buckets( Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. @@ -2022,7 +2023,7 @@ def get_records( """ Retrieves anomaly records for an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: Refer to the description for the `desc` query parameter. @@ -2104,7 +2105,7 @@ def get_trained_models( """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: - Contains wildcard @@ -2176,7 +2177,7 @@ def get_trained_models_stats( """ Retrieves usage information for trained inference models. - ``_ + ``_ :param model_id: The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression. @@ -2231,7 +2232,7 @@ def infer_trained_model( """ Evaluate a trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param docs: An array of objects to pass to the model for inference. The objects @@ -2281,7 +2282,7 @@ def info( """ Returns defaults and limits used by machine learning. - ``_ + ``_ """ __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} @@ -2315,7 +2316,7 @@ def open_job( """ Opens one or more anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timeout: Refer to the description for the `timeout` query parameter. @@ -2362,7 +2363,7 @@ def post_calendar_events( """ Posts scheduled events in a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param events: A list of one of more scheduled events. The event’s start and @@ -2411,7 +2412,7 @@ def post_data( """ Sends data to an anomaly detection job for analysis. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. @@ -2467,7 +2468,7 @@ def preview_data_frame_analytics( """ Previews that will be analyzed given a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param config: A data frame analytics config as described in create data frame @@ -2520,7 +2521,7 @@ def preview_datafeed( """ Previews a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -2587,7 +2588,7 @@ def put_calendar( """ Instantiates a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param description: A description of the calendar. @@ -2634,7 +2635,7 @@ def put_calendar_job( """ Adds an anomaly detection job to a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -2697,7 +2698,7 @@ def put_data_frame_analytics( """ Instantiates a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -2858,7 +2859,7 @@ def put_datafeed( """ Instantiates a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3004,7 +3005,7 @@ def put_filter( """ Instantiates a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param description: A description of the filter. @@ -3083,7 +3084,7 @@ def put_job( """ Instantiates an anomaly detection job. - ``_ + ``_ :param job_id: The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and @@ -3253,7 +3254,7 @@ def put_trained_model( """ Creates an inference trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param compressed_definition: The compressed (GZipped and Base64 encoded) inference @@ -3342,7 +3343,7 @@ def put_trained_model_alias( Creates a new model alias (or reassigns an existing one) to refer to the trained model - ``_ + ``_ :param model_id: The identifier for the trained model that the alias refers to. :param model_alias: The alias to create or update. This value cannot end in numbers. @@ -3391,7 +3392,7 @@ def put_trained_model_definition_part( """ Creates part of a trained model definition - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param part: The definition part number. When the definition is loaded for inference @@ -3458,7 +3459,7 @@ def put_trained_model_vocabulary( """ Creates a trained model vocabulary - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. @@ -3507,7 +3508,7 @@ def reset_job( """ Resets an existing anomaly detection job. - ``_ + ``_ :param job_id: The ID of the job to reset. :param delete_user_annotations: Specifies whether annotations that have been @@ -3555,7 +3556,7 @@ def revert_model_snapshot( """ Reverts to a specific snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: You can specify `empty` as the . Reverting to @@ -3606,7 +3607,7 @@ def set_upgrade_mode( Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. - ``_ + ``_ :param enabled: When `true`, it enables `upgrade_mode` which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from @@ -3646,7 +3647,7 @@ def start_data_frame_analytics( """ Starts a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3692,7 +3693,7 @@ def start_datafeed( """ Starts one or more datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3754,7 +3755,7 @@ def start_trained_model_deployment( """ Start a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. Currently, only PyTorch models are supported. @@ -3831,7 +3832,7 @@ def stop_data_frame_analytics( """ Stops one or more data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3890,7 +3891,7 @@ def stop_datafeed( """ Stops one or more datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a @@ -3945,7 +3946,7 @@ def stop_trained_model_deployment( """ Stop a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -4004,7 +4005,7 @@ def update_data_frame_analytics( """ Updates certain properties of a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -4105,7 +4106,7 @@ def update_datafeed( """ Updates certain properties of a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -4261,7 +4262,7 @@ def update_filter( """ Updates the description of a filter, adds items, or removes items. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param add_items: The items to add to the filter. @@ -4344,7 +4345,7 @@ def update_job( """ Updates certain properties of an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the job. :param allow_lazy_open: Advanced configuration option. Specifies whether this @@ -4465,7 +4466,7 @@ def update_model_snapshot( """ Updates certain properties of a snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -4515,7 +4516,7 @@ def upgrade_job_snapshot( """ Upgrades a given job snapshot to the current major version. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -4582,7 +4583,7 @@ def validate( """ Validates an anomaly detection job. - ``_ + ``_ :param analysis_config: :param analysis_limits: @@ -4645,7 +4646,7 @@ def validate_detector( """ Validates an anomaly detection detector. - ``_ + ``_ :param detector: """ diff --git a/elasticsearch/_sync/client/monitoring.py b/elasticsearch/_sync/client/monitoring.py index 32c1a9fef..d05ef9205 100644 --- a/elasticsearch/_sync/client/monitoring.py +++ b/elasticsearch/_sync/client/monitoring.py @@ -24,6 +24,7 @@ class MonitoringClient(NamespacedClient): + @_rewrite_parameters( body_name="operations", ) @@ -43,7 +44,7 @@ def bulk( """ Used by the monitoring features to send monitoring data. - ``_ + ``_ :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload :param operations: diff --git a/elasticsearch/_sync/client/nodes.py b/elasticsearch/_sync/client/nodes.py index 74f6efd89..42b6a9861 100644 --- a/elasticsearch/_sync/client/nodes.py +++ b/elasticsearch/_sync/client/nodes.py @@ -24,6 +24,7 @@ class NodesClient(NamespacedClient): + @_rewrite_parameters() def clear_repositories_metering_archive( self, @@ -38,7 +39,7 @@ def clear_repositories_metering_archive( """ Removes the archived repositories metering information present in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -77,7 +78,7 @@ def get_repositories_metering_info( """ Returns cluster repositories metering information. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -126,7 +127,7 @@ def hot_threads( """ Returns information about hot threads on each node in the cluster. - ``_ + ``_ :param node_id: List of node IDs or names used to limit returned information. :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket @@ -195,7 +196,7 @@ def info( """ Returns information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -254,7 +255,7 @@ def reload_secure_settings( """ Reloads secure settings. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. :param secure_settings_password: The password for the Elasticsearch keystore. @@ -318,7 +319,7 @@ def stats( """ Returns statistical information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -414,7 +415,7 @@ def usage( """ Returns low-level information about REST actions usage on nodes. - ``_ + ``_ :param node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting diff --git a/elasticsearch/_sync/client/query_ruleset.py b/elasticsearch/_sync/client/query_ruleset.py index db44f11b9..9fdaf8790 100644 --- a/elasticsearch/_sync/client/query_ruleset.py +++ b/elasticsearch/_sync/client/query_ruleset.py @@ -24,6 +24,7 @@ class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() def delete( self, @@ -37,7 +38,7 @@ def delete( """ Deletes a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset to delete """ @@ -71,7 +72,7 @@ def get( """ Returns the details about a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset """ @@ -108,7 +109,7 @@ def list( """ Lists query rulesets. - ``_ + ``_ :param from_: Starting offset (default: 0) :param size: specifies a max number of results to get @@ -149,7 +150,7 @@ def put( """ Creates or updates a query ruleset. - ``_ + ``_ :param ruleset_id: The unique identifier of the query ruleset to be created or updated diff --git a/elasticsearch/_sync/client/rollup.py b/elasticsearch/_sync/client/rollup.py index 6a4e377af..9200f1a12 100644 --- a/elasticsearch/_sync/client/rollup.py +++ b/elasticsearch/_sync/client/rollup.py @@ -24,6 +24,7 @@ class RollupClient(NamespacedClient): + @_rewrite_parameters() def delete_job( self, @@ -37,7 +38,7 @@ def delete_job( """ Deletes an existing rollup job. - ``_ + ``_ :param id: Identifier for the job. """ @@ -71,7 +72,7 @@ def get_jobs( """ Retrieves the configuration, stats, and status of rollup jobs. - ``_ + ``_ :param id: Identifier for the rollup job. If it is `_all` or omitted, the API returns all rollup jobs. @@ -108,7 +109,7 @@ def get_rollup_caps( Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - ``_ + ``_ :param id: Index, indices or index-pattern to return rollup capabilities for. `_all` may be used to fetch rollup capabilities from all jobs. @@ -145,7 +146,7 @@ def get_rollup_index_caps( Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - ``_ + ``_ :param index: Data stream or index to check for rollup capabilities. Wildcard (`*`) expressions are supported. @@ -201,7 +202,7 @@ def put_job( """ Creates a rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. @@ -310,7 +311,7 @@ def rollup_search( """ Enables searching rolled-up data using the standard query DSL. - ``_ + ``_ :param index: Enables searching rolled-up data using the standard Query DSL. :param aggregations: Specifies aggregations. @@ -366,7 +367,7 @@ def start_job( """ Starts an existing, stopped rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. """ @@ -402,7 +403,7 @@ def stop_job( """ Stops an existing, started rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. :param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum) diff --git a/elasticsearch/_sync/client/search_application.py b/elasticsearch/_sync/client/search_application.py index 623d29cdf..c872bf930 100644 --- a/elasticsearch/_sync/client/search_application.py +++ b/elasticsearch/_sync/client/search_application.py @@ -24,6 +24,7 @@ class SearchApplicationClient(NamespacedClient): + @_rewrite_parameters() def delete( self, @@ -37,7 +38,7 @@ def delete( """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -71,7 +72,7 @@ def delete_behavioral_analytics( """ Delete a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be deleted """ @@ -105,7 +106,7 @@ def get( """ Returns the details about a search application. - ``_ + ``_ :param name: The name of the search application """ @@ -139,7 +140,7 @@ def get_behavioral_analytics( """ Returns the existing behavioral analytics collections. - ``_ + ``_ :param name: A list of analytics collections to limit the returned information """ @@ -178,7 +179,7 @@ def list( """ Returns the existing search applications. - ``_ + ``_ :param from_: Starting offset. :param q: Query in the Lucene query string syntax. @@ -223,7 +224,7 @@ def put( """ Creates or updates a search application. - ``_ + ``_ :param name: The name of the search application to be created or updated. :param search_application: @@ -269,7 +270,7 @@ def put_behavioral_analytics( """ Creates a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be created or updated. """ @@ -308,7 +309,7 @@ def search( """ Perform a search against a search application - ``_ + ``_ :param name: The name of the search application to be searched. :param params: Query parameters specific to this request, which will override diff --git a/elasticsearch/_sync/client/searchable_snapshots.py b/elasticsearch/_sync/client/searchable_snapshots.py index e3a8fc858..0d36d1ba9 100644 --- a/elasticsearch/_sync/client/searchable_snapshots.py +++ b/elasticsearch/_sync/client/searchable_snapshots.py @@ -24,6 +24,7 @@ class SearchableSnapshotsClient(NamespacedClient): + @_rewrite_parameters() def cache_stats( self, @@ -40,7 +41,7 @@ def cache_stats( """ Retrieve node-level cache statistics about searchable snapshots. - ``_ + ``_ :param node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting @@ -90,7 +91,7 @@ def clear_cache( """ Clear the cache of searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -156,7 +157,7 @@ def mount( """ Mount a snapshot as a searchable index. - ``_ + ``_ :param repository: The name of the repository containing the snapshot of the index to mount @@ -224,7 +225,7 @@ def stats( """ Retrieve shard-level statistics about searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param level: Return stats aggregated at cluster, index or shard level diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index abf825dfa..5e0181153 100644 --- a/elasticsearch/_sync/client/security.py +++ b/elasticsearch/_sync/client/security.py @@ -24,6 +24,7 @@ class SecurityClient(NamespacedClient): + @_rewrite_parameters( body_fields=("grant_type", "access_token", "password", "username"), ) @@ -45,7 +46,7 @@ def activate_user_profile( """ Creates or updates the user profile on behalf of another user. - ``_ + ``_ :param grant_type: :param access_token: @@ -92,7 +93,7 @@ def authenticate( Enables authentication as a user and retrieve information about the authenticated user. - ``_ + ``_ """ __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} @@ -130,7 +131,7 @@ def change_password( """ Changes the passwords of users in the native realm and built-in users. - ``_ + ``_ :param username: The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user. @@ -183,7 +184,7 @@ def clear_api_key_cache( """ Clear a subset or all entries from the API key cache. - ``_ + ``_ :param ids: Comma-separated list of API key IDs to evict from the API key cache. To evict all API keys, use `*`. Does not support other wildcard patterns. @@ -218,7 +219,7 @@ def clear_cached_privileges( """ Evicts application privileges from the native application privileges cache. - ``_ + ``_ :param application: A comma-separated list of application names """ @@ -254,7 +255,7 @@ def clear_cached_realms( Evicts users from the user cache. Can completely clear the cache or evict specific users. - ``_ + ``_ :param realms: Comma-separated list of realms to clear :param usernames: Comma-separated list of usernames to clear from the cache @@ -291,7 +292,7 @@ def clear_cached_roles( """ Evicts roles from the native role cache. - ``_ + ``_ :param name: Role name """ @@ -327,7 +328,7 @@ def clear_cached_service_tokens( """ Evicts tokens from the service account token caches. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -376,7 +377,7 @@ def create_api_key( """ Creates an API key for access without requiring basic authentication. - ``_ + ``_ :param expiration: Expiration time for the API key. By default, API keys never expire. @@ -441,7 +442,7 @@ def create_service_token( """ Creates a service account token for access without requiring basic authentication. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -499,7 +500,7 @@ def delete_privileges( """ Removes application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -544,7 +545,7 @@ def delete_role( """ Removes roles in the native realm. - ``_ + ``_ :param name: Role name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -586,7 +587,7 @@ def delete_role_mapping( """ Removes role mappings. - ``_ + ``_ :param name: Role-mapping name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -630,7 +631,7 @@ def delete_service_token( """ Deletes a service account token. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -678,7 +679,7 @@ def delete_user( """ Deletes users from the native realm. - ``_ + ``_ :param username: username :param refresh: If `true` (the default) then refresh the affected shards to make @@ -720,7 +721,7 @@ def disable_user( """ Disables users in the native realm. - ``_ + ``_ :param username: The username of the user to disable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -762,7 +763,7 @@ def disable_user_profile( """ Disables a user profile so it's not visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -804,7 +805,7 @@ def enable_user( """ Enables users in the native realm. - ``_ + ``_ :param username: The username of the user to enable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -846,7 +847,7 @@ def enable_user_profile( """ Enables a user profile so it's visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -885,7 +886,7 @@ def enroll_kibana( Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. - ``_ + ``_ """ __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} @@ -914,7 +915,7 @@ def enroll_node( """ Allows a new node to enroll to an existing cluster with security enabled. - ``_ + ``_ """ __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} @@ -950,7 +951,7 @@ def get_api_key( """ Retrieves information for one or more API keys. - ``_ + ``_ :param active_only: A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, @@ -1015,7 +1016,7 @@ def get_builtin_privileges( Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. - ``_ + ``_ """ __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} @@ -1046,7 +1047,7 @@ def get_privileges( """ Retrieves application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -1084,7 +1085,7 @@ def get_role( """ Retrieves roles in the native realm. - ``_ + ``_ :param name: The name of the role. You can specify multiple roles as a comma-separated list. If you do not specify this parameter, the API returns information about @@ -1121,7 +1122,7 @@ def get_role_mapping( """ Retrieves role mappings. - ``_ + ``_ :param name: The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does @@ -1161,7 +1162,7 @@ def get_service_accounts( """ Retrieves information about service accounts. - ``_ + ``_ :param namespace: Name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit @@ -1203,7 +1204,7 @@ def get_service_credentials( """ Retrieves information of all service credentials for a service account. - ``_ + ``_ :param namespace: Name of the namespace. :param service: Name of the service name. @@ -1260,7 +1261,7 @@ def get_token( """ Creates a bearer token for access without requiring basic authentication. - ``_ + ``_ :param grant_type: :param kerberos_ticket: @@ -1312,7 +1313,7 @@ def get_user( """ Retrieves information about users in the native realm and built-in users. - ``_ + ``_ :param username: An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves @@ -1355,7 +1356,7 @@ def get_user_privileges( """ Retrieves security privileges for the logged in user. - ``_ + ``_ :param application: The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, @@ -1399,7 +1400,7 @@ def get_user_profile( """ Retrieves user profiles for the given unique ID(s). - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: List of filters for the `data` field of the profile document. To @@ -1457,7 +1458,7 @@ def grant_api_key( """ Creates an API key on behalf of another user. - ``_ + ``_ :param api_key: Defines the API key. :param grant_type: The type of grant. Supported grant types are: `access_token`, @@ -1531,7 +1532,7 @@ def has_privileges( """ Determines whether the specified user has a specified list of privileges. - ``_ + ``_ :param user: Username :param application: @@ -1582,7 +1583,7 @@ def has_privileges_user_profile( Determines whether the users associated with the specified profile IDs have all the requested privileges. - ``_ + ``_ :param privileges: :param uids: A list of profile IDs. The privileges are checked for associated @@ -1634,7 +1635,7 @@ def invalidate_api_key( """ Invalidates one or more API keys. - ``_ + ``_ :param id: :param ids: A list of API key ids. This parameter cannot be used with any of @@ -1698,7 +1699,7 @@ def invalidate_token( """ Invalidates one or more access tokens or refresh tokens. - ``_ + ``_ :param realm_name: :param refresh_token: @@ -1751,7 +1752,7 @@ def put_privileges( """ Adds or updates application privileges. - ``_ + ``_ :param privileges: :param refresh: If `true` (the default) then refresh the affected shards to make @@ -1824,7 +1825,7 @@ def put_role( """ Adds and updates roles in the native realm. - ``_ + ``_ :param name: The name of the role. :param applications: A list of application privilege entries. @@ -1914,7 +1915,7 @@ def put_role_mapping( """ Creates and updates role mappings. - ``_ + ``_ :param name: Role-mapping name :param enabled: @@ -1995,7 +1996,7 @@ def put_user( Adds and updates users in the native realm. These users are commonly referred to as native users. - ``_ + ``_ :param username: The username of the User :param email: @@ -2073,7 +2074,7 @@ def query_api_keys( """ Retrieves information for API keys using a subset of query DSL - ``_ + ``_ :param from_: Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more @@ -2156,7 +2157,7 @@ def saml_authenticate( Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair - ``_ + ``_ :param content: The SAML response as it was sent by the user’s browser, usually a Base64 encoded XML document. @@ -2211,7 +2212,7 @@ def saml_complete_logout( """ Verifies the logout response sent from the SAML IdP - ``_ + ``_ :param ids: A json array with all the valid SAML Request Ids that the caller of the API has for the current user. @@ -2270,7 +2271,7 @@ def saml_invalidate( """ Consumes a SAML LogoutRequest - ``_ + ``_ :param query_string: The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout. This query should include @@ -2331,7 +2332,7 @@ def saml_logout( Invalidates an access token and a refresh token that were generated via the SAML Authenticate API - ``_ + ``_ :param token: The access token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent token that was received @@ -2381,7 +2382,7 @@ def saml_prepare_authentication( """ Creates a SAML authentication request - ``_ + ``_ :param acs: The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication @@ -2429,7 +2430,7 @@ def saml_service_provider_metadata( """ Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider - ``_ + ``_ :param realm_name: The name of the SAML realm in Elasticsearch. """ @@ -2469,7 +2470,7 @@ def suggest_user_profiles( """ Get suggestions for user profiles that match specified search criteria. - ``_ + ``_ :param data: List of filters for the `data` field of the profile document. To return all content use `data=*`. To return a subset of content use `data=` @@ -2531,7 +2532,7 @@ def update_api_key( """ Updates attributes of an existing API key. - ``_ + ``_ :param id: The ID of the API key to update. :param expiration: Expiration time for the API key. @@ -2599,7 +2600,7 @@ def update_user_profile_data( """ Update application specific data for the user profile of the given unique ID. - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: Non-searchable data that you want to associate with the user profile. diff --git a/elasticsearch/_sync/client/shutdown.py b/elasticsearch/_sync/client/shutdown.py index 9b93bf2d2..b3e2caf90 100644 --- a/elasticsearch/_sync/client/shutdown.py +++ b/elasticsearch/_sync/client/shutdown.py @@ -24,6 +24,7 @@ class ShutdownClient(NamespacedClient): + @_rewrite_parameters() def delete_node( self, diff --git a/elasticsearch/_sync/client/slm.py b/elasticsearch/_sync/client/slm.py index 7539a0960..55ac7619d 100644 --- a/elasticsearch/_sync/client/slm.py +++ b/elasticsearch/_sync/client/slm.py @@ -24,6 +24,7 @@ class SlmClient(NamespacedClient): + @_rewrite_parameters() def delete_lifecycle( self, @@ -37,7 +38,7 @@ def delete_lifecycle( """ Deletes an existing snapshot lifecycle policy. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to remove """ @@ -72,7 +73,7 @@ def execute_lifecycle( Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to be executed """ @@ -105,7 +106,7 @@ def execute_retention( """ Deletes any snapshots that are expired according to the policy's retention rules. - ``_ + ``_ """ __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} @@ -136,7 +137,7 @@ def get_lifecycle( Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. - ``_ + ``_ :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve """ @@ -171,7 +172,7 @@ def get_stats( Returns global and policy-level statistics about actions taken by snapshot lifecycle management. - ``_ + ``_ """ __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} @@ -200,7 +201,7 @@ def get_status( """ Retrieves the status of snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} @@ -242,7 +243,7 @@ def put_lifecycle( """ Creates or updates a snapshot lifecycle policy. - ``_ + ``_ :param policy_id: ID for the snapshot lifecycle policy you want to create or update. @@ -312,7 +313,7 @@ def start( """ Turns on snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} @@ -341,7 +342,7 @@ def stop( """ Turns off snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/snapshot.py b/elasticsearch/_sync/client/snapshot.py index d3cec40c5..3cedec280 100644 --- a/elasticsearch/_sync/client/snapshot.py +++ b/elasticsearch/_sync/client/snapshot.py @@ -24,6 +24,7 @@ class SnapshotClient(NamespacedClient): + @_rewrite_parameters() def cleanup_repository( self, @@ -41,7 +42,7 @@ def cleanup_repository( """ Removes stale data from repository. - ``_ + ``_ :param name: Snapshot repository to clean up. :param master_timeout: Period to wait for a connection to the master node. @@ -91,7 +92,7 @@ def clone( """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ + ``_ :param repository: A repository name :param snapshot: The name of the snapshot to clone from @@ -165,7 +166,7 @@ def create( """ Creates a snapshot in a repository. - ``_ + ``_ :param repository: Repository for the snapshot. :param snapshot: Name of the snapshot. Must be unique in the repository. @@ -240,14 +241,14 @@ def create( ) @_rewrite_parameters( - body_fields=("settings", "type", "repository"), + body_name="repository", ) def create_repository( self, *, name: str, - settings: t.Optional[t.Mapping[str, t.Any]] = None, - type: t.Optional[str] = None, + repository: t.Optional[t.Mapping[str, t.Any]] = None, + body: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -255,33 +256,30 @@ def create_repository( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, pretty: t.Optional[bool] = None, - repository: t.Optional[t.Mapping[str, t.Any]] = None, timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None, verify: t.Optional[bool] = None, - body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a repository. - ``_ + ``_ :param name: A repository name - :param settings: - :param type: - :param master_timeout: Explicit operation timeout for connection to master node :param repository: + :param master_timeout: Explicit operation timeout for connection to master node :param timeout: Explicit operation timeout :param verify: Whether to verify the repository after creation """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") - if settings is None and body is None: - raise ValueError("Empty value passed for parameter 'settings'") - if type is None and body is None: - raise ValueError("Empty value passed for parameter 'type'") + if repository is None and body is None: + raise ValueError( + "Empty value passed for parameters 'repository' and 'body', one of them should be set." + ) + elif repository is not None and body is not None: + raise ValueError("Cannot set both 'repository' and 'body'") __path = f"/_snapshot/{_quote(name)}" __query: t.Dict[str, t.Any] = {} - __body: t.Dict[str, t.Any] = body if body is not None else {} if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: @@ -296,13 +294,7 @@ def create_repository( __query["timeout"] = timeout if verify is not None: __query["verify"] = verify - if not __body: - if settings is not None: - __body["settings"] = settings - if type is not None: - __body["type"] = type - if repository is not None: - __body["repository"] = repository + __body = repository if repository is not None else body __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body @@ -325,7 +317,7 @@ def delete( """ Deletes one or more snapshots. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -369,7 +361,7 @@ def delete_repository( """ Deletes a repository. - ``_ + ``_ :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -431,7 +423,7 @@ def get( """ Returns information about a snapshot. - ``_ + ``_ :param repository: Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. @@ -536,7 +528,7 @@ def get_repository( """ Returns information about a repository. - ``_ + ``_ :param name: A comma-separated list of repository names :param local: Return local information, do not retrieve the state from master @@ -607,7 +599,7 @@ def restore( """ Restores a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A snapshot name @@ -692,7 +684,7 @@ def status( """ Returns information about the status of a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -741,7 +733,7 @@ def verify_repository( """ Verifies a repository. - ``_ + ``_ :param name: A repository name :param master_timeout: Explicit operation timeout for connection to master node diff --git a/elasticsearch/_sync/client/sql.py b/elasticsearch/_sync/client/sql.py index c64075849..6df2c49bf 100644 --- a/elasticsearch/_sync/client/sql.py +++ b/elasticsearch/_sync/client/sql.py @@ -24,6 +24,7 @@ class SqlClient(NamespacedClient): + @_rewrite_parameters( body_fields=("cursor",), ) @@ -40,7 +41,7 @@ def clear_cursor( """ Clears the SQL cursor - ``_ + ``_ :param cursor: Cursor to clear. """ @@ -79,7 +80,7 @@ def delete_async( Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - ``_ + ``_ :param id: Identifier for the search. """ @@ -120,7 +121,7 @@ def get_async( Returns the current status and available results for an async SQL search or stored synchronous SQL search - ``_ + ``_ :param id: Identifier for the search. :param delimiter: Separator for CSV results. The API only supports this parameter @@ -172,7 +173,7 @@ def get_async_status( Returns the current status of an async SQL search or a stored synchronous SQL search - ``_ + ``_ :param id: Identifier for the search. """ @@ -247,7 +248,7 @@ def query( """ Executes a SQL request - ``_ + ``_ :param catalog: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. @@ -350,7 +351,7 @@ def translate( """ Translates SQL into Elasticsearch queries - ``_ + ``_ :param query: SQL query to run. :param fetch_size: The maximum number of rows (or entries) to return in one response. diff --git a/elasticsearch/_sync/client/ssl.py b/elasticsearch/_sync/client/ssl.py index aebdcf92e..91a0f4458 100644 --- a/elasticsearch/_sync/client/ssl.py +++ b/elasticsearch/_sync/client/ssl.py @@ -24,6 +24,7 @@ class SslClient(NamespacedClient): + @_rewrite_parameters() def certificates( self, @@ -37,7 +38,7 @@ def certificates( Retrieves information about the X.509 certificates used to encrypt communications in the cluster. - ``_ + ``_ """ __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/synonyms.py b/elasticsearch/_sync/client/synonyms.py index 02b98ace3..7f0c8fc3a 100644 --- a/elasticsearch/_sync/client/synonyms.py +++ b/elasticsearch/_sync/client/synonyms.py @@ -24,6 +24,7 @@ class SynonymsClient(NamespacedClient): + @_rewrite_parameters() def delete_synonym( self, @@ -37,7 +38,7 @@ def delete_synonym( """ Deletes a synonym set - ``_ + ``_ :param id: The id of the synonyms set to be deleted """ @@ -72,7 +73,7 @@ def delete_synonym_rule( """ Deletes a synonym rule in a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to be updated :param rule_id: The id of the synonym rule to be deleted @@ -113,7 +114,7 @@ def get_synonym( """ Retrieves a synonym set - ``_ + ``_ :param id: "The id of the synonyms set to be retrieved :param from_: Starting offset for query rules to be retrieved @@ -154,7 +155,7 @@ def get_synonym_rule( """ Retrieves a synonym rule from a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to retrieve the synonym rule from :param rule_id: The id of the synonym rule to retrieve @@ -194,7 +195,7 @@ def get_synonyms_sets( """ Retrieves a summary of all defined synonym sets - ``_ + ``_ :param from_: Starting offset :param size: specifies a max number of results to get @@ -235,7 +236,7 @@ def put_synonym( """ Creates or updates a synonyms set - ``_ + ``_ :param id: The id of the synonyms set to be created or updated :param synonyms_set: The synonym set information to update @@ -271,7 +272,7 @@ def put_synonym_rule( *, set_id: str, rule_id: str, - synonyms: t.Optional[t.Sequence[str]] = None, + synonyms: t.Optional[str] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, @@ -281,7 +282,7 @@ def put_synonym_rule( """ Creates or updates a synonym rule in a synonym set - ``_ + ``_ :param set_id: The id of the synonym set to be updated with the synonym rule :param rule_id: The id of the synonym rule to be updated or created diff --git a/elasticsearch/_sync/client/tasks.py b/elasticsearch/_sync/client/tasks.py index 00fbfa71c..4e83e2228 100644 --- a/elasticsearch/_sync/client/tasks.py +++ b/elasticsearch/_sync/client/tasks.py @@ -24,6 +24,7 @@ class TasksClient(NamespacedClient): + @_rewrite_parameters() def cancel( self, @@ -41,7 +42,7 @@ def cancel( """ Cancels a task, if it can be cancelled through an API. - ``_ + ``_ :param task_id: ID of the task. :param actions: Comma-separated list or wildcard expression of actions used to @@ -92,7 +93,7 @@ def get( """ Returns information about a task. - ``_ + ``_ :param task_id: ID of the task. :param timeout: Period to wait for a response. If no response is received before @@ -145,7 +146,7 @@ def list( """ Returns a list of tasks. - ``_ + ``_ :param actions: Comma-separated list or wildcard expression of actions used to limit the request. diff --git a/elasticsearch/_sync/client/text_structure.py b/elasticsearch/_sync/client/text_structure.py index dcf394982..9f9019c8f 100644 --- a/elasticsearch/_sync/client/text_structure.py +++ b/elasticsearch/_sync/client/text_structure.py @@ -24,6 +24,7 @@ class TextStructureClient(NamespacedClient): + @_rewrite_parameters( body_name="text_files", ) @@ -35,6 +36,7 @@ def find_structure( charset: t.Optional[str] = None, column_names: t.Optional[str] = None, delimiter: t.Optional[str] = None, + ecs_compatibility: t.Optional[str] = None, explain: t.Optional[bool] = None, format: t.Optional[str] = None, grok_pattern: t.Optional[str] = None, @@ -51,7 +53,7 @@ def find_structure( Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. - ``_ + ``_ :param text_files: :param charset: The text’s character set. It must be a character set that is @@ -70,6 +72,8 @@ def find_structure( default scenario, all rows must have the same number of fields for the delimited format to be detected. If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns + (disabled or v1, default: disabled). :param explain: If this parameter is set to true, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result. @@ -131,6 +135,8 @@ def find_structure( __query["column_names"] = column_names if delimiter is not None: __query["delimiter"] = delimiter + if ecs_compatibility is not None: + __query["ecs_compatibility"] = ecs_compatibility if explain is not None: __query["explain"] = explain if format is not None: @@ -161,3 +167,55 @@ def find_structure( return self.perform_request( # type: ignore[return-value] "POST", __path, params=__query, headers=__headers, body=__body ) + + @_rewrite_parameters( + body_fields=("grok_pattern", "text"), + ) + def test_grok_pattern( + self, + *, + grok_pattern: t.Optional[str] = None, + text: t.Optional[t.Sequence[str]] = None, + ecs_compatibility: t.Optional[str] = None, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + body: t.Optional[t.Dict[str, t.Any]] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Tests a Grok pattern on some text. + + ``_ + + :param grok_pattern: Grok pattern to run on the text. + :param text: Lines of text to run the Grok pattern on. + :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns + (disabled or v1, default: disabled). + """ + if grok_pattern is None and body is None: + raise ValueError("Empty value passed for parameter 'grok_pattern'") + if text is None and body is None: + raise ValueError("Empty value passed for parameter 'text'") + __path = "/_text_structure/test_grok_pattern" + __query: t.Dict[str, t.Any] = {} + __body: t.Dict[str, t.Any] = body if body is not None else {} + if ecs_compatibility is not None: + __query["ecs_compatibility"] = ecs_compatibility + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if not __body: + if grok_pattern is not None: + __body["grok_pattern"] = grok_pattern + if text is not None: + __body["text"] = text + __headers = {"accept": "application/json", "content-type": "application/json"} + return self.perform_request( # type: ignore[return-value] + "POST", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_sync/client/transform.py b/elasticsearch/_sync/client/transform.py index 2a06c839d..75bf8e2e3 100644 --- a/elasticsearch/_sync/client/transform.py +++ b/elasticsearch/_sync/client/transform.py @@ -24,6 +24,7 @@ class TransformClient(NamespacedClient): + @_rewrite_parameters() def delete_transform( self, @@ -40,7 +41,7 @@ def delete_transform( """ Deletes an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param delete_dest_index: If this value is true, the destination index is deleted @@ -94,7 +95,7 @@ def get_transform( """ Retrieves configuration information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -155,7 +156,7 @@ def get_transform_stats( """ Retrieves usage information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -230,7 +231,7 @@ def preview_transform( """ Previews a transform. - ``_ + ``_ :param transform_id: Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in @@ -338,7 +339,7 @@ def put_transform( """ Instantiates a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -431,7 +432,7 @@ def reset_transform( """ Resets an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -473,7 +474,7 @@ def schedule_now_transform( """ Schedules now a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param timeout: Controls the time to wait for the scheduling to take place @@ -514,7 +515,7 @@ def start_transform( """ Starts one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. :param from_: Restricts the set of transformed entities to those changed after @@ -562,7 +563,7 @@ def stop_transform( """ Stops one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, @@ -649,7 +650,7 @@ def update_transform( """ Updates certain properties of a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param defer_validation: When true, deferrable validations are not run. This @@ -723,7 +724,7 @@ def upgrade_transforms( """ Upgrades all transforms. - ``_ + ``_ :param dry_run: When true, the request checks for updates but does not run them. :param timeout: Period to wait for a response. If no response is received before diff --git a/elasticsearch/_sync/client/watcher.py b/elasticsearch/_sync/client/watcher.py index d4459fb98..346128b18 100644 --- a/elasticsearch/_sync/client/watcher.py +++ b/elasticsearch/_sync/client/watcher.py @@ -24,6 +24,7 @@ class WatcherClient(NamespacedClient): + @_rewrite_parameters() def ack_watch( self, @@ -38,7 +39,7 @@ def ack_watch( """ Acknowledges a watch, manually throttling the execution of the watch's actions. - ``_ + ``_ :param watch_id: Watch ID :param action_id: A comma-separated list of the action ids to be acked @@ -78,7 +79,7 @@ def activate_watch( """ Activates a currently inactive watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -112,7 +113,7 @@ def deactivate_watch( """ Deactivates a currently active watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -146,7 +147,7 @@ def delete_watch( """ Removes a watch from Watcher. - ``_ + ``_ :param id: Watch ID """ @@ -207,7 +208,7 @@ def execute_watch( """ Forces the execution of a stored watch. - ``_ + ``_ :param id: Identifier for the watch. :param action_modes: Determines how to handle the watch actions as part of the @@ -281,7 +282,7 @@ def get_watch( """ Retrieves a watch by its ID. - ``_ + ``_ :param id: Watch ID """ @@ -337,7 +338,7 @@ def put_watch( """ Creates a new watch, or updates an existing one. - ``_ + ``_ :param id: Watch ID :param actions: @@ -427,7 +428,7 @@ def query_watches( """ Retrieves stored watches. - ``_ + ``_ :param from_: The offset from the first result to fetch. Needs to be non-negative. :param query: Optional, query filter watches to be returned. @@ -490,7 +491,7 @@ def start( """ Starts Watcher if it is not already running. - ``_ + ``_ """ __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} @@ -534,7 +535,7 @@ def stats( """ Retrieves the current Watcher metrics. - ``_ + ``_ :param metric: Defines which additional metrics are included in the response. :param emit_stacktraces: Defines whether stack traces are generated for each @@ -572,7 +573,7 @@ def stop( """ Stops Watcher if it is running. - ``_ + ``_ """ __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/xpack.py b/elasticsearch/_sync/client/xpack.py index 146456bbe..35e2e0e21 100644 --- a/elasticsearch/_sync/client/xpack.py +++ b/elasticsearch/_sync/client/xpack.py @@ -43,7 +43,7 @@ def info( """ Retrieves information about the installed X-Pack features. - ``_ + ``_ :param accept_enterprise: If this param is used it must be set to true :param categories: A comma-separated list of the information categories to include @@ -83,7 +83,7 @@ def usage( """ Retrieves usage information about the installed X-Pack features. - ``_ + ``_ :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and