Skip to content

Commit fd191ba

Browse files
committed
Update APIs to 8.0.0-SNAPSHOT
1 parent 079c268 commit fd191ba

File tree

6 files changed

+478
-0
lines changed

6 files changed

+478
-0
lines changed

elasticsearch/_async/client/indices.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,104 @@ async def exists_template(
12321232
"HEAD", __path, params=__query, headers=__headers
12331233
)
12341234

1235+
@_rewrite_parameters()
1236+
async def field_usage_stats(
1237+
self,
1238+
*,
1239+
index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None,
1240+
allow_no_indices: t.Optional[bool] = None,
1241+
error_trace: t.Optional[bool] = None,
1242+
expand_wildcards: t.Optional[
1243+
t.Union[
1244+
t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
1245+
t.Union[
1246+
t.List[
1247+
t.Union[
1248+
"t.Literal['all', 'closed', 'hidden', 'none', 'open']", str
1249+
]
1250+
],
1251+
t.Tuple[
1252+
t.Union[
1253+
"t.Literal['all', 'closed', 'hidden', 'none', 'open']", str
1254+
],
1255+
...,
1256+
],
1257+
],
1258+
]
1259+
] = None,
1260+
fields: t.Optional[
1261+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
1262+
] = None,
1263+
filter_path: t.Optional[
1264+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
1265+
] = None,
1266+
human: t.Optional[bool] = None,
1267+
ignore_unavailable: t.Optional[bool] = None,
1268+
master_timeout: t.Optional[t.Union[int, str]] = None,
1269+
pretty: t.Optional[bool] = None,
1270+
timeout: t.Optional[t.Union[int, str]] = None,
1271+
wait_for_active_shards: t.Optional[
1272+
t.Union[int, t.Union["t.Literal['all']", str]]
1273+
] = None,
1274+
) -> ObjectApiResponse[t.Any]:
1275+
"""
1276+
Returns the field usage stats for each field of an index
1277+
1278+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html>`_
1279+
1280+
:param index: Comma-separated list or wildcard expression of index names used
1281+
to limit the request.
1282+
:param allow_no_indices: If false, the request returns an error if any wildcard
1283+
expression, index alias, or _all value targets only missing or closed indices.
1284+
This behavior applies even if the request targets other open indices. For
1285+
example, a request targeting `foo*,bar*` returns an error if an index starts
1286+
with `foo` but no index starts with `bar`.
1287+
:param expand_wildcards: Type of index that wildcard patterns can match. If the
1288+
request can target data streams, this argument determines whether wildcard
1289+
expressions match hidden data streams. Supports comma-separated values, such
1290+
as `open,hidden`.
1291+
:param fields: Comma-separated list or wildcard expressions of fields to include
1292+
in the statistics.
1293+
:param ignore_unavailable: If true, missing or closed indices are not included
1294+
in the response.
1295+
:param master_timeout: Period to wait for a connection to the master node. If
1296+
no response is received before the timeout expires, the request fails and
1297+
returns an error.
1298+
:param timeout: Period to wait for a response. If no response is received before
1299+
the timeout expires, the request fails and returns an error.
1300+
:param wait_for_active_shards: The number of shard copies that must be active
1301+
before proceeding with the operation. Set to all or any positive integer
1302+
up to the total number of shards in the index (`number_of_replicas+1`).
1303+
"""
1304+
__path = f"/{_quote(index)}/_field_usage_stats"
1305+
__query: t.Dict[str, t.Any] = {}
1306+
if allow_no_indices is not None:
1307+
__query["allow_no_indices"] = allow_no_indices
1308+
if error_trace is not None:
1309+
__query["error_trace"] = error_trace
1310+
if expand_wildcards is not None:
1311+
__query["expand_wildcards"] = expand_wildcards
1312+
if fields is not None:
1313+
__query["fields"] = fields
1314+
if filter_path is not None:
1315+
__query["filter_path"] = filter_path
1316+
if human is not None:
1317+
__query["human"] = human
1318+
if ignore_unavailable is not None:
1319+
__query["ignore_unavailable"] = ignore_unavailable
1320+
if master_timeout is not None:
1321+
__query["master_timeout"] = master_timeout
1322+
if pretty is not None:
1323+
__query["pretty"] = pretty
1324+
if timeout is not None:
1325+
__query["timeout"] = timeout
1326+
if wait_for_active_shards is not None:
1327+
__query["wait_for_active_shards"] = wait_for_active_shards
1328+
__headers = {"accept": "application/json"}
1329+
return await self.perform_request( # type: ignore[return-value]
1330+
"GET", __path, params=__query, headers=__headers
1331+
)
1332+
12351333
@_rewrite_parameters()
12361334
async def flush(
12371335
self,

elasticsearch/_async/client/migration.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,65 @@ async def deprecations(
6363
return await self.perform_request( # type: ignore[return-value]
6464
"GET", __path, params=__query, headers=__headers
6565
)
66+
67+
@_rewrite_parameters()
68+
async def get_feature_upgrade_status(
69+
self,
70+
*,
71+
error_trace: t.Optional[bool] = None,
72+
filter_path: t.Optional[
73+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
74+
] = None,
75+
human: t.Optional[bool] = None,
76+
pretty: t.Optional[bool] = None,
77+
) -> ObjectApiResponse[t.Any]:
78+
"""
79+
Find out whether system features need to be upgraded or not
80+
81+
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html>`_
82+
"""
83+
__path = "/_migration/system_features"
84+
__query: t.Dict[str, t.Any] = {}
85+
if error_trace is not None:
86+
__query["error_trace"] = error_trace
87+
if filter_path is not None:
88+
__query["filter_path"] = filter_path
89+
if human is not None:
90+
__query["human"] = human
91+
if pretty is not None:
92+
__query["pretty"] = pretty
93+
__headers = {"accept": "application/json"}
94+
return await self.perform_request( # type: ignore[return-value]
95+
"GET", __path, params=__query, headers=__headers
96+
)
97+
98+
@_rewrite_parameters()
99+
async def post_feature_upgrade(
100+
self,
101+
*,
102+
error_trace: t.Optional[bool] = None,
103+
filter_path: t.Optional[
104+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
105+
] = None,
106+
human: t.Optional[bool] = None,
107+
pretty: t.Optional[bool] = None,
108+
) -> ObjectApiResponse[t.Any]:
109+
"""
110+
Begin upgrades for system features
111+
112+
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html>`_
113+
"""
114+
__path = "/_migration/system_features"
115+
__query: t.Dict[str, t.Any] = {}
116+
if error_trace is not None:
117+
__query["error_trace"] = error_trace
118+
if filter_path is not None:
119+
__query["filter_path"] = filter_path
120+
if human is not None:
121+
__query["human"] = human
122+
if pretty is not None:
123+
__query["pretty"] = pretty
124+
__headers = {"accept": "application/json"}
125+
return await self.perform_request( # type: ignore[return-value]
126+
"POST", __path, params=__query, headers=__headers
127+
)

elasticsearch/_async/client/nodes.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,85 @@
2424

2525

2626
class NodesClient(NamespacedClient):
27+
@_rewrite_parameters()
28+
async def clear_repositories_metering_archive(
29+
self,
30+
*,
31+
node_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]],
32+
max_archive_version: int,
33+
error_trace: t.Optional[bool] = None,
34+
filter_path: t.Optional[
35+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
36+
] = None,
37+
human: t.Optional[bool] = None,
38+
pretty: t.Optional[bool] = None,
39+
) -> ObjectApiResponse[t.Any]:
40+
"""
41+
Removes the archived repositories metering information present in the cluster.
42+
43+
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html>`_
44+
45+
:param node_id: Comma-separated list of node IDs or names used to limit returned
46+
information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
47+
:param max_archive_version: Specifies the maximum [archive_version](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html#get-repositories-metering-api-response-body)
48+
to be cleared from the archive.
49+
"""
50+
if node_id in SKIP_IN_PATH:
51+
raise ValueError("Empty value passed for parameter 'node_id'")
52+
if max_archive_version in SKIP_IN_PATH:
53+
raise ValueError("Empty value passed for parameter 'max_archive_version'")
54+
__path = f"/_nodes/{_quote(node_id)}/_repositories_metering/{_quote(max_archive_version)}"
55+
__query: t.Dict[str, t.Any] = {}
56+
if error_trace is not None:
57+
__query["error_trace"] = error_trace
58+
if filter_path is not None:
59+
__query["filter_path"] = filter_path
60+
if human is not None:
61+
__query["human"] = human
62+
if pretty is not None:
63+
__query["pretty"] = pretty
64+
__headers = {"accept": "application/json"}
65+
return await self.perform_request( # type: ignore[return-value]
66+
"DELETE", __path, params=__query, headers=__headers
67+
)
68+
69+
@_rewrite_parameters()
70+
async def get_repositories_metering_info(
71+
self,
72+
*,
73+
node_id: t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]],
74+
error_trace: t.Optional[bool] = None,
75+
filter_path: t.Optional[
76+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
77+
] = None,
78+
human: t.Optional[bool] = None,
79+
pretty: t.Optional[bool] = None,
80+
) -> ObjectApiResponse[t.Any]:
81+
"""
82+
Returns cluster repositories metering information.
83+
84+
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html>`_
85+
86+
:param node_id: Comma-separated list of node IDs or names used to limit returned
87+
information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
88+
"""
89+
if node_id in SKIP_IN_PATH:
90+
raise ValueError("Empty value passed for parameter 'node_id'")
91+
__path = f"/_nodes/{_quote(node_id)}/_repositories_metering"
92+
__query: t.Dict[str, t.Any] = {}
93+
if error_trace is not None:
94+
__query["error_trace"] = error_trace
95+
if filter_path is not None:
96+
__query["filter_path"] = filter_path
97+
if human is not None:
98+
__query["human"] = human
99+
if pretty is not None:
100+
__query["pretty"] = pretty
101+
__headers = {"accept": "application/json"}
102+
return await self.perform_request( # type: ignore[return-value]
103+
"GET", __path, params=__query, headers=__headers
104+
)
105+
27106
@_rewrite_parameters()
28107
async def hot_threads(
29108
self,

elasticsearch/_sync/client/indices.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,104 @@ def exists_template(
12321232
"HEAD", __path, params=__query, headers=__headers
12331233
)
12341234

1235+
@_rewrite_parameters()
1236+
def field_usage_stats(
1237+
self,
1238+
*,
1239+
index: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None,
1240+
allow_no_indices: t.Optional[bool] = None,
1241+
error_trace: t.Optional[bool] = None,
1242+
expand_wildcards: t.Optional[
1243+
t.Union[
1244+
t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
1245+
t.Union[
1246+
t.List[
1247+
t.Union[
1248+
"t.Literal['all', 'closed', 'hidden', 'none', 'open']", str
1249+
]
1250+
],
1251+
t.Tuple[
1252+
t.Union[
1253+
"t.Literal['all', 'closed', 'hidden', 'none', 'open']", str
1254+
],
1255+
...,
1256+
],
1257+
],
1258+
]
1259+
] = None,
1260+
fields: t.Optional[
1261+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
1262+
] = None,
1263+
filter_path: t.Optional[
1264+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
1265+
] = None,
1266+
human: t.Optional[bool] = None,
1267+
ignore_unavailable: t.Optional[bool] = None,
1268+
master_timeout: t.Optional[t.Union[int, str]] = None,
1269+
pretty: t.Optional[bool] = None,
1270+
timeout: t.Optional[t.Union[int, str]] = None,
1271+
wait_for_active_shards: t.Optional[
1272+
t.Union[int, t.Union["t.Literal['all']", str]]
1273+
] = None,
1274+
) -> ObjectApiResponse[t.Any]:
1275+
"""
1276+
Returns the field usage stats for each field of an index
1277+
1278+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html>`_
1279+
1280+
:param index: Comma-separated list or wildcard expression of index names used
1281+
to limit the request.
1282+
:param allow_no_indices: If false, the request returns an error if any wildcard
1283+
expression, index alias, or _all value targets only missing or closed indices.
1284+
This behavior applies even if the request targets other open indices. For
1285+
example, a request targeting `foo*,bar*` returns an error if an index starts
1286+
with `foo` but no index starts with `bar`.
1287+
:param expand_wildcards: Type of index that wildcard patterns can match. If the
1288+
request can target data streams, this argument determines whether wildcard
1289+
expressions match hidden data streams. Supports comma-separated values, such
1290+
as `open,hidden`.
1291+
:param fields: Comma-separated list or wildcard expressions of fields to include
1292+
in the statistics.
1293+
:param ignore_unavailable: If true, missing or closed indices are not included
1294+
in the response.
1295+
:param master_timeout: Period to wait for a connection to the master node. If
1296+
no response is received before the timeout expires, the request fails and
1297+
returns an error.
1298+
:param timeout: Period to wait for a response. If no response is received before
1299+
the timeout expires, the request fails and returns an error.
1300+
:param wait_for_active_shards: The number of shard copies that must be active
1301+
before proceeding with the operation. Set to all or any positive integer
1302+
up to the total number of shards in the index (`number_of_replicas+1`).
1303+
"""
1304+
__path = f"/{_quote(index)}/_field_usage_stats"
1305+
__query: t.Dict[str, t.Any] = {}
1306+
if allow_no_indices is not None:
1307+
__query["allow_no_indices"] = allow_no_indices
1308+
if error_trace is not None:
1309+
__query["error_trace"] = error_trace
1310+
if expand_wildcards is not None:
1311+
__query["expand_wildcards"] = expand_wildcards
1312+
if fields is not None:
1313+
__query["fields"] = fields
1314+
if filter_path is not None:
1315+
__query["filter_path"] = filter_path
1316+
if human is not None:
1317+
__query["human"] = human
1318+
if ignore_unavailable is not None:
1319+
__query["ignore_unavailable"] = ignore_unavailable
1320+
if master_timeout is not None:
1321+
__query["master_timeout"] = master_timeout
1322+
if pretty is not None:
1323+
__query["pretty"] = pretty
1324+
if timeout is not None:
1325+
__query["timeout"] = timeout
1326+
if wait_for_active_shards is not None:
1327+
__query["wait_for_active_shards"] = wait_for_active_shards
1328+
__headers = {"accept": "application/json"}
1329+
return self.perform_request( # type: ignore[return-value]
1330+
"GET", __path, params=__query, headers=__headers
1331+
)
1332+
12351333
@_rewrite_parameters()
12361334
def flush(
12371335
self,

0 commit comments

Comments
 (0)