Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Endpoints/Esql.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Esql extends AbstractEndpoint
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.. If body is a string must be a valid JSON.
* body: string|array<mixed>, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. Use the `settings` object to supply per-query settings (e.g. `time_zone`) — the request-body equivalent of in-query `SET`.. If body is a string must be a valid JSON.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
Expand Down Expand Up @@ -193,6 +193,7 @@ public function asyncQueryStop(?array $params = null)
* Delete one or more ES|QL data sources. Fails with 409 if any dataset references them.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-delete
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -233,6 +234,7 @@ public function deleteDataSource(?array $params = null)
* Delete one or more ES|QL datasets.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-delete
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -314,6 +316,7 @@ public function deleteView(?array $params = null)
* Get one or more ES|QL data sources. Secret setting values are returned masked.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-get
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -356,6 +359,7 @@ public function getDataSource(?array $params = null)
* Get one or more ES|QL datasets.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-get
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -520,6 +524,7 @@ public function listQueries(?array $params = null)
* Creates or replaces an ES|QL data source.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-put
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -561,6 +566,7 @@ public function putDataSource(?array $params = null)
* Creates or replaces an ES|QL dataset referencing a parent data source.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-put
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand All @@ -570,7 +576,7 @@ public function putDataSource(?array $params = null)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) Dataset definition: parent data_source name, resource path, optional description, and type-specific settings.. If body is a string must be a valid JSON.
* body: string|array<mixed>, // (REQUIRED) Dataset definition: parent data_source name, resource path, optional description, type-specific settings, and an optional mappings block (column types, path renames, format, _id).. If body is a string must be a valid JSON.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
Expand Down Expand Up @@ -656,7 +662,7 @@ public function putView(?array $params = null)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.. If body is a string must be a valid JSON.
* body: string|array<mixed>, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. Use the `settings` object to supply per-query settings (e.g. `time_zone`) — the request-body equivalent of in-query `SET`.. If body is a string must be a valid JSON.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ public function putAlias(?array $params = null)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) The data stream lifecycle configuration that consist of the data retention. If body is a string must be a valid JSON.
* body: string|array<mixed>, // (REQUIRED) The data stream lifecycle configuration, supporting fields: 'enabled', 'data_retention', 'downsampling', and 'frozen_after'. If body is a string must be a valid JSON.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
Expand Down
117 changes: 115 additions & 2 deletions src/Endpoints/Inference.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,42 @@ public function delete(?array $params = null)
}


/**
* Delete the inference region policy
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete-region-policy
* @group serverless
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function deleteRegionPolicy(?array $params = null)
{
$params = $params ?? [];
$url = '/_inference/_region_policy';
$method = 'DELETE';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'inference.delete_region_policy');
return $this->client->sendRequest($request);
}


/**
* Perform embedding inference on the service
*
Expand Down Expand Up @@ -246,6 +282,42 @@ public function get(?array $params = null)
}


/**
* Get the inference region policy
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get-region-policy
* @group serverless
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getRegionPolicy(?array $params = null)
{
$params = $params ?? [];
$url = '/_inference/_region_policy';
$method = 'GET';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'inference.get_region_policy');
return $this->client->sendRequest($request);
}


/**
* Perform inference on the service
*
Expand Down Expand Up @@ -302,7 +374,7 @@ public function inference(?array $params = null)
* @param array{
* inference_id: string, // (REQUIRED) The inference Id
* task_type?: string, // The task type
* timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. (DEFAULT: 30s)
* timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. The default depends on the task type: 120s for `completion` and `chat_completion`, and 30s for all other task types. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
Expand Down Expand Up @@ -1371,6 +1443,46 @@ public function putOpenshiftAi(?array $params = null)
}


/**
* Create or update the inference region policy
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-region-policy
* @group serverless
*
* @param array{
* force?: bool, // If `true`, the region policy is applied even if it would deny access to inference endpoints that are currently in use by ingest pipeline or indices.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) The region policy configuration. If body is a string must be a valid JSON.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function putRegionPolicy(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['body'], $params);
$url = '/_inference/_region_policy';
$method = 'PUT';

$url = $this->addQueryString($url, $params, ['force','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'inference.put_region_policy');
return $this->client->sendRequest($request);
}


/**
* Create a VoyageAI inference endpoint
*
Expand Down Expand Up @@ -1634,6 +1746,7 @@ public function textEmbedding(?array $params = null)
* @param array{
* inference_id: string, // (REQUIRED) The inference Id
* task_type?: string, // The task type
* timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be updated. The default depends on the task type: 120s for `completion` and `chat_completion`, and 30s for all other task types.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -1660,7 +1773,7 @@ public function update(?array $params = null)
$url = '/_inference/' . $this->encode($params['inference_id']) . '/_update';
$method = 'PUT';
}
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/Endpoints/Ingest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function deletePipeline(?array $params = null)
/**
* Get GeoIP statistics
*
* @link https://www.elastic.co/docs/reference/enrich-processor/geoip-processor
* @link https://www.elastic.co/docs/reference/ingest-processor/geoip-processor
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
Expand Down Expand Up @@ -310,7 +310,7 @@ public function getPipeline(?array $params = null)
/**
* Run a grok processor
*
* @link https://www.elastic.co/docs/reference/enrich-processor/grok-processor
* @link https://www.elastic.co/docs/reference/ingest-processor/grok-processor
* @group serverless
*
* @param array{
Expand Down
1 change: 1 addition & 0 deletions src/Endpoints/Ml.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ public function flushJob(?array $params = null)
* Predict future behavior of a time series
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-forecast
* @group serverless
*
* @param array{
* job_id: string, // (REQUIRED) The ID of the job to forecast for
Expand Down
9 changes: 5 additions & 4 deletions src/Endpoints/Synonyms.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ public function deleteSynonymRule(?array $params = null)
*
* @param array{
* id: string, // (REQUIRED) The name of the synonyms set to be retrieved
* from?: int, // The starting offset for query rules to retrieve.
* size?: int, // The max number of query rules to retrieve. (DEFAULT: 10)
* search_after?: string, // The rule ID of the last result from the previous page, for cursor-based pagination
* from?: int, // The starting offset for synonym rules to retrieve.
* size?: int, // The max number of synonym rules to retrieve. (DEFAULT: 10)
* search_after?: string, // The synonym rule ID to use as a cursor for pagination. The next page of results will start after this rule ID. This parameter cannot be used with `from`.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
Expand Down Expand Up @@ -239,6 +239,7 @@ public function getSynonymsSets(?array $params = null)
* @param array{
* id: string, // (REQUIRED) The id of the synonyms set to be created or updated
* refresh?: bool, // If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning. If `false`, analyzers will not be reloaded with the new synonym set (DEFAULT: 1)
* append?: bool, // If `true`, the provided synonym rules are appended to the existing set, with matching IDs overwriting existing rules. If `false`, the entire synonyms set is replaced with the new synonym rules definitions.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -261,7 +262,7 @@ public function putSynonym(?array $params = null)
$url = '/_synonyms/' . $this->encode($params['id']);
$method = 'PUT';

$url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['refresh','append','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
Expand Down
5 changes: 3 additions & 2 deletions src/Endpoints/Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ public function getTransform(?array $params = null)
*
* @param array{
* transform_id: string|array<string>, // (REQUIRED) Comma-separated list of transform identifiers or wildcard expressions. You can get information for all transforms by using `_all`, by specifying `*` as the `<transform_id>`, or by omitting the `<transform_id>`.
* allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1)
* basic?: bool, // If true, the response includes `id`, `state`, `node`, `stats`, `health`, and basic `checkpointing` information (the last and next checkpoint numbers, and the next checkpoint's `position` and `progress`). Skips statistics that require heavy computations to calculate: `operations_behind`, `changes_last_detected_at`, `last_search_time`, and the checkpoint timestamps.
* from?: int, // Skips the specified number of transforms.
* size?: int, // Specifies the maximum number of transforms to obtain. (DEFAULT: 100)
* timeout?: int|string, // Controls the time to wait for the stats (DEFAULT: 30s)
* allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -184,7 +185,7 @@ public function getTransformStats(?array $params = null)
$url = '/_transform/' . $this->encode($this->convertValue($params['transform_id'])) . '/_stats';
$method = 'GET';

$url = $this->addQueryString($url, $params, ['from','size','timeout','allow_no_match','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['allow_no_match','basic','from','size','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
Expand Down
Loading
Loading