From e974d5f44eb4b0237b28c4718d430bd705eaa345 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 16 Feb 2024 06:05:59 +0000 Subject: [PATCH] Auto-generated API code --- elasticsearch/_async/client/__init__.py | 4 ++ elasticsearch/_async/client/async_search.py | 1 + elasticsearch/_async/client/autoscaling.py | 1 + elasticsearch/_async/client/cat.py | 1 + elasticsearch/_async/client/ccr.py | 1 + elasticsearch/_async/client/cluster.py | 1 + .../_async/client/dangling_indices.py | 1 + elasticsearch/_async/client/enrich.py | 1 + elasticsearch/_async/client/eql.py | 1 + elasticsearch/_async/client/esql.py | 1 + elasticsearch/_async/client/features.py | 1 + elasticsearch/_async/client/fleet.py | 1 + elasticsearch/_async/client/graph.py | 1 + elasticsearch/_async/client/ilm.py | 1 + elasticsearch/_async/client/indices.py | 1 + elasticsearch/_async/client/inference.py | 1 + elasticsearch/_async/client/ingest.py | 1 + elasticsearch/_async/client/license.py | 1 + elasticsearch/_async/client/logstash.py | 1 + elasticsearch/_async/client/migration.py | 1 + elasticsearch/_async/client/ml.py | 1 + elasticsearch/_async/client/monitoring.py | 1 + elasticsearch/_async/client/nodes.py | 1 + elasticsearch/_async/client/query_ruleset.py | 1 + elasticsearch/_async/client/rollup.py | 1 + .../_async/client/search_application.py | 1 + .../_async/client/searchable_snapshots.py | 1 + elasticsearch/_async/client/security.py | 1 + elasticsearch/_async/client/shutdown.py | 1 + elasticsearch/_async/client/slm.py | 1 + elasticsearch/_async/client/snapshot.py | 1 + elasticsearch/_async/client/sql.py | 1 + elasticsearch/_async/client/ssl.py | 1 + elasticsearch/_async/client/synonyms.py | 3 +- elasticsearch/_async/client/tasks.py | 1 + elasticsearch/_async/client/text_structure.py | 58 +++++++++++++++++++ elasticsearch/_async/client/transform.py | 1 + elasticsearch/_async/client/watcher.py | 1 + elasticsearch/_sync/client/__init__.py | 4 ++ elasticsearch/_sync/client/async_search.py | 1 + elasticsearch/_sync/client/autoscaling.py | 1 + elasticsearch/_sync/client/cat.py | 1 + elasticsearch/_sync/client/ccr.py | 1 + elasticsearch/_sync/client/cluster.py | 1 + .../_sync/client/dangling_indices.py | 1 + elasticsearch/_sync/client/enrich.py | 1 + elasticsearch/_sync/client/eql.py | 1 + elasticsearch/_sync/client/esql.py | 1 + elasticsearch/_sync/client/features.py | 1 + elasticsearch/_sync/client/fleet.py | 1 + elasticsearch/_sync/client/graph.py | 1 + elasticsearch/_sync/client/ilm.py | 1 + elasticsearch/_sync/client/indices.py | 1 + elasticsearch/_sync/client/inference.py | 1 + elasticsearch/_sync/client/ingest.py | 1 + elasticsearch/_sync/client/license.py | 1 + elasticsearch/_sync/client/logstash.py | 1 + elasticsearch/_sync/client/migration.py | 1 + elasticsearch/_sync/client/ml.py | 1 + elasticsearch/_sync/client/monitoring.py | 1 + elasticsearch/_sync/client/nodes.py | 1 + elasticsearch/_sync/client/query_ruleset.py | 1 + elasticsearch/_sync/client/rollup.py | 1 + .../_sync/client/search_application.py | 1 + .../_sync/client/searchable_snapshots.py | 1 + elasticsearch/_sync/client/security.py | 1 + elasticsearch/_sync/client/shutdown.py | 1 + elasticsearch/_sync/client/slm.py | 1 + elasticsearch/_sync/client/snapshot.py | 1 + elasticsearch/_sync/client/sql.py | 1 + elasticsearch/_sync/client/ssl.py | 1 + elasticsearch/_sync/client/synonyms.py | 3 +- elasticsearch/_sync/client/tasks.py | 1 + elasticsearch/_sync/client/text_structure.py | 58 +++++++++++++++++++ elasticsearch/_sync/client/transform.py | 1 + elasticsearch/_sync/client/watcher.py | 1 + 76 files changed, 198 insertions(+), 2 deletions(-) diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 0324d4fbe..2a31d9c1a 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -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, @@ -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: diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py index ce6da8a18..5a9bd08d8 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, diff --git a/elasticsearch/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py index 4a569d190..c78b0e655 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, diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index 7c72d0984..0cd82506c 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, diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py index 33e121a4c..6c27cbf83 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, diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index bdf76c27e..a40fc1880 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"), ) diff --git a/elasticsearch/_async/client/dangling_indices.py b/elasticsearch/_async/client/dangling_indices.py index c3ae86410..ef8ea0651 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, diff --git a/elasticsearch/_async/client/enrich.py b/elasticsearch/_async/client/enrich.py index 65fbc6885..78bebc285 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, diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py index da3580f92..4c5af560d 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, diff --git a/elasticsearch/_async/client/esql.py b/elasticsearch/_async/client/esql.py index 9fe070f75..2a808f4e3 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"}, diff --git a/elasticsearch/_async/client/features.py b/elasticsearch/_async/client/features.py index 6c374e17c..b2aad1ef9 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, diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py index 889b8b328..0ee0551aa 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, diff --git a/elasticsearch/_async/client/graph.py b/elasticsearch/_async/client/graph.py index fce864005..944c140b1 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"), ) diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py index 5bd6833fc..0c4c462e7 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, diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 69fa9ab04..63bdfcb90 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, diff --git a/elasticsearch/_async/client/inference.py b/elasticsearch/_async/client/inference.py index 9269f7a42..5c46e1111 100644 --- a/elasticsearch/_async/client/inference.py +++ b/elasticsearch/_async/client/inference.py @@ -24,6 +24,7 @@ class InferenceClient(NamespacedClient): + @_rewrite_parameters() async def delete_model( self, diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index 7e9293477..4d18cb9e7 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, diff --git a/elasticsearch/_async/client/license.py b/elasticsearch/_async/client/license.py index 889b58b4e..9f24d7b69 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, diff --git a/elasticsearch/_async/client/logstash.py b/elasticsearch/_async/client/logstash.py index d629fbeed..6327471b9 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, diff --git a/elasticsearch/_async/client/migration.py b/elasticsearch/_async/client/migration.py index efea85d47..85afa07fb 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, diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 5b937222d..3263bf49f 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, diff --git a/elasticsearch/_async/client/monitoring.py b/elasticsearch/_async/client/monitoring.py index 34b4126c9..5ceb51e0b 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", ) diff --git a/elasticsearch/_async/client/nodes.py b/elasticsearch/_async/client/nodes.py index de75d83ec..f4090843f 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, diff --git a/elasticsearch/_async/client/query_ruleset.py b/elasticsearch/_async/client/query_ruleset.py index 687a0146e..3bc0e686c 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, diff --git a/elasticsearch/_async/client/rollup.py b/elasticsearch/_async/client/rollup.py index 00d824dc9..2dc3253a4 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, diff --git a/elasticsearch/_async/client/search_application.py b/elasticsearch/_async/client/search_application.py index 42970c607..747d0b6ee 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, diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py index 68d25d310..de8debc44 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, diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index 6de8fa8ef..738534909 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"), ) 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..75ee083b3 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, diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 3fb568545..761106a88 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, diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py index 9b05a6b88..5bc14483e 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",), ) diff --git a/elasticsearch/_async/client/ssl.py b/elasticsearch/_async/client/ssl.py index ceaf8b692..6c3b999ac 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, diff --git a/elasticsearch/_async/client/synonyms.py b/elasticsearch/_async/client/synonyms.py index aa9c35715..9f89b9913 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, @@ -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, diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index 24a647875..7fc44b60c 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, diff --git a/elasticsearch/_async/client/text_structure.py b/elasticsearch/_async/client/text_structure.py index 2995f5df9..d45be4b6c 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, @@ -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..61096f558 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, diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py index e2615f704..1b054155e 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, diff --git a/elasticsearch/_sync/client/__init__.py b/elasticsearch/_sync/client/__init__.py index 7d595dacf..51812f0d9 100644 --- a/elasticsearch/_sync/client/__init__.py +++ b/elasticsearch/_sync/client/__init__.py @@ -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, @@ -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: diff --git a/elasticsearch/_sync/client/async_search.py b/elasticsearch/_sync/client/async_search.py index 8df1abdab..12071f787 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, diff --git a/elasticsearch/_sync/client/autoscaling.py b/elasticsearch/_sync/client/autoscaling.py index 36edb3c10..48e35fc85 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, diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index 5c5f278c8..610efa85c 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, diff --git a/elasticsearch/_sync/client/ccr.py b/elasticsearch/_sync/client/ccr.py index 8cd218d44..e494b9e4f 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, diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index cb68d9efe..113426941 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"), ) diff --git a/elasticsearch/_sync/client/dangling_indices.py b/elasticsearch/_sync/client/dangling_indices.py index 96bb95f53..7f4edaed0 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, diff --git a/elasticsearch/_sync/client/enrich.py b/elasticsearch/_sync/client/enrich.py index d4ba21113..2d543c843 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, diff --git a/elasticsearch/_sync/client/eql.py b/elasticsearch/_sync/client/eql.py index 34bbf3cf8..2229d1533 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, diff --git a/elasticsearch/_sync/client/esql.py b/elasticsearch/_sync/client/esql.py index 250b0492a..fd65908ab 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"}, diff --git a/elasticsearch/_sync/client/features.py b/elasticsearch/_sync/client/features.py index c22398ae7..ba2ecbbf4 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, diff --git a/elasticsearch/_sync/client/fleet.py b/elasticsearch/_sync/client/fleet.py index fe0573038..e1fa36bb6 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, diff --git a/elasticsearch/_sync/client/graph.py b/elasticsearch/_sync/client/graph.py index da8501605..d4801a6b4 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"), ) diff --git a/elasticsearch/_sync/client/ilm.py b/elasticsearch/_sync/client/ilm.py index d18a476de..7963af7a3 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, diff --git a/elasticsearch/_sync/client/indices.py b/elasticsearch/_sync/client/indices.py index 1ff902c1f..3b2885df9 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, diff --git a/elasticsearch/_sync/client/inference.py b/elasticsearch/_sync/client/inference.py index 8f1f6b619..2716b7d1a 100644 --- a/elasticsearch/_sync/client/inference.py +++ b/elasticsearch/_sync/client/inference.py @@ -24,6 +24,7 @@ class InferenceClient(NamespacedClient): + @_rewrite_parameters() def delete_model( self, diff --git a/elasticsearch/_sync/client/ingest.py b/elasticsearch/_sync/client/ingest.py index b986bd3b2..dbd135170 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, diff --git a/elasticsearch/_sync/client/license.py b/elasticsearch/_sync/client/license.py index e70cfb571..2caa03404 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, diff --git a/elasticsearch/_sync/client/logstash.py b/elasticsearch/_sync/client/logstash.py index 67ad8c35a..0aceada51 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, diff --git a/elasticsearch/_sync/client/migration.py b/elasticsearch/_sync/client/migration.py index db763246f..469f52f20 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, diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index fe9821b87..cfadcb19e 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, diff --git a/elasticsearch/_sync/client/monitoring.py b/elasticsearch/_sync/client/monitoring.py index 32c1a9fef..4226df390 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", ) diff --git a/elasticsearch/_sync/client/nodes.py b/elasticsearch/_sync/client/nodes.py index 74f6efd89..5afa5be3d 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, diff --git a/elasticsearch/_sync/client/query_ruleset.py b/elasticsearch/_sync/client/query_ruleset.py index db44f11b9..821a5bdde 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, diff --git a/elasticsearch/_sync/client/rollup.py b/elasticsearch/_sync/client/rollup.py index 6a4e377af..15673f3c7 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, diff --git a/elasticsearch/_sync/client/search_application.py b/elasticsearch/_sync/client/search_application.py index 623d29cdf..5b3d63a5b 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, diff --git a/elasticsearch/_sync/client/searchable_snapshots.py b/elasticsearch/_sync/client/searchable_snapshots.py index e3a8fc858..01b2d87bc 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, diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index abf825dfa..25c761910 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"), ) 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..260ae0877 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, diff --git a/elasticsearch/_sync/client/snapshot.py b/elasticsearch/_sync/client/snapshot.py index d3cec40c5..900cc2256 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, diff --git a/elasticsearch/_sync/client/sql.py b/elasticsearch/_sync/client/sql.py index c64075849..2da06f13f 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",), ) diff --git a/elasticsearch/_sync/client/ssl.py b/elasticsearch/_sync/client/ssl.py index aebdcf92e..810e02b7f 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, diff --git a/elasticsearch/_sync/client/synonyms.py b/elasticsearch/_sync/client/synonyms.py index 02b98ace3..f8abb94f9 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, @@ -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, diff --git a/elasticsearch/_sync/client/tasks.py b/elasticsearch/_sync/client/tasks.py index 00fbfa71c..48a892471 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, diff --git a/elasticsearch/_sync/client/text_structure.py b/elasticsearch/_sync/client/text_structure.py index dcf394982..e98eda679 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, @@ -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..83ab2dc27 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, diff --git a/elasticsearch/_sync/client/watcher.py b/elasticsearch/_sync/client/watcher.py index d4459fb98..e401df178 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,