From 4ea4a73ad2716caa08df1fa8534650cbe29e9d1e Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 5 Jan 2026 06:03:34 +0000 Subject: [PATCH] Auto-generated API code --- src/Endpoints/Esql.php | 3 + src/Endpoints/Inference.php | 1 + src/Endpoints/ProjectRouting.php | 226 +++++++++++++++++++++++++++++++ src/Endpoints/Reindex.php | 69 ++++++++++ src/Traits/NamespaceTrait.php | 20 +++ 5 files changed, 319 insertions(+) create mode 100644 src/Endpoints/ProjectRouting.php create mode 100644 src/Endpoints/Reindex.php diff --git a/src/Endpoints/Esql.php b/src/Endpoints/Esql.php index 1e44beb20..b5d707433 100644 --- a/src/Endpoints/Esql.php +++ b/src/Endpoints/Esql.php @@ -193,6 +193,7 @@ public function asyncQueryStop(?array $params = null) * Delete a non-materialized VIEW for ESQL. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-delete + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -274,6 +275,7 @@ public function getQuery(?array $params = null) * Get a non-materialized VIEW for ESQL. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-get + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -354,6 +356,7 @@ public function listQueries(?array $params = null) * Creates a non-materialized VIEW for ESQL. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-put + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ diff --git a/src/Endpoints/Inference.php b/src/Endpoints/Inference.php index d93ced570..b80fe57ab 100644 --- a/src/Endpoints/Inference.php +++ b/src/Endpoints/Inference.php @@ -1160,6 +1160,7 @@ public function putMistral(?array $params = null) * Create an Nvidia inference endpoint * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-nvidia + * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type diff --git a/src/Endpoints/ProjectRouting.php b/src/Endpoints/ProjectRouting.php new file mode 100644 index 000000000..1d2783fd8 --- /dev/null +++ b/src/Endpoints/ProjectRouting.php @@ -0,0 +1,226 @@ +, // A comma-separated list of filters used to reduce the response. + * body: string|array, // (REQUIRED) Project routing expression to save. If body is a string must be a valid JSON. + * } $params + * + * @throws MissingParameterException if a required parameter is missing + * @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 create(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['name','body'], $params); + $url = '/_project_routing/' . $this->encode($params['name']); + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['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, ['name'], $request, 'project_routing.create'); + return $this->client->sendRequest($request); + } + + + /** + * Create or update named project routing expressions + * + * @group serverless + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + * @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, // A comma-separated list of filters used to reduce the response. + * body: string|array, // (REQUIRED) Project routing expressions to save. 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 createMany(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); + $url = '/_project_routing/'; + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['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, 'project_routing.create_many'); + return $this->client->sendRequest($request); + } + + + /** + * Delete named project routing expression + * + * @group serverless + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + * @param array{ + * name: string, // (REQUIRED) The name of the project routing expression + * 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, // A comma-separated list of filters used to reduce the response. + * } $params + * + * @throws MissingParameterException if a required parameter is missing + * @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 delete(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['name'], $params); + $url = '/_project_routing/' . $this->encode($params['name']); + $method = 'DELETE'; + + $url = $this->addQueryString($url, $params, ['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, ['name'], $request, 'project_routing.delete'); + return $this->client->sendRequest($request); + } + + + /** + * Get named project routing expression + * + * @group serverless + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + * @param array{ + * name: string, // (REQUIRED) The name of the project routing expression + * 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, // A comma-separated list of filters used to reduce the response. + * } $params + * + * @throws MissingParameterException if a required parameter is missing + * @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 get(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['name'], $params); + $url = '/_project_routing/' . $this->encode($params['name']); + $method = 'GET'; + + $url = $this->addQueryString($url, $params, ['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, ['name'], $request, 'project_routing.get'); + return $this->client->sendRequest($request); + } + + + /** + * Get named project routing expressions + * + * @group serverless + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + * @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, // 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 getMany(?array $params = null) + { + $params = $params ?? []; + $url = '/_project_routing/'; + $method = 'GET'; + + $url = $this->addQueryString($url, $params, ['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, 'project_routing.get_many'); + return $this->client->sendRequest($request); + } +} diff --git a/src/Endpoints/Reindex.php b/src/Endpoints/Reindex.php new file mode 100644 index 000000000..55a6fb0d2 --- /dev/null +++ b/src/Endpoints/Reindex.php @@ -0,0 +1,69 @@ +, // A comma-separated list of filters used to reduce the response. + * } $params + * + * @throws MissingParameterException if a required parameter is missing + * @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 get(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['task_id'], $params); + $url = '/_reindex/' . $this->encode($params['task_id']); + $method = 'GET'; + + $url = $this->addQueryString($url, $params, ['wait_for_completion','timeout','pretty','human','error_trace','source','filter_path']); + $headers = [ + 'Accept' => 'application/json', + ]; + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); + $request = $this->addOtelAttributes($params, ['task_id'], $request, 'reindex.get'); + return $this->client->sendRequest($request); + } +} diff --git a/src/Traits/NamespaceTrait.php b/src/Traits/NamespaceTrait.php index 469a3fa84..64907f0a8 100644 --- a/src/Traits/NamespaceTrait.php +++ b/src/Traits/NamespaceTrait.php @@ -41,7 +41,9 @@ use Elastic\Elasticsearch\Endpoints\Nodes; use Elastic\Elasticsearch\Endpoints\Profiling; use Elastic\Elasticsearch\Endpoints\Project; +use Elastic\Elasticsearch\Endpoints\ProjectRouting; use Elastic\Elasticsearch\Endpoints\QueryRules; +use Elastic\Elasticsearch\Endpoints\Reindex; use Elastic\Elasticsearch\Endpoints\Rollup; use Elastic\Elasticsearch\Endpoints\SearchApplication; use Elastic\Elasticsearch\Endpoints\SearchableSnapshots; @@ -294,6 +296,15 @@ public function project(): Project } + public function projectRouting(): ProjectRouting + { + if (!isset($this->namespace['ProjectRouting'])) { + $this->namespace['ProjectRouting'] = new ProjectRouting($this); + } + return $this->namespace['ProjectRouting']; + } + + public function queryRules(): QueryRules { if (!isset($this->namespace['QueryRules'])) { @@ -303,6 +314,15 @@ public function queryRules(): QueryRules } + public function reindex(): Reindex + { + if (!isset($this->namespace['Reindex'])) { + $this->namespace['Reindex'] = new Reindex($this); + } + return $this->namespace['Reindex']; + } + + public function rollup(): Rollup { if (!isset($this->namespace['Rollup'])) {