Skip to content

Commit

Permalink
Auto-generated API code (#2444)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
Mpdreamz and elasticmachine committed Feb 16, 2024
1 parent 6a96e38 commit 7d4a34b
Show file tree
Hide file tree
Showing 76 changed files with 198 additions and 2 deletions.
4 changes: 4 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class AsyncSearchClient(NamespacedClient):

@_rewrite_parameters()
async def delete(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/autoscaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class AutoscalingClient(NamespacedClient):

@_rewrite_parameters()
async def delete_autoscaling_policy(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class CatClient(NamespacedClient):

@_rewrite_parameters()
async def aliases(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/ccr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class CcrClient(NamespacedClient):

@_rewrite_parameters()
async def delete_auto_follow_pattern(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class ClusterClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("current_node", "index", "primary", "shard"),
)
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/dangling_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class DanglingIndicesClient(NamespacedClient):

@_rewrite_parameters()
async def delete_dangling_index(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class EnrichClient(NamespacedClient):

@_rewrite_parameters()
async def delete_policy(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/eql.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class EqlClient(NamespacedClient):

@_rewrite_parameters()
async def delete(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class EsqlClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("query", "columnar", "filter", "locale", "params"),
ignore_deprecated_options={"params"},
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class FeaturesClient(NamespacedClient):

@_rewrite_parameters()
async def get_features(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/fleet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class FleetClient(NamespacedClient):

@_rewrite_parameters()
async def global_checkpoints(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class GraphClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("connections", "controls", "query", "vertices"),
)
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/ilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class IlmClient(NamespacedClient):

@_rewrite_parameters()
async def delete_lifecycle(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class IndicesClient(NamespacedClient):

@_rewrite_parameters()
async def add_block(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class InferenceClient(NamespacedClient):

@_rewrite_parameters()
async def delete_model(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class IngestClient(NamespacedClient):

@_rewrite_parameters()
async def delete_pipeline(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class LicenseClient(NamespacedClient):

@_rewrite_parameters()
async def delete(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class LogstashClient(NamespacedClient):

@_rewrite_parameters()
async def delete_pipeline(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class MigrationClient(NamespacedClient):

@_rewrite_parameters()
async def deprecations(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class MlClient(NamespacedClient):

@_rewrite_parameters()
async def clear_trained_model_deployment_cache(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class MonitoringClient(NamespacedClient):

@_rewrite_parameters(
body_name="operations",
)
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class NodesClient(NamespacedClient):

@_rewrite_parameters()
async def clear_repositories_metering_archive(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/query_ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class QueryRulesetClient(NamespacedClient):

@_rewrite_parameters()
async def delete(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/rollup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class RollupClient(NamespacedClient):

@_rewrite_parameters()
async def delete_job(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/search_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SearchApplicationClient(NamespacedClient):

@_rewrite_parameters()
async def delete(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/searchable_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SearchableSnapshotsClient(NamespacedClient):

@_rewrite_parameters()
async def cache_stats(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SecurityClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("grant_type", "access_token", "password", "username"),
)
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class ShutdownClient(NamespacedClient):

@_rewrite_parameters()
async def delete_node(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/slm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SlmClient(NamespacedClient):

@_rewrite_parameters()
async def delete_lifecycle(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SnapshotClient(NamespacedClient):

@_rewrite_parameters()
async def cleanup_repository(
self,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SqlClient(NamespacedClient):

@_rewrite_parameters(
body_fields=("cursor",),
)
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SslClient(NamespacedClient):

@_rewrite_parameters()
async def certificates(
self,
Expand Down
3 changes: 2 additions & 1 deletion elasticsearch/_async/client/synonyms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class SynonymsClient(NamespacedClient):

@_rewrite_parameters()
async def delete_synonym(
self,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class TasksClient(NamespacedClient):

@_rewrite_parameters()
async def cancel(
self,
Expand Down
58 changes: 58 additions & 0 deletions elasticsearch/_async/client/text_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class TextStructureClient(NamespacedClient):

@_rewrite_parameters(
body_name="text_files",
)
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern-api.html>`_
: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
)

0 comments on commit 7d4a34b

Please sign in to comment.