Skip to content

Commit 1db37b7

Browse files
Auto-generated API code
1 parent fe84712 commit 1db37b7

File tree

6 files changed

+48
-10
lines changed

6 files changed

+48
-10
lines changed

elasticsearch/_async/client/inference.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ async def delete(
3636
str,
3737
]
3838
] = None,
39+
dry_run: t.Optional[bool] = None,
3940
error_trace: t.Optional[bool] = None,
4041
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
42+
force: t.Optional[bool] = None,
4143
human: t.Optional[bool] = None,
4244
pretty: t.Optional[bool] = None,
4345
) -> ObjectApiResponse[t.Any]:
@@ -48,6 +50,10 @@ async def delete(
4850
4951
:param inference_id: The inference Id
5052
:param task_type: The task type
53+
:param dry_run: When true, the endpoint is not deleted, and a list of ingest
54+
processors which reference this endpoint is returned
55+
:param force: When true, the inference endpoint is forcefully deleted even if
56+
it is still being used by ingest processors or semantic text fields
5157
"""
5258
if inference_id in SKIP_IN_PATH:
5359
raise ValueError("Empty value passed for parameter 'inference_id'")
@@ -64,10 +70,14 @@ async def delete(
6470
else:
6571
raise ValueError("Couldn't find a path for the given parameters")
6672
__query: t.Dict[str, t.Any] = {}
73+
if dry_run is not None:
74+
__query["dry_run"] = dry_run
6775
if error_trace is not None:
6876
__query["error_trace"] = error_trace
6977
if filter_path is not None:
7078
__query["filter_path"] = filter_path
79+
if force is not None:
80+
__query["force"] = force
7181
if human is not None:
7282
__query["human"] = human
7383
if pretty is not None:

elasticsearch/_async/client/ml.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ async def get_records(
23742374
async def get_trained_models(
23752375
self,
23762376
*,
2377-
model_id: t.Optional[str] = None,
2377+
model_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23782378
allow_no_match: t.Optional[bool] = None,
23792379
decompress_definition: t.Optional[bool] = None,
23802380
error_trace: t.Optional[bool] = None,
@@ -2390,14 +2390,16 @@ async def get_trained_models(
23902390
] = None,
23912391
pretty: t.Optional[bool] = None,
23922392
size: t.Optional[int] = None,
2393-
tags: t.Optional[str] = None,
2393+
tags: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23942394
) -> ObjectApiResponse[t.Any]:
23952395
"""
23962396
Retrieves configuration information for a trained inference model.
23972397
23982398
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models.html>`_
23992399
2400-
:param model_id: The unique identifier of the trained model.
2400+
:param model_id: The unique identifier of the trained model or a model alias.
2401+
You can get information for multiple trained models in a single API request
2402+
by using a comma-separated list of model IDs or a wildcard expression.
24012403
:param allow_no_match: Specifies what to do when the request: - Contains wildcard
24022404
expressions and there are no models that match. - Contains the _all string
24032405
or no identifiers and there are no matches. - Contains wildcard expressions
@@ -2991,7 +2993,7 @@ async def put_calendar_job(
29912993
self,
29922994
*,
29932995
calendar_id: str,
2994-
job_id: str,
2996+
job_id: t.Union[str, t.Sequence[str]],
29952997
error_trace: t.Optional[bool] = None,
29962998
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
29972999
human: t.Optional[bool] = None,
@@ -5088,7 +5090,11 @@ async def update_trained_model_deployment(
50885090
if not __body:
50895091
if number_of_allocations is not None:
50905092
__body["number_of_allocations"] = number_of_allocations
5091-
__headers = {"accept": "application/json", "content-type": "application/json"}
5093+
if not __body:
5094+
__body = None # type: ignore[assignment]
5095+
__headers = {"accept": "application/json"}
5096+
if __body is not None:
5097+
__headers["content-type"] = "application/json"
50925098
return await self.perform_request( # type: ignore[return-value]
50935099
"POST",
50945100
__path,

elasticsearch/_async/client/security.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,9 @@ async def put_role(
21222122
this operation visible to search, if `wait_for` then wait for a refresh to
21232123
make this operation visible to search, if `false` then do nothing with refreshes.
21242124
:param run_as: A list of users that the owners of this role can impersonate.
2125+
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
2126+
you can still specify an empty `run_as` field, but a non-empty list will
2127+
be rejected.
21252128
:param transient_metadata: Indicates roles that might be incompatible with the
21262129
current cluster license, specifically roles with document and field level
21272130
security. When the cluster license doesn’t allow certain features for a given

elasticsearch/_sync/client/inference.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ def delete(
3636
str,
3737
]
3838
] = None,
39+
dry_run: t.Optional[bool] = None,
3940
error_trace: t.Optional[bool] = None,
4041
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
42+
force: t.Optional[bool] = None,
4143
human: t.Optional[bool] = None,
4244
pretty: t.Optional[bool] = None,
4345
) -> ObjectApiResponse[t.Any]:
@@ -48,6 +50,10 @@ def delete(
4850
4951
:param inference_id: The inference Id
5052
:param task_type: The task type
53+
:param dry_run: When true, the endpoint is not deleted, and a list of ingest
54+
processors which reference this endpoint is returned
55+
:param force: When true, the inference endpoint is forcefully deleted even if
56+
it is still being used by ingest processors or semantic text fields
5157
"""
5258
if inference_id in SKIP_IN_PATH:
5359
raise ValueError("Empty value passed for parameter 'inference_id'")
@@ -64,10 +70,14 @@ def delete(
6470
else:
6571
raise ValueError("Couldn't find a path for the given parameters")
6672
__query: t.Dict[str, t.Any] = {}
73+
if dry_run is not None:
74+
__query["dry_run"] = dry_run
6775
if error_trace is not None:
6876
__query["error_trace"] = error_trace
6977
if filter_path is not None:
7078
__query["filter_path"] = filter_path
79+
if force is not None:
80+
__query["force"] = force
7181
if human is not None:
7282
__query["human"] = human
7383
if pretty is not None:

elasticsearch/_sync/client/ml.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ def get_records(
23742374
def get_trained_models(
23752375
self,
23762376
*,
2377-
model_id: t.Optional[str] = None,
2377+
model_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23782378
allow_no_match: t.Optional[bool] = None,
23792379
decompress_definition: t.Optional[bool] = None,
23802380
error_trace: t.Optional[bool] = None,
@@ -2390,14 +2390,16 @@ def get_trained_models(
23902390
] = None,
23912391
pretty: t.Optional[bool] = None,
23922392
size: t.Optional[int] = None,
2393-
tags: t.Optional[str] = None,
2393+
tags: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23942394
) -> ObjectApiResponse[t.Any]:
23952395
"""
23962396
Retrieves configuration information for a trained inference model.
23972397
23982398
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models.html>`_
23992399
2400-
:param model_id: The unique identifier of the trained model.
2400+
:param model_id: The unique identifier of the trained model or a model alias.
2401+
You can get information for multiple trained models in a single API request
2402+
by using a comma-separated list of model IDs or a wildcard expression.
24012403
:param allow_no_match: Specifies what to do when the request: - Contains wildcard
24022404
expressions and there are no models that match. - Contains the _all string
24032405
or no identifiers and there are no matches. - Contains wildcard expressions
@@ -2991,7 +2993,7 @@ def put_calendar_job(
29912993
self,
29922994
*,
29932995
calendar_id: str,
2994-
job_id: str,
2996+
job_id: t.Union[str, t.Sequence[str]],
29952997
error_trace: t.Optional[bool] = None,
29962998
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
29972999
human: t.Optional[bool] = None,
@@ -5088,7 +5090,11 @@ def update_trained_model_deployment(
50885090
if not __body:
50895091
if number_of_allocations is not None:
50905092
__body["number_of_allocations"] = number_of_allocations
5091-
__headers = {"accept": "application/json", "content-type": "application/json"}
5093+
if not __body:
5094+
__body = None # type: ignore[assignment]
5095+
__headers = {"accept": "application/json"}
5096+
if __body is not None:
5097+
__headers["content-type"] = "application/json"
50925098
return self.perform_request( # type: ignore[return-value]
50935099
"POST",
50945100
__path,

elasticsearch/_sync/client/security.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,9 @@ def put_role(
21222122
this operation visible to search, if `wait_for` then wait for a refresh to
21232123
make this operation visible to search, if `false` then do nothing with refreshes.
21242124
:param run_as: A list of users that the owners of this role can impersonate.
2125+
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
2126+
you can still specify an empty `run_as` field, but a non-empty list will
2127+
be rejected.
21252128
:param transient_metadata: Indicates roles that might be incompatible with the
21262129
current cluster license, specifically roles with document and field level
21272130
security. When the cluster license doesn’t allow certain features for a given

0 commit comments

Comments
 (0)