Skip to content

Commit 76f8f85

Browse files
committed
Update APIs for 7.12.1
1 parent 0c93aaf commit 76f8f85

File tree

8 files changed

+208
-14
lines changed

8 files changed

+208
-14
lines changed

Diff for: elasticsearch/_async/client/features.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class FeaturesClient(NamespacedClient):
2222
@query_params("master_timeout")
2323
async def get_features(self, params=None, headers=None):
2424
"""
25-
Returns a list of features which can be snapshotted in this cluster.
25+
Gets a list of features which can be included in snapshots using the
26+
feature_states field when creating a snapshot
2627
27-
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/modules-snapshots.html>`_
28+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/get-features-api.html>`_
2829
2930
:arg master_timeout: Explicit operation timeout for connection
3031
to master node

Diff for: elasticsearch/_async/client/ml.py

+73
Original file line numberDiff line numberDiff line change
@@ -1676,3 +1676,76 @@ async def upgrade_job_snapshot(
16761676
params=params,
16771677
headers=headers,
16781678
)
1679+
1680+
@query_params(
1681+
"charset",
1682+
"column_names",
1683+
"delimiter",
1684+
"explain",
1685+
"format",
1686+
"grok_pattern",
1687+
"has_header_row",
1688+
"line_merge_size_limit",
1689+
"lines_to_sample",
1690+
"quote",
1691+
"should_trim_fields",
1692+
"timeout",
1693+
"timestamp_field",
1694+
"timestamp_format",
1695+
)
1696+
async def find_file_structure(self, body, params=None, headers=None):
1697+
"""
1698+
Finds the structure of a text file. The text file must contain data that is
1699+
suitable to be ingested into Elasticsearch.
1700+
1701+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/find-structure.html>`_
1702+
1703+
.. warning::
1704+
1705+
This API is **experimental** so may include breaking changes
1706+
or be removed in a future version
1707+
1708+
:arg body: The contents of the file to be analyzed
1709+
:arg charset: Optional parameter to specify the character set of
1710+
the file
1711+
:arg column_names: Optional parameter containing a comma
1712+
separated list of the column names for a delimited file
1713+
:arg delimiter: Optional parameter to specify the delimiter
1714+
character for a delimited file - must be a single character
1715+
:arg explain: Whether to include a commentary on how the
1716+
structure was derived
1717+
:arg format: Optional parameter to specify the high level file
1718+
format Valid choices: ndjson, xml, delimited, semi_structured_text
1719+
:arg grok_pattern: Optional parameter to specify the Grok
1720+
pattern that should be used to extract fields from messages in a semi-
1721+
structured text file
1722+
:arg has_header_row: Optional parameter to specify whether a
1723+
delimited file includes the column names in its first row
1724+
:arg line_merge_size_limit: Maximum number of characters
1725+
permitted in a single message when lines are merged to create messages.
1726+
Default: 10000
1727+
:arg lines_to_sample: How many lines of the file should be
1728+
included in the analysis Default: 1000
1729+
:arg quote: Optional parameter to specify the quote character
1730+
for a delimited file - must be a single character
1731+
:arg should_trim_fields: Optional parameter to specify whether
1732+
the values between delimiters in a delimited file should have whitespace
1733+
trimmed from them
1734+
:arg timeout: Timeout after which the analysis will be aborted
1735+
Default: 25s
1736+
:arg timestamp_field: Optional parameter to specify the
1737+
timestamp field in the file
1738+
:arg timestamp_format: Optional parameter to specify the
1739+
timestamp format in the file - may be either a Joda or Java time format
1740+
"""
1741+
if body in SKIP_IN_PATH:
1742+
raise ValueError("Empty value passed for a required argument 'body'.")
1743+
1744+
body = _bulk_body(self.transport.serializer, body)
1745+
return await self.transport.perform_request(
1746+
"POST",
1747+
"/_ml/find_file_structure",
1748+
params=params,
1749+
headers=headers,
1750+
body=body,
1751+
)

Diff for: elasticsearch/_async/client/ml.pyi

+28
Original file line numberDiff line numberDiff line change
@@ -1085,3 +1085,31 @@ class MlClient(NamespacedClient):
10851085
params: Optional[MutableMapping[str, Any]] = ...,
10861086
headers: Optional[MutableMapping[str, str]] = ...
10871087
) -> Any: ...
1088+
async def find_file_structure(
1089+
self,
1090+
*,
1091+
body: Any,
1092+
charset: Optional[Any] = ...,
1093+
column_names: Optional[Any] = ...,
1094+
delimiter: Optional[Any] = ...,
1095+
explain: Optional[Any] = ...,
1096+
format: Optional[Any] = ...,
1097+
grok_pattern: Optional[Any] = ...,
1098+
has_header_row: Optional[Any] = ...,
1099+
line_merge_size_limit: Optional[Any] = ...,
1100+
lines_to_sample: Optional[Any] = ...,
1101+
quote: Optional[Any] = ...,
1102+
should_trim_fields: Optional[Any] = ...,
1103+
timeout: Optional[Any] = ...,
1104+
timestamp_field: Optional[Any] = ...,
1105+
timestamp_format: Optional[Any] = ...,
1106+
pretty: Optional[bool] = ...,
1107+
human: Optional[bool] = ...,
1108+
error_trace: Optional[bool] = ...,
1109+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1110+
request_timeout: Optional[Union[int, float]] = ...,
1111+
ignore: Optional[Union[int, Collection[int]]] = ...,
1112+
opaque_id: Optional[str] = ...,
1113+
params: Optional[MutableMapping[str, Any]] = ...,
1114+
headers: Optional[MutableMapping[str, str]] = ...
1115+
) -> Any: ...

Diff for: elasticsearch/_async/client/text_structure.py

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ async def find_structure(self, body, params=None, headers=None):
4242
4343
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/find-structure.html>`_
4444
45-
.. warning::
46-
47-
This API is **experimental** so may include breaking changes
48-
or be removed in a future version
49-
5045
:arg body: The contents of the file to be analyzed
5146
:arg charset: Optional parameter to specify the character set of
5247
the file

Diff for: elasticsearch/client/features.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class FeaturesClient(NamespacedClient):
2222
@query_params("master_timeout")
2323
def get_features(self, params=None, headers=None):
2424
"""
25-
Returns a list of features which can be snapshotted in this cluster.
25+
Gets a list of features which can be included in snapshots using the
26+
feature_states field when creating a snapshot
2627
27-
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/modules-snapshots.html>`_
28+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/get-features-api.html>`_
2829
2930
:arg master_timeout: Explicit operation timeout for connection
3031
to master node

Diff for: elasticsearch/client/ml.py

+73
Original file line numberDiff line numberDiff line change
@@ -1660,3 +1660,76 @@ def upgrade_job_snapshot(self, job_id, snapshot_id, params=None, headers=None):
16601660
params=params,
16611661
headers=headers,
16621662
)
1663+
1664+
@query_params(
1665+
"charset",
1666+
"column_names",
1667+
"delimiter",
1668+
"explain",
1669+
"format",
1670+
"grok_pattern",
1671+
"has_header_row",
1672+
"line_merge_size_limit",
1673+
"lines_to_sample",
1674+
"quote",
1675+
"should_trim_fields",
1676+
"timeout",
1677+
"timestamp_field",
1678+
"timestamp_format",
1679+
)
1680+
def find_file_structure(self, body, params=None, headers=None):
1681+
"""
1682+
Finds the structure of a text file. The text file must contain data that is
1683+
suitable to be ingested into Elasticsearch.
1684+
1685+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/find-structure.html>`_
1686+
1687+
.. warning::
1688+
1689+
This API is **experimental** so may include breaking changes
1690+
or be removed in a future version
1691+
1692+
:arg body: The contents of the file to be analyzed
1693+
:arg charset: Optional parameter to specify the character set of
1694+
the file
1695+
:arg column_names: Optional parameter containing a comma
1696+
separated list of the column names for a delimited file
1697+
:arg delimiter: Optional parameter to specify the delimiter
1698+
character for a delimited file - must be a single character
1699+
:arg explain: Whether to include a commentary on how the
1700+
structure was derived
1701+
:arg format: Optional parameter to specify the high level file
1702+
format Valid choices: ndjson, xml, delimited, semi_structured_text
1703+
:arg grok_pattern: Optional parameter to specify the Grok
1704+
pattern that should be used to extract fields from messages in a semi-
1705+
structured text file
1706+
:arg has_header_row: Optional parameter to specify whether a
1707+
delimited file includes the column names in its first row
1708+
:arg line_merge_size_limit: Maximum number of characters
1709+
permitted in a single message when lines are merged to create messages.
1710+
Default: 10000
1711+
:arg lines_to_sample: How many lines of the file should be
1712+
included in the analysis Default: 1000
1713+
:arg quote: Optional parameter to specify the quote character
1714+
for a delimited file - must be a single character
1715+
:arg should_trim_fields: Optional parameter to specify whether
1716+
the values between delimiters in a delimited file should have whitespace
1717+
trimmed from them
1718+
:arg timeout: Timeout after which the analysis will be aborted
1719+
Default: 25s
1720+
:arg timestamp_field: Optional parameter to specify the
1721+
timestamp field in the file
1722+
:arg timestamp_format: Optional parameter to specify the
1723+
timestamp format in the file - may be either a Joda or Java time format
1724+
"""
1725+
if body in SKIP_IN_PATH:
1726+
raise ValueError("Empty value passed for a required argument 'body'.")
1727+
1728+
body = _bulk_body(self.transport.serializer, body)
1729+
return self.transport.perform_request(
1730+
"POST",
1731+
"/_ml/find_file_structure",
1732+
params=params,
1733+
headers=headers,
1734+
body=body,
1735+
)

Diff for: elasticsearch/client/ml.pyi

+28
Original file line numberDiff line numberDiff line change
@@ -1085,3 +1085,31 @@ class MlClient(NamespacedClient):
10851085
params: Optional[MutableMapping[str, Any]] = ...,
10861086
headers: Optional[MutableMapping[str, str]] = ...
10871087
) -> Any: ...
1088+
def find_file_structure(
1089+
self,
1090+
*,
1091+
body: Any,
1092+
charset: Optional[Any] = ...,
1093+
column_names: Optional[Any] = ...,
1094+
delimiter: Optional[Any] = ...,
1095+
explain: Optional[Any] = ...,
1096+
format: Optional[Any] = ...,
1097+
grok_pattern: Optional[Any] = ...,
1098+
has_header_row: Optional[Any] = ...,
1099+
line_merge_size_limit: Optional[Any] = ...,
1100+
lines_to_sample: Optional[Any] = ...,
1101+
quote: Optional[Any] = ...,
1102+
should_trim_fields: Optional[Any] = ...,
1103+
timeout: Optional[Any] = ...,
1104+
timestamp_field: Optional[Any] = ...,
1105+
timestamp_format: Optional[Any] = ...,
1106+
pretty: Optional[bool] = ...,
1107+
human: Optional[bool] = ...,
1108+
error_trace: Optional[bool] = ...,
1109+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1110+
request_timeout: Optional[Union[int, float]] = ...,
1111+
ignore: Optional[Union[int, Collection[int]]] = ...,
1112+
opaque_id: Optional[str] = ...,
1113+
params: Optional[MutableMapping[str, Any]] = ...,
1114+
headers: Optional[MutableMapping[str, str]] = ...
1115+
) -> Any: ...

Diff for: elasticsearch/client/text_structure.py

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ def find_structure(self, body, params=None, headers=None):
4242
4343
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.12/find-structure.html>`_
4444
45-
.. warning::
46-
47-
This API is **experimental** so may include breaking changes
48-
or be removed in a future version
49-
5045
:arg body: The contents of the file to be analyzed
5146
:arg charset: Optional parameter to specify the character set of
5247
the file

0 commit comments

Comments
 (0)