diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5159c3b25..091e4b645 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -7,8 +7,8 @@ steps: env: PHP_VERSION: "{{ matrix.php }}" TEST_SUITE: "{{ matrix.suite }}" - STACK_VERSION: 9.1.0-SNAPSHOT - BRANCH_CLIENT_TESTS: 9.1 + STACK_VERSION: 9.2.0-SNAPSHOT + BRANCH_CLIENT_TESTS: 9.2 matrix: setup: suite: diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 743e5446b..483b1e58d 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -11,7 +11,7 @@ jobs: matrix: php-version: [8.1, 8.2, 8.3, 8.4] os: [ubuntu-latest] - es-version: [9.1.0-SNAPSHOT] + es-version: [9.2.0-SNAPSHOT] steps: - name: Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a15a240ed..e0c64b68e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: matrix: php-version: [8.1, 8.2, 8.3, 8.4] os: [ubuntu-latest] - es-version: [9.1.0-SNAPSHOT] + es-version: [9.2.0-SNAPSHOT] steps: - name: Checkout diff --git a/.github/workflows/yaml_test.yml b/.github/workflows/yaml_test.yml index 5196d6cf8..80ba81f6b 100644 --- a/.github/workflows/yaml_test.yml +++ b/.github/workflows/yaml_test.yml @@ -11,9 +11,9 @@ jobs: matrix: php-version: [8.1, 8.2, 8.3, 8.4] os: [ubuntu-latest] - es-version: [9.1.0-SNAPSHOT] + es-version: [9.2.0-SNAPSHOT] test-suite: [stack] - branch-client-tests: ["9.1"] + branch-client-tests: ["9.2"] steps: - name: Checkout diff --git a/src/Client.php b/src/Client.php index 90e5d93e4..808615c45 100644 --- a/src/Client.php +++ b/src/Client.php @@ -29,7 +29,7 @@ final class Client implements ClientInterface { const CLIENT_NAME = 'es'; - const VERSION = '9.1.0'; + const VERSION = '9.2.0'; const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=9'; const API_VERSION_HEADER = 'elastic-api-version'; const API_VERSION = '2023-10-31'; diff --git a/src/Endpoints/AsyncSearch.php b/src/Endpoints/AsyncSearch.php index 9433d2a56..22ba15d2c 100644 --- a/src/Endpoints/AsyncSearch.php +++ b/src/Endpoints/AsyncSearch.php @@ -29,9 +29,9 @@ class AsyncSearch extends AbstractEndpoint { /** - * Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + * Delete an async search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit * @group serverless * * @param array{ @@ -68,9 +68,9 @@ public function delete(?array $params = null) /** - * Retrieves the results of a previously submitted async search request given its ID. + * Get async search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit * @group serverless * * @param array{ @@ -110,9 +110,9 @@ public function get(?array $params = null) /** - * Retrieves the status of a previously submitted async search request given its ID. + * Get the async search status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit * @group serverless * * @param array{ @@ -150,9 +150,9 @@ public function status(?array $params = null) /** - * Executes a search request asynchronously. + * Run an async search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit * @group serverless * * @param array{ @@ -177,6 +177,7 @@ public function status(?array $params = null) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. * lenient?: bool, // Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * preference?: string, // Specify the node or shard the operation should be performed on (default: random) + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * rest_total_hits_as_int?: bool, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response * q?: string, // Query in the Lucene query string syntax * routing?: string|array, // A comma-separated list of specific routing values @@ -224,7 +225,7 @@ public function submit(?array $params = null) $url = '/_async_search'; $method = 'POST'; } - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','batched_reduce_size','request_cache','analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','rest_total_hits_as_int','q','routing','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','max_concurrent_shard_requests','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','batched_reduce_size','request_cache','analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','project_routing','rest_total_hits_as_int','q','routing','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','max_concurrent_shard_requests','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', diff --git a/src/Endpoints/Autoscaling.php b/src/Endpoints/Autoscaling.php index 41f0a5299..2cdcb9bc4 100644 --- a/src/Endpoints/Autoscaling.php +++ b/src/Endpoints/Autoscaling.php @@ -29,9 +29,9 @@ class Autoscaling extends AbstractEndpoint { /** - * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Delete an autoscaling policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy * * @param array{ * name: string, // (REQUIRED) the name of the autoscaling policy @@ -69,9 +69,9 @@ public function deleteAutoscalingPolicy(?array $params = null) /** - * Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Get the autoscaling capacity * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity * * @param array{ * master_timeout?: int|string, // Timeout for processing on master node @@ -105,9 +105,9 @@ public function getAutoscalingCapacity(?array $params = null) /** - * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Get an autoscaling policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity * * @param array{ * name: string, // (REQUIRED) the name of the autoscaling policy @@ -144,9 +144,9 @@ public function getAutoscalingPolicy(?array $params = null) /** - * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Create or update an autoscaling policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy * * @param array{ * name: string, // (REQUIRED) the name of the autoscaling policy diff --git a/src/Endpoints/Cat.php b/src/Endpoints/Cat.php index 5411ebac7..982bbf2c3 100644 --- a/src/Endpoints/Cat.php +++ b/src/Endpoints/Cat.php @@ -29,9 +29,9 @@ class Cat extends AbstractEndpoint { /** - * Shows information about currently configured aliases to indices including filter and routing infos. + * Get aliases * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-aliases * @group serverless * * @param array{ @@ -43,6 +43,8 @@ class Cat extends AbstractEndpoint * v?: bool, // Verbose mode. Display column headers * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. * master_timeout?: int|string, // Timeout for waiting for new cluster state in case it is blocked + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -66,7 +68,7 @@ public function aliases(?array $params = null) $url = '/_cat/aliases'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','h','help','s','v','expand_wildcards','master_timeout','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','h','help','s','v','expand_wildcards','master_timeout','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -77,14 +79,15 @@ public function aliases(?array $params = null) /** - * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + * Get shard allocation information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-allocation * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information * format?: string, // a short version of the Accept header, e.g. json, yaml * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * local?: bool, // Return local information, do not retrieve the state from master node (default: false) * master_timeout?: int|string, // Explicit operation timeout for connection to master node * h?: string|array, // Comma-separated list of column names to display @@ -114,7 +117,7 @@ public function allocation(?array $params = null) $url = '/_cat/allocation'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','bytes','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','bytes','time','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -125,9 +128,9 @@ public function allocation(?array $params = null) /** - * Returns information about existing component_templates templates. + * Get component templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-component-templates * @group serverless * * @param array{ @@ -139,6 +142,8 @@ public function allocation(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -162,7 +167,7 @@ public function componentTemplates(?array $params = null) $url = '/_cat/component_templates'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -173,9 +178,9 @@ public function componentTemplates(?array $params = null) /** - * Provides quick access to the document count of the entire cluster, or individual indices. + * Get a document count * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-count * @group serverless * * @param array{ @@ -183,8 +188,11 @@ public function componentTemplates(?array $params = null) * format?: string, // a short version of the Accept header, e.g. json, yaml * h?: string|array, // Comma-separated list of column names to display * help?: bool, // Return help information + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -208,7 +216,7 @@ public function count(?array $params = null) $url = '/_cat/count'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','h','help','project_routing','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -219,9 +227,9 @@ public function count(?array $params = null) /** - * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + * Get field data cache information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-fielddata * * @param array{ * fields?: string|array, // A comma-separated list of fields to return the fielddata size @@ -231,6 +239,7 @@ public function count(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * time?: string, // The unit in which to display time values * 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) @@ -254,7 +263,7 @@ public function fielddata(?array $params = null) $url = '/_cat/fielddata'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','bytes','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','bytes','h','help','s','v','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -265,9 +274,9 @@ public function fielddata(?array $params = null) /** - * Returns a concise representation of the cluster health. + * Get the cluster health status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-health * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -277,6 +286,7 @@ public function fielddata(?array $params = null) * time?: string, // The unit in which to display time values * ts?: bool, // Set to false to disable timestamping * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -296,7 +306,7 @@ public function health(?array $params = null) $url = '/_cat/health'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','h','help','s','time','ts','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','h','help','s','time','ts','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -307,9 +317,9 @@ public function health(?array $params = null) /** - * Returns help for the Cat APIs. + * Get CAT help * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cat * @group serverless * * @param array{ @@ -343,9 +353,9 @@ public function help(?array $params = null) /** - * Returns information about indices: number of primaries and replicas, document counts, disk size, ... + * Get index information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-indices * @group serverless * * @param array{ @@ -396,9 +406,9 @@ public function indices(?array $params = null) /** - * Returns information about the master node. + * Get master node information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-master * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -408,6 +418,8 @@ public function indices(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -427,7 +439,7 @@ public function master(?array $params = null) $url = '/_cat/master'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -438,9 +450,9 @@ public function master(?array $params = null) /** - * Gets configuration and usage information about data frame analytics jobs. + * Get data frame analytics jobs * - * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-data-frame-analytics * @group serverless * * @param array{ @@ -487,9 +499,9 @@ public function mlDataFrameAnalytics(?array $params = null) /** - * Gets configuration and usage information about datafeeds. + * Get datafeeds * - * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-datafeeds * @group serverless * * @param array{ @@ -501,6 +513,7 @@ public function mlDataFrameAnalytics(?array $params = null) * s?: string|array, // Comma-separated list of column names or column aliases to sort by * time?: string, // The unit in which to display time values * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -524,7 +537,7 @@ public function mlDatafeeds(?array $params = null) $url = '/_cat/ml/datafeeds'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['allow_no_match','format','h','help','s','time','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['allow_no_match','format','h','help','s','time','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -535,9 +548,9 @@ public function mlDatafeeds(?array $params = null) /** - * Gets configuration and usage information about anomaly detection jobs. + * Get anomaly detection jobs * - * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-jobs * @group serverless * * @param array{ @@ -584,9 +597,9 @@ public function mlJobs(?array $params = null) /** - * Gets configuration and usage information about inference trained models. + * Get trained models * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-trained-models * @group serverless * * @param array{ @@ -635,9 +648,9 @@ public function mlTrainedModels(?array $params = null) /** - * Returns information about custom node attributes. + * Get node attribute information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodeattrs * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -647,6 +660,8 @@ public function mlTrainedModels(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -666,7 +681,7 @@ public function nodeattrs(?array $params = null) $url = '/_cat/nodeattrs'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -677,9 +692,9 @@ public function nodeattrs(?array $params = null) /** - * Returns basic statistics about performance of cluster nodes. + * Get node information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes * * @param array{ * bytes?: string, // The unit in which to display byte values @@ -722,9 +737,9 @@ public function nodes(?array $params = null) /** - * Returns a concise representation of the cluster pending tasks. + * Get pending task information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-pending-tasks * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -735,6 +750,7 @@ public function nodes(?array $params = null) * s?: string|array, // Comma-separated list of column names or column aliases to sort by * time?: string, // The unit in which to display time values * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -754,7 +770,7 @@ public function pendingTasks(?array $params = null) $url = '/_cat/pending_tasks'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','time','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','time','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -765,9 +781,9 @@ public function pendingTasks(?array $params = null) /** - * Returns information about installed plugins across nodes node. + * Get plugin information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-plugins * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -778,6 +794,8 @@ public function pendingTasks(?array $params = null) * include_bootstrap?: bool, // Include bootstrap plugins in the response * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -797,7 +815,7 @@ public function plugins(?array $params = null) $url = '/_cat/plugins'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','include_bootstrap','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','include_bootstrap','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -808,9 +826,9 @@ public function plugins(?array $params = null) /** - * Returns information about index shard recoveries, both on-going completed. + * Get shard recovery information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-recovery * * @param array{ * index?: string|array, // Comma-separated list or wildcard expression of index names to limit the returned information @@ -857,9 +875,9 @@ public function recovery(?array $params = null) /** - * Returns information about snapshot repositories registered in the cluster. + * Get snapshot repository information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-repositories * * @param array{ * format?: string, // a short version of the Accept header, e.g. json, yaml @@ -869,6 +887,8 @@ public function recovery(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -888,7 +908,7 @@ public function repositories(?array $params = null) $url = '/_cat/repositories'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -899,9 +919,9 @@ public function repositories(?array $params = null) /** - * Provides low-level information about the segments in the shards of an index. + * Get segment information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-segments * * @param array{ * index?: string|array, // A comma-separated list of index names to limit the returned information @@ -913,6 +933,12 @@ public function repositories(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * time?: string, // The unit in which to display time values + * ignore_unavailable?: bool, // Whether specified concrete indices should be ignored when unavailable (missing or closed). Only allowed when providing an index expression. + * ignore_throttled?: bool, // Whether specified concrete, expanded or aliased indices should be ignored when throttled. Only allowed when providing an index expression. + * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). Only allowed when providing an index expression. + * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. + * allow_closed?: bool, // If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour of throwing an exception if index pattern matches closed 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) @@ -936,7 +962,7 @@ public function segments(?array $params = null) $url = '/_cat/segments'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','bytes','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','bytes','h','help','s','v','time','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','allow_closed','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -947,9 +973,9 @@ public function segments(?array $params = null) /** - * Provides a detailed view of shard allocation on nodes. + * Get shard information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-shards * * @param array{ * index?: string|array, // A comma-separated list of index names to limit the returned information @@ -995,9 +1021,9 @@ public function shards(?array $params = null) /** - * Returns all snapshots in a specific repository. + * Get snapshot information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-snapshots * * @param array{ * repository?: string|array, // Name of repository from which to fetch the snapshot information @@ -1009,6 +1035,7 @@ public function shards(?array $params = null) * s?: string|array, // Comma-separated list of column names or column aliases to sort by * time?: string, // The unit in which to display time values * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -1032,7 +1059,7 @@ public function snapshots(?array $params = null) $url = '/_cat/snapshots'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','ignore_unavailable','master_timeout','h','help','s','time','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','ignore_unavailable','master_timeout','h','help','s','time','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -1043,9 +1070,9 @@ public function snapshots(?array $params = null) /** - * Returns information about the tasks currently executing on one or more nodes in the cluster. + * Get task information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-tasks * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -1061,6 +1088,7 @@ public function snapshots(?array $params = null) * v?: bool, // Verbose mode. Display column headers * timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * wait_for_completion?: bool, // If `true`, the request blocks until the task has completed. + * bytes?: string, // The unit in which to display byte values * 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) @@ -1080,7 +1108,7 @@ public function tasks(?array $params = null) $url = '/_cat/tasks'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['format','nodes','actions','detailed','parent_task_id','h','help','s','time','v','timeout','wait_for_completion','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','nodes','actions','detailed','parent_task_id','h','help','s','time','v','timeout','wait_for_completion','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -1091,9 +1119,9 @@ public function tasks(?array $params = null) /** - * Returns information about existing templates. + * Get index template information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-templates * * @param array{ * name?: string, // A pattern that returned template names must match @@ -1104,6 +1132,8 @@ public function tasks(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values + * time?: string, // The unit in which to display time values * 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) @@ -1127,7 +1157,7 @@ public function templates(?array $params = null) $url = '/_cat/templates'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','local','master_timeout','h','help','s','v','bytes','time','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -1138,10 +1168,9 @@ public function templates(?array $params = null) /** - * Returns cluster-wide thread pool statistics per node. - * By default the active, queue and rejected statistics are returned for all thread pools. + * Get thread pool statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-thread-pool * * @param array{ * thread_pool_patterns?: string|array, // A comma-separated list of regular-expressions to filter the thread pools in the output @@ -1153,6 +1182,7 @@ public function templates(?array $params = null) * help?: bool, // Return help information * s?: string|array, // Comma-separated list of column names or column aliases to sort by * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -1176,7 +1206,7 @@ public function threadPool(?array $params = null) $url = '/_cat/thread_pool'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['format','time','local','master_timeout','h','help','s','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','time','local','master_timeout','h','help','s','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; @@ -1187,9 +1217,9 @@ public function threadPool(?array $params = null) /** - * Gets configuration and usage information about transforms. + * Get transform information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-transforms * @group serverless * * @param array{ @@ -1203,6 +1233,7 @@ public function threadPool(?array $params = null) * s?: string|array, // Comma-separated list of column names or column aliases to sort by * time?: string, // The unit in which to display time values * v?: bool, // Verbose mode. Display column headers + * bytes?: string, // The unit in which to display byte values * 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) @@ -1226,7 +1257,7 @@ public function transforms(?array $params = null) $url = '/_cat/transforms'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['from','size','allow_no_match','format','h','help','s','time','v','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['from','size','allow_no_match','format','h','help','s','time','v','bytes','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'text/plain,application/json', ]; diff --git a/src/Endpoints/Ccr.php b/src/Endpoints/Ccr.php index 218fb9efa..837d55fb7 100644 --- a/src/Endpoints/Ccr.php +++ b/src/Endpoints/Ccr.php @@ -29,9 +29,9 @@ class Ccr extends AbstractEndpoint { /** - * Deletes auto-follow patterns. + * Delete auto-follow patterns * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern * * @param array{ * name: string, // (REQUIRED) The name of the auto follow pattern. @@ -68,9 +68,9 @@ public function deleteAutoFollowPattern(?array $params = null) /** - * Creates a new follower index configured to follow the referenced leader index. + * Create a follower * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow * * @param array{ * index: string, // (REQUIRED) The name of the follower index @@ -110,9 +110,9 @@ public function follow(?array $params = null) /** - * Retrieves information about all follower indices, including parameters and status for each follower index + * Get follower information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-info * * @param array{ * index: string|array, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -149,9 +149,9 @@ public function followInfo(?array $params = null) /** - * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + * Get follower stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-stats * * @param array{ * index: string|array, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -188,9 +188,9 @@ public function followStats(?array $params = null) /** - * Removes the follower retention leases from the leader. + * Forget a follower * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-forget-follower * * @param array{ * index: string, // (REQUIRED) the name of the leader index for which specified follower retention leases should be removed @@ -229,9 +229,9 @@ public function forgetFollower(?array $params = null) /** - * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + * Get auto-follow patterns * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1 * * @param array{ * name?: string, // The name of the auto follow pattern. @@ -270,9 +270,9 @@ public function getAutoFollowPattern(?array $params = null) /** - * Pauses an auto-follow pattern + * Pause an auto-follow pattern * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-auto-follow-pattern * * @param array{ * name: string, // (REQUIRED) The name of the auto follow pattern that should pause discovering new indices to follow. @@ -309,9 +309,9 @@ public function pauseAutoFollowPattern(?array $params = null) /** - * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + * Pause a follower * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-follow * * @param array{ * index: string, // (REQUIRED) The name of the follower index that should pause following its leader index. @@ -348,9 +348,9 @@ public function pauseFollow(?array $params = null) /** - * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + * Create or update auto-follow patterns * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-put-auto-follow-pattern * * @param array{ * name: string, // (REQUIRED) The name of the auto follow pattern. @@ -389,9 +389,9 @@ public function putAutoFollowPattern(?array $params = null) /** - * Resumes an auto-follow pattern that has been paused + * Resume an auto-follow pattern * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-auto-follow-pattern * * @param array{ * name: string, // (REQUIRED) The name of the auto follow pattern to resume discovering new indices to follow. @@ -428,9 +428,9 @@ public function resumeAutoFollowPattern(?array $params = null) /** - * Resumes a follower index that has been paused + * Resume a follower * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow * * @param array{ * index: string, // (REQUIRED) The name of the follow index to resume following. @@ -469,9 +469,9 @@ public function resumeFollow(?array $params = null) /** - * Gets all stats related to cross-cluster replication. + * Get cross-cluster replication stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats * * @param array{ * timeout?: int|string, // Explicit operation timeout @@ -506,9 +506,9 @@ public function stats(?array $params = null) /** - * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + * Unfollow an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-unfollow * * @param array{ * index: string, // (REQUIRED) The name of the follower index that should be turned into a regular index. diff --git a/src/Endpoints/Cluster.php b/src/Endpoints/Cluster.php index 97413d4e1..36aece93f 100644 --- a/src/Endpoints/Cluster.php +++ b/src/Endpoints/Cluster.php @@ -29,11 +29,15 @@ class Cluster extends AbstractEndpoint { /** - * Provides explanations for shard allocations in the cluster. + * Explain the shard allocations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain * * @param array{ + * index?: string, // Specifies the name of the index that you would like an explanation for + * shard?: int, // Specifies the ID of the shard that you would like an explanation for + * primary?: bool, // If true, returns explanation for the primary shard for the given shard ID + * current_node?: string, // Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node * master_timeout?: int|string, // Timeout for connection to master node * include_yes_decisions?: bool, // Return 'YES' decisions in explanation (default: false) * include_disk_info?: bool, // Return information about disk usage and shard sizes (default: false) @@ -57,7 +61,7 @@ public function allocationExplain(?array $params = null) $url = '/_cluster/allocation/explain'; $method = empty($params['body']) ? 'GET' : 'POST'; - $url = $this->addQueryString($url, $params, ['master_timeout','include_yes_decisions','include_disk_info','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['index','shard','primary','current_node','master_timeout','include_yes_decisions','include_disk_info','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -69,9 +73,9 @@ public function allocationExplain(?array $params = null) /** - * Deletes a component template + * Delete component templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template * @group serverless * * @param array{ @@ -110,9 +114,9 @@ public function deleteComponentTemplate(?array $params = null) /** - * Clears cluster voting config exclusions. + * Clear cluster voting config exclusions * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions * * @param array{ * wait_for_removal?: bool, // Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. @@ -147,9 +151,9 @@ public function deleteVotingConfigExclusions(?array $params = null) /** - * Returns information about whether a particular component template exist + * Check component templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template * @group serverless * * @param array{ @@ -188,9 +192,9 @@ public function existsComponentTemplate(?array $params = null) /** - * Returns one or more component templates + * Get component templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template * @group serverless * * @param array{ @@ -234,9 +238,9 @@ public function getComponentTemplate(?array $params = null) /** - * Returns cluster settings. + * Get cluster-wide settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-get-settings * * @param array{ * flat_settings?: bool, // Return settings in flat format (default: false) @@ -273,9 +277,9 @@ public function getSettings(?array $params = null) /** - * Returns basic information about the health of the cluster. + * Get the cluster health status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-health * * @param array{ * index?: string|array, // Limit the information returned to a specific index @@ -324,9 +328,9 @@ public function health(?array $params = null) /** - * Returns different information about the cluster. + * Get cluster info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-info * @group serverless * * @param array{ @@ -363,10 +367,9 @@ public function info(?array $params = null) /** - * Returns a list of any cluster-level changes (e.g. create index, update mapping, - * allocate or fail shard) which have not yet been executed. + * Get the pending cluster tasks * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-pending-tasks * * @param array{ * local?: bool, // Return local information, do not retrieve the state from master node (default: false) @@ -401,9 +404,9 @@ public function pendingTasks(?array $params = null) /** - * Updates the cluster voting config exclusions by node ids or node names. + * Update voting configuration exclusions * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions * * @param array{ * node_ids?: string, // A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. @@ -440,9 +443,9 @@ public function postVotingConfigExclusions(?array $params = null) /** - * Creates or updates a component template + * Create or update a component template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template * @group serverless * * @param array{ @@ -484,9 +487,9 @@ public function putComponentTemplate(?array $params = null) /** - * Updates the cluster settings. + * Update the cluster settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-settings * * @param array{ * flat_settings?: bool, // Return settings in flat format (default: false) @@ -525,9 +528,9 @@ public function putSettings(?array $params = null) /** - * Returns the information about configured remote clusters. + * Get remote cluster information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-remote-info * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -560,9 +563,9 @@ public function remoteInfo(?array $params = null) /** - * Allows to manually change the allocation of individual shards in the cluster. + * Reroute the cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-reroute * * @param array{ * dry_run?: bool, // Simulate the operation only and return the resulting state @@ -603,15 +606,15 @@ public function reroute(?array $params = null) /** - * Returns a comprehensive information about the state of the cluster. + * Get the cluster state * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-state * * @param array{ * metric?: string|array, // Limit the information returned to the specified metrics * index?: string|array, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices * local?: bool, // Return local information, do not retrieve the state from master node (default: false) - * master_timeout?: int|string, // Specify timeout for connection to master + * master_timeout?: int|string, // Timeout for waiting for new cluster state in case it is blocked * flat_settings?: bool, // Return settings in flat format (default: false) * wait_for_metadata_version?: int, // Wait for the metadata version to be equal or greater than the specified metadata version * wait_for_timeout?: int|string, // The maximum time to wait for wait_for_metadata_version before timing out @@ -655,9 +658,9 @@ public function state(?array $params = null) /** - * Returns high-level overview of cluster statistics. + * Get cluster statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-stats * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes diff --git a/src/Endpoints/Connector.php b/src/Endpoints/Connector.php index be7c9c10f..3245a846f 100644 --- a/src/Endpoints/Connector.php +++ b/src/Endpoints/Connector.php @@ -29,9 +29,9 @@ class Connector extends AbstractEndpoint { /** - * Updates the last_seen timestamp in the connector document. + * Check in a connector * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-check-in * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -69,11 +69,10 @@ public function checkIn(?array $params = null) /** - * Deletes a connector. + * Delete a connector * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-delete * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be deleted. @@ -111,11 +110,10 @@ public function delete(?array $params = null) /** - * Returns the details about a connector. + * Get a connector * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-get * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be returned. @@ -152,52 +150,10 @@ public function get(?array $params = null) /** - * Updates the stats of last sync in the connector document. - * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release - * - * @param array{ - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. - * 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) Object with stats related to the last connector sync run.. 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 lastSync(?array $params = null) - { - $params = $params ?? []; - $this->checkRequiredParameters(['connector_id','body'], $params); - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync'; - $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, ['connector_id'], $request, 'connector.last_sync'); - return $this->client->sendRequest($request); - } - - - /** - * Lists all connectors. + * Get all connectors * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-list * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * from?: int, // Starting offset (default: 0) @@ -237,11 +193,10 @@ public function list(?array $params = null) /** - * Creates a connector. + * Create a connector * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put * @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) @@ -276,11 +231,10 @@ public function post(?array $params = null) /** - * Creates or updates a connector. + * Create or update a connector * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id?: string, // The unique identifier of the connector to be created or updated. @@ -320,11 +274,10 @@ public function put(?array $params = null) /** - * Cancels a connector sync job. + * Cancel a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-cancel * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be canceled @@ -360,9 +313,9 @@ public function syncJobCancel(?array $params = null) /** - * Checks in a connector sync job (refreshes 'last_seen'). + * Check in a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-check-in * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -399,9 +352,9 @@ public function syncJobCheckIn(?array $params = null) /** - * Claims a connector sync job. + * Claim a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/claim-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-claim * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -440,11 +393,10 @@ public function syncJobClaim(?array $params = null) /** - * Deletes a connector sync job. + * Delete a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-delete * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be deleted. @@ -480,9 +432,9 @@ public function syncJobDelete(?array $params = null) /** - * Sets an error for a connector sync job. + * Set a connector sync job error * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -521,11 +473,10 @@ public function syncJobError(?array $params = null) /** - * Returns the details about a connector sync job. + * Get a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-get * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be returned. @@ -561,16 +512,15 @@ public function syncJobGet(?array $params = null) /** - * Lists all connector sync jobs. + * Get all connector sync jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-list * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * from?: int, // Starting offset (default: 0) * size?: int, // specifies a max number of results to get (default: 100) - * status?: string, // Sync job status, which sync jobs are fetched for + * status?: string, // A sync job status to fetch connector sync jobs for * connector_id?: string, // Id of the connector to fetch the sync jobs for * job_type?: string|array, // A comma-separated list of job types * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -603,11 +553,10 @@ public function syncJobList(?array $params = null) /** - * Creates a connector sync job. + * Create a connector sync job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-post * @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) @@ -643,9 +592,9 @@ public function syncJobPost(?array $params = null) /** - * Updates the stats fields in the connector sync job document. + * Set the connector sync job stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-update-stats * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -684,9 +633,9 @@ public function syncJobUpdateStats(?array $params = null) /** - * Activates the draft filtering rules if they are in a validated state. + * Activate the connector draft filter * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -725,11 +674,10 @@ public function updateActiveFiltering(?array $params = null) /** - * Updates the API key id and/or API key secret id fields in the connector document. + * Update the connector API key ID * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-api-key-id * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -767,11 +715,10 @@ public function updateApiKeyId(?array $params = null) /** - * Updates the connector configuration. + * Update the connector configuration * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-configuration * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -809,9 +756,9 @@ public function updateConfiguration(?array $params = null) /** - * Updates the error field in the connector document. + * Update the connector error field * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-error * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -851,9 +798,9 @@ public function updateError(?array $params = null) /** - * Updates the connector features in the connector document. + * Update the connector features * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-features-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-features * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -892,11 +839,10 @@ public function updateFeatures(?array $params = null) /** - * Updates the filtering field in the connector document. + * Update the connector filtering * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -934,9 +880,9 @@ public function updateFiltering(?array $params = null) /** - * Updates the validation info of the draft filtering rules. + * Update the connector draft filtering validation * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering-validation * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -976,11 +922,10 @@ public function updateFilteringValidation(?array $params = null) /** - * Updates the index name of the connector. + * Update the connector index name * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-index-name * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1018,11 +963,10 @@ public function updateIndexName(?array $params = null) /** - * Updates the name and/or description fields in the connector document. + * Update the connector name and description * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-name * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1060,11 +1004,10 @@ public function updateName(?array $params = null) /** - * Updates the is_native flag of the connector. + * Update the connector is_native flag * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-native * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1102,11 +1045,10 @@ public function updateNative(?array $params = null) /** - * Updates the pipeline field in the connector document. + * Update the connector pipeline * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-pipeline * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1144,11 +1086,10 @@ public function updatePipeline(?array $params = null) /** - * Updates the scheduling field in the connector document. + * Update the connector scheduling * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-scheduling * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1186,11 +1127,10 @@ public function updateScheduling(?array $params = null) /** - * Updates the service type of the connector. + * Update the connector service type * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. @@ -1228,9 +1168,9 @@ public function updateServiceType(?array $params = null) /** - * Updates the status of the connector. + * Update the connector status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-status * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * diff --git a/src/Endpoints/DanglingIndices.php b/src/Endpoints/DanglingIndices.php index e5e87e720..a2a42d9a4 100644 --- a/src/Endpoints/DanglingIndices.php +++ b/src/Endpoints/DanglingIndices.php @@ -29,9 +29,9 @@ class DanglingIndices extends AbstractEndpoint { /** - * Deletes the specified dangling index + * Delete a dangling index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-delete-dangling-index * * @param array{ * index_uuid: string, // (REQUIRED) The UUID of the dangling index @@ -70,9 +70,9 @@ public function deleteDanglingIndex(?array $params = null) /** - * Imports the specified dangling index + * Import a dangling index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-import-dangling-index * * @param array{ * index_uuid: string, // (REQUIRED) The UUID of the dangling index @@ -111,9 +111,9 @@ public function importDanglingIndex(?array $params = null) /** - * Returns all dangling indices. + * Get the dangling indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-list-dangling-indices * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) diff --git a/src/Endpoints/Enrich.php b/src/Endpoints/Enrich.php index eaffe0061..caf71d44d 100644 --- a/src/Endpoints/Enrich.php +++ b/src/Endpoints/Enrich.php @@ -29,9 +29,9 @@ class Enrich extends AbstractEndpoint { /** - * Deletes an existing enrich policy and its enrich index. + * Delete an enrich policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-delete-policy * @group serverless * * @param array{ @@ -69,9 +69,9 @@ public function deletePolicy(?array $params = null) /** - * Creates the enrich index for an existing enrich policy. + * Run an enrich policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy * @group serverless * * @param array{ @@ -110,9 +110,9 @@ public function executePolicy(?array $params = null) /** - * Gets information about an enrich policy. + * Get an enrich policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy * @group serverless * * @param array{ @@ -152,9 +152,9 @@ public function getPolicy(?array $params = null) /** - * Creates a new enrich policy. + * Create an enrich policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy * @group serverless * * @param array{ @@ -194,9 +194,9 @@ public function putPolicy(?array $params = null) /** - * Gets enrich coordinator statistics and information about enrich policies that are currently executing. + * Get enrich stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-stats * * @param array{ * master_timeout?: int|string, // Timeout for waiting for new cluster state in case it is blocked diff --git a/src/Endpoints/Eql.php b/src/Endpoints/Eql.php index 4a257f48d..28cfae3d6 100644 --- a/src/Endpoints/Eql.php +++ b/src/Endpoints/Eql.php @@ -29,9 +29,9 @@ class Eql extends AbstractEndpoint { /** - * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + * Delete an async EQL search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete * @group serverless * * @param array{ @@ -68,9 +68,9 @@ public function delete(?array $params = null) /** - * Returns async results from previously executed Event Query Language (EQL) search + * Get async EQL search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get * @group serverless * * @param array{ @@ -109,9 +109,9 @@ public function get(?array $params = null) /** - * Returns the status of a previously submitted async or stored Event Query Language (EQL) search + * Get the async EQL status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status * @group serverless * * @param array{ @@ -148,9 +148,9 @@ public function getStatus(?array $params = null) /** - * Returns results matching a query expressed in Event Query Language (EQL) + * Get EQL search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search * @group serverless * * @param array{ @@ -164,6 +164,7 @@ public function getStatus(?array $params = null) * ignore_unavailable?: bool, // Whether specified concrete indices should be ignored when unavailable (missing or closed) * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -186,7 +187,7 @@ public function search(?array $params = null) $url = '/' . $this->encode($params['index']) . '/_eql/search'; $method = empty($params['body']) ? 'GET' : 'POST'; - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','allow_partial_search_results','allow_partial_sequence_results','ccs_minimize_roundtrips','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','allow_partial_search_results','allow_partial_sequence_results','ccs_minimize_roundtrips','ignore_unavailable','allow_no_indices','expand_wildcards','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', diff --git a/src/Endpoints/Esql.php b/src/Endpoints/Esql.php index 059b4496e..a288767f0 100644 --- a/src/Endpoints/Esql.php +++ b/src/Endpoints/Esql.php @@ -29,12 +29,12 @@ class Esql extends AbstractEndpoint { /** - * Executes an ESQL request asynchronously + * Run an async ES|QL query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query * * @param array{ - * format?: string, // a short version of the Accept header, e.g. json, yaml + * format?: string, // A short version of the Accept header, e.g. json, yaml.`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.For async requests, nothing will be returned if the async query doesn't finish within the timeout.The query ID and running status are available in the `X-Elasticsearch-Async-Id` and `X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively. * delimiter?: string, // The character to use between values within a CSV row. Only valid for the csv format. * drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. * allow_partial_results?: bool, // If `true`, partial results will be returned if there are shard failures, butthe query can continue to execute on other clusters and shards.If `false`, the entire query will fail if there areany failures. @@ -71,9 +71,9 @@ public function asyncQuery(?array $params = null) /** - * Delete an async query request given its ID. + * Delete an async ES|QL query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-delete-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-delete * * @param array{ * id: string, // (REQUIRED) The async query ID @@ -109,13 +109,13 @@ public function asyncQueryDelete(?array $params = null) /** - * Retrieves the results of a previously submitted async query request given its ID. + * Get async ES|QL query results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-get * * @param array{ * id: string, // (REQUIRED) The async query ID - * format?: string, // a short version of the Accept header, e.g. json, yaml + * format?: string, // A short version of the Accept header, for example `json` or `yaml`. * wait_for_completion_timeout?: int|string, // Specify the time that the request should block waiting for the final response * keep_alive?: int|string, // Specify the time interval in which the results (partial or final) for this search will be available * drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. @@ -151,12 +151,13 @@ public function asyncQueryGet(?array $params = null) /** - * Stops a previously submitted async query request given its ID and collects the results. + * Stop async ES|QL query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-stop-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-stop * * @param array{ * id: string, // (REQUIRED) The async query ID + * drop_null_columns?: bool, // Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results. * 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) @@ -178,7 +179,7 @@ public function asyncQueryStop(?array $params = null) $url = '/_query/async/' . $this->encode($params['id']) . '/stop'; $method = 'POST'; - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['drop_null_columns','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; @@ -189,8 +190,9 @@ public function asyncQueryStop(?array $params = null) /** - * Executes a get ESQL query request + * Get a specific running ES|QL query information * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-get-query * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -229,8 +231,9 @@ public function getQuery(?array $params = null) /** - * Executes a list ESQL queries request + * Get running ES|QL queries information * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-list-queries * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -266,13 +269,13 @@ public function listQueries(?array $params = null) /** - * Executes an ESQL request + * Run an ES|QL query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html + * @link https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest * @group serverless * * @param array{ - * format?: string, // a short version of the Accept header, e.g. json, yaml + * format?: string, // A short version of the Accept header, e.g. json, yaml.`csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response. * delimiter?: string, // The character to use between values within a CSV row. Only valid for the csv format. * drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. * allow_partial_results?: bool, // If `true`, partial results will be returned if there are shard failures, butthe query can continue to execute on other clusters and shards.If `false`, the entire query will fail if there areany failures. diff --git a/src/Endpoints/Features.php b/src/Endpoints/Features.php index f574c4682..ccd92668e 100644 --- a/src/Endpoints/Features.php +++ b/src/Endpoints/Features.php @@ -29,9 +29,9 @@ class Features extends AbstractEndpoint { /** - * Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + * Get the features * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-get-features * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -65,9 +65,9 @@ public function getFeatures(?array $params = null) /** - * Resets the internal state of features, usually by deleting system indices + * Reset the features * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-reset-features * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ diff --git a/src/Endpoints/Fleet.php b/src/Endpoints/Fleet.php index 41e11c156..0da5ee2fe 100644 --- a/src/Endpoints/Fleet.php +++ b/src/Endpoints/Fleet.php @@ -29,9 +29,9 @@ class Fleet extends AbstractEndpoint { /** - * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. + * Get global checkpoints * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-fleet * * @param array{ * index: string, // (REQUIRED) The name of the index. @@ -72,7 +72,7 @@ public function globalCheckpoints(?array $params = null) /** - * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + * Run multiple Fleet searches * * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -115,7 +115,7 @@ public function msearch(?array $params = null) /** - * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + * Run a Fleet search * * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -129,7 +129,7 @@ public function msearch(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The search definition using the Query DSL. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The search definition using the Query DSL. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -142,7 +142,7 @@ public function msearch(?array $params = null) public function search(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index'], $params); + $this->checkRequiredParameters(['index','body'], $params); $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; $method = empty($params['body']) ? 'GET' : 'POST'; diff --git a/src/Endpoints/Graph.php b/src/Endpoints/Graph.php index 8b53672dd..674a69b2d 100644 --- a/src/Endpoints/Graph.php +++ b/src/Endpoints/Graph.php @@ -29,10 +29,9 @@ class Graph extends AbstractEndpoint { /** - * Explore extracted and summarized information about the documents and terms in an index. + * Explore graph analytics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html - * @group serverless + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-graph * * @param array{ * index: string|array, // (REQUIRED) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -43,7 +42,7 @@ class Graph 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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // Graph Query DSL. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) Graph Query DSL. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -56,7 +55,7 @@ class Graph extends AbstractEndpoint public function explore(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index'], $params); + $this->checkRequiredParameters(['index','body'], $params); $url = '/' . $this->encode($this->convertValue($params['index'])) . '/_graph/explore'; $method = empty($params['body']) ? 'GET' : 'POST'; diff --git a/src/Endpoints/Ilm.php b/src/Endpoints/Ilm.php index b83b6c55d..e6e639b77 100644 --- a/src/Endpoints/Ilm.php +++ b/src/Endpoints/Ilm.php @@ -29,9 +29,9 @@ class Ilm extends AbstractEndpoint { /** - * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + * Delete a lifecycle policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-delete-lifecycle * * @param array{ * policy: string, // (REQUIRED) The name of the index lifecycle policy @@ -69,9 +69,9 @@ public function deleteLifecycle(?array $params = null) /** - * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. + * Explain the lifecycle state * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-explain-lifecycle * * @param array{ * index: string, // (REQUIRED) The name of the index to explain @@ -110,9 +110,9 @@ public function explainLifecycle(?array $params = null) /** - * Returns the specified policy definition. Includes the policy version and last modified date. + * Get lifecycle policies * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-lifecycle * * @param array{ * policy?: string, // The name of the index lifecycle policy @@ -152,9 +152,9 @@ public function getLifecycle(?array $params = null) /** - * Retrieves the current index lifecycle management (ILM) status. + * Get the ILM status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-status * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -187,9 +187,9 @@ public function getStatus(?array $params = null) /** - * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + * Migrate to data tiers routing * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-migrate-to-data-tiers * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -226,9 +226,9 @@ public function migrateToDataTiers(?array $params = null) /** - * Manually moves an index into the specified step and executes that step. + * Move to a lifecycle step * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-move-to-step * * @param array{ * index: string, // (REQUIRED) The name of the index whose lifecycle step is to change @@ -237,7 +237,7 @@ public function migrateToDataTiers(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The new lifecycle step to move to. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The new lifecycle step to move to. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -250,7 +250,7 @@ public function migrateToDataTiers(?array $params = null) public function moveToStep(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index'], $params); + $this->checkRequiredParameters(['index','body'], $params); $url = '/_ilm/move/' . $this->encode($params['index']); $method = 'POST'; @@ -266,9 +266,9 @@ public function moveToStep(?array $params = null) /** - * Creates a lifecycle policy + * Create or update a lifecycle policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle * * @param array{ * policy: string, // (REQUIRED) The name of the index lifecycle policy @@ -279,7 +279,7 @@ public function moveToStep(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The lifecycle policy definition to register. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The lifecycle policy definition to register. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -292,7 +292,7 @@ public function moveToStep(?array $params = null) public function putLifecycle(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['policy'], $params); + $this->checkRequiredParameters(['policy','body'], $params); $url = '/_ilm/policy/' . $this->encode($params['policy']); $method = 'PUT'; @@ -308,9 +308,9 @@ public function putLifecycle(?array $params = null) /** - * Removes the assigned lifecycle policy and stops managing the specified index + * Remove policies from an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-remove-policy * * @param array{ * index: string, // (REQUIRED) The name of the index to remove policy on @@ -346,9 +346,9 @@ public function removePolicy(?array $params = null) /** - * Retries executing the policy for an index that is in the ERROR step. + * Retry a policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-retry * * @param array{ * index: string, // (REQUIRED) The name of the indices (comma-separated) whose failed lifecycle step is to be retry @@ -384,9 +384,9 @@ public function retry(?array $params = null) /** - * Start the index lifecycle management (ILM) plugin. + * Start the ILM plugin * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-start * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -421,9 +421,9 @@ public function start(?array $params = null) /** - * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + * Stop the ILM plugin * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-stop * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node diff --git a/src/Endpoints/Indices.php b/src/Endpoints/Indices.php index f4c4bfe81..93cd7f7da 100644 --- a/src/Endpoints/Indices.php +++ b/src/Endpoints/Indices.php @@ -29,9 +29,9 @@ class Indices extends AbstractEndpoint { /** - * Adds a block to an index. + * Add an index block * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-add-block * @group serverless * * @param array{ @@ -74,9 +74,9 @@ public function addBlock(?array $params = null) /** - * Performs the analysis process on a text and return the tokens breakdown of the text. + * Get tokens from text analysis * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze * @group serverless * * @param array{ @@ -86,7 +86,7 @@ public function addBlock(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // Define analyzer/tokenizer parameters and the text on which the analysis should be performed. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) Define analyzer/tokenizer parameters and the text on which the analysis should be performed. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline @@ -98,6 +98,7 @@ public function addBlock(?array $params = null) public function analyze(?array $params = null) { $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); if (isset($params['index'])) { $url = '/' . $this->encode($params['index']) . '/_analyze'; $method = empty($params['body']) ? 'GET' : 'POST'; @@ -117,9 +118,49 @@ public function analyze(?array $params = null) /** - * Clears all or specific caches for one or more indices. + * Cancel a migration reindex operation + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-cancel-migrate-reindex + * @group serverless + * + * @param array{ + * index: string, // (REQUIRED) The index or data stream name + * 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 cancelMigrateReindex(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['index'], $params); + $url = '/_migration/reindex/' . $this->encode($params['index']) . '/_cancel'; + $method = 'POST'; + + $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, ['index'], $request, 'indices.cancel_migrate_reindex'); + return $this->client->sendRequest($request); + } + + + /** + * Clear the cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clear-cache * * @param array{ * index?: string|array, // A comma-separated list of index name to limit the operation @@ -164,9 +205,9 @@ public function clearCache(?array $params = null) /** - * Clones an index + * Clone an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clone * * @param array{ * index: string, // (REQUIRED) The name of the source index to clone @@ -208,9 +249,9 @@ public function clone(?array $params = null) /** - * Closes an index. + * Close an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-close * * @param array{ * index: string|array, // (REQUIRED) A comma separated list of indices to close @@ -252,9 +293,9 @@ public function close(?array $params = null) /** - * Creates an index with optional settings and mappings. + * Create an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create * @group serverless * * @param array{ @@ -296,9 +337,9 @@ public function create(?array $params = null) /** - * Creates a data stream + * Create a data stream * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-data-stream * @group serverless * * @param array{ @@ -337,12 +378,55 @@ public function createDataStream(?array $params = null) /** - * Provides statistics on operations happening in a data stream. + * Create an index from a source index + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-from + * @group serverless + * + * @param array{ + * source: string, // (REQUIRED) The source index name + * dest: string, // (REQUIRED) The destination index name + * 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, // The body contains the fields `mappings_override`, `settings_override`, and `remove_index_blocks`.. 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 createFrom(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['source','dest'], $params); + $url = '/_create_from/' . $this->encode($params['source']) . '/' . $this->encode($params['dest']); + $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, ['source', 'dest'], $request, 'indices.create_from'); + return $this->client->sendRequest($request); + } + + + /** + * Get data stream stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-data-streams-stats-1 * * @param array{ * name?: string|array, // A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams + * expand_wildcards?: string|array, // Whether to expand wildcard expressions to concrete data stream names that are open, closed or both. * 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) @@ -366,7 +450,7 @@ public function dataStreamsStats(?array $params = null) $url = '/_data_stream/_stats'; $method = 'GET'; } - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; @@ -377,9 +461,9 @@ public function dataStreamsStats(?array $params = null) /** - * Deletes an index. + * Delete indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete * @group serverless * * @param array{ @@ -421,9 +505,9 @@ public function delete(?array $params = null) /** - * Deletes an alias. + * Delete an alias * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-alias * @group serverless * * @param array{ @@ -463,9 +547,9 @@ public function deleteAlias(?array $params = null) /** - * Deletes the data stream lifecycle of the selected data streams. + * Delete data stream lifecycles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-lifecycle * * @param array{ * name: string|array, // (REQUIRED) A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams @@ -504,9 +588,9 @@ public function deleteDataLifecycle(?array $params = null) /** - * Deletes a data stream. + * Delete data streams * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-stream * @group serverless * * @param array{ @@ -545,9 +629,9 @@ public function deleteDataStream(?array $params = null) /** - * Deletes the data stream options of the selected data streams. + * Delete data stream options * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-stream-options * * @param array{ * name: string|array, // (REQUIRED) A comma-separated list of data streams of which the data stream options will be deleted; use `*` to get all data streams @@ -586,9 +670,9 @@ public function deleteDataStreamOptions(?array $params = null) /** - * Deletes an index template. + * Delete an index template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-index-template * @group serverless * * @param array{ @@ -627,9 +711,9 @@ public function deleteIndexTemplate(?array $params = null) /** - * Deletes an index template. + * Delete a legacy index template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template * * @param array{ * name: string, // (REQUIRED) The name of the template @@ -667,9 +751,9 @@ public function deleteTemplate(?array $params = null) /** - * Analyzes the disk usage of each field of an index or data stream + * Analyze the index disk usage * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-disk-usage * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -713,7 +797,7 @@ public function diskUsage(?array $params = null) /** * Downsample an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-downsample * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -753,9 +837,9 @@ public function downsample(?array $params = null) /** - * Returns information about whether a particular index exists. + * Check indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists * @group serverless * * @param array{ @@ -798,9 +882,9 @@ public function exists(?array $params = null) /** - * Returns information about whether a particular alias exists. + * Check aliases * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-alias * @group serverless * * @param array{ @@ -846,9 +930,9 @@ public function existsAlias(?array $params = null) /** - * Returns information about whether a particular index template exists. + * Check index templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-index-template * @group serverless * * @param array{ @@ -888,9 +972,9 @@ public function existsIndexTemplate(?array $params = null) /** - * Returns information about whether a particular index template exists. + * Check existence of index templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-template * * @param array{ * name: string|array, // (REQUIRED) The comma separated names of the index templates @@ -929,9 +1013,9 @@ public function existsTemplate(?array $params = null) /** - * Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + * Get the status for a data stream lifecycle * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle * @group serverless * * @param array{ @@ -970,9 +1054,9 @@ public function explainDataLifecycle(?array $params = null) /** - * Returns the field usage stats for each field of an index + * Get field usage stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-field-usage-stats * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -1013,9 +1097,9 @@ public function fieldUsageStats(?array $params = null) /** - * Performs the flush operation on one or more indices. + * Flush data streams or indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-flush * * @param array{ * index?: string|array, // A comma-separated list of index names; use `_all` or empty string for all indices @@ -1058,9 +1142,9 @@ public function flush(?array $params = null) /** - * Performs the force merge operation on one or more indices. + * Force a merge * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge * * @param array{ * index?: string|array, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1105,9 +1189,9 @@ public function forcemerge(?array $params = null) /** - * Returns information about one or more indices. + * Get index information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get * @group serverless * * @param array{ @@ -1152,9 +1236,9 @@ public function get(?array $params = null) /** - * Returns an alias. + * Get aliases * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-alias * @group serverless * * @param array{ @@ -1204,9 +1288,9 @@ public function getAlias(?array $params = null) /** - * Returns the data stream lifecycle of the selected data streams. + * Get data stream lifecycles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle * @group serverless * * @param array{ @@ -1246,9 +1330,9 @@ public function getDataLifecycle(?array $params = null) /** - * Get data stream lifecycle statistics. + * Get data stream lifecycle stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle-stats * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1281,9 +1365,9 @@ public function getDataLifecycleStats(?array $params = null) /** - * Returns data streams. + * Get data streams * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream * @group serverless * * @param array{ @@ -1326,9 +1410,49 @@ public function getDataStream(?array $params = null) /** - * Returns the data stream options of the selected data streams. + * Get data stream mappings + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings + * @group serverless + * + * @param array{ + * name: string, // (REQUIRED) Comma-separated list of data streams or data stream patterns + * master_timeout?: int|string, // Period to wait for a connection to the master node + * 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 getDataStreamMappings(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['name'], $params); + $url = '/_data_stream/' . $this->encode($params['name']) . '/_mappings'; + $method = 'GET'; + + $url = $this->addQueryString($url, $params, ['master_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, ['name'], $request, 'indices.get_data_stream_mappings'); + return $this->client->sendRequest($request); + } + + + /** + * Get data stream options * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-options * @group serverless * * @param array{ @@ -1367,9 +1491,9 @@ public function getDataStreamOptions(?array $params = null) /** - * Gets a data stream's settings + * Get data stream settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-settings * @group serverless * * @param array{ @@ -1407,9 +1531,9 @@ public function getDataStreamSettings(?array $params = null) /** - * Returns mapping for one or more fields. + * Get mapping definitions * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping * * @param array{ * fields: string|array, // (REQUIRED) A comma-separated list of fields @@ -1454,9 +1578,9 @@ public function getFieldMapping(?array $params = null) /** - * Returns an index template. + * Get index templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template * @group serverless * * @param array{ @@ -1499,9 +1623,9 @@ public function getIndexTemplate(?array $params = null) /** - * Returns mappings for one or more indices. + * Get mapping definitions * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping * @group serverless * * @param array{ @@ -1545,9 +1669,49 @@ public function getMapping(?array $params = null) /** - * Returns settings for one or more indices. + * Get the migration reindexing status + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-migration + * @group serverless + * + * @param array{ + * index: string, // (REQUIRED) The index or data stream name + * 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 getMigrateReindexStatus(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['index'], $params); + $url = '/_migration/reindex/' . $this->encode($params['index']) . '/_status'; + $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, ['index'], $request, 'indices.get_migrate_reindex_status'); + return $this->client->sendRequest($request); + } + + + /** + * Get index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings * @group serverless * * @param array{ @@ -1600,9 +1764,9 @@ public function getSettings(?array $params = null) /** - * Returns an index template. + * Get legacy index templates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template * * @param array{ * name?: string|array, // The comma separated names of the index templates @@ -1643,9 +1807,47 @@ public function getTemplate(?array $params = null) /** - * Migrates an alias to a data stream + * Reindex legacy backing indices + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-reindex + * + * @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) The body contains the fields `mode` and `source.index, where the only mode currently supported is `upgrade`, and the `source.index` must be a data stream name. 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 migrateReindex(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); + $url = '/_migration/reindex'; + $method = 'POST'; + + $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, 'indices.migrate_reindex'); + return $this->client->sendRequest($request); + } + + + /** + * Convert an index alias to a data stream * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-to-data-stream * @group serverless * * @param array{ @@ -1684,9 +1886,9 @@ public function migrateToDataStream(?array $params = null) /** - * Modifies a data stream + * Update data streams * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-modify-data-stream * @group serverless * * @param array{ @@ -1723,9 +1925,9 @@ public function modifyDataStream(?array $params = null) /** - * Opens an index. + * Open a closed index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-open * * @param array{ * index: string|array, // (REQUIRED) A comma separated list of indices to open @@ -1767,9 +1969,9 @@ public function open(?array $params = null) /** - * Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + * Promote a data stream * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-promote-data-stream * * @param array{ * name: string, // (REQUIRED) The name of the data stream @@ -1806,9 +2008,9 @@ public function promoteDataStream(?array $params = null) /** - * Creates or updates an alias. + * Create or update an alias * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias * @group serverless * * @param array{ @@ -1850,9 +2052,9 @@ public function putAlias(?array $params = null) /** - * Updates the data stream lifecycle of the selected data streams. + * Update data stream lifecycles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle * @group serverless * * @param array{ @@ -1865,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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The data stream lifecycle configuration that consist of the data retention. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The data stream lifecycle configuration that consist of the data retention. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1878,7 +2080,7 @@ public function putAlias(?array $params = null) public function putDataLifecycle(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['name'], $params); + $this->checkRequiredParameters(['name','body'], $params); $url = '/_data_stream/' . $this->encode($this->convertValue($params['name'])) . '/_lifecycle'; $method = 'PUT'; @@ -1894,9 +2096,53 @@ public function putDataLifecycle(?array $params = null) /** - * Updates the data stream options of the selected data streams. + * Update data stream mappings + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings + * @group serverless + * + * @param array{ + * name: string, // (REQUIRED) Comma-separated list of data streams or data stream patterns + * dry_run?: bool, // Whether this request should only be a dry run rather than actually applying mappings + * timeout?: int|string, // Period to wait for a response + * master_timeout?: int|string, // Period to wait for a connection to the master node + * 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) The data stream mappings to be updated. 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 putDataStreamMappings(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['name','body'], $params); + $url = '/_data_stream/' . $this->encode($params['name']) . '/_mappings'; + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['dry_run','timeout','master_timeout','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, 'indices.put_data_stream_mappings'); + return $this->client->sendRequest($request); + } + + + /** + * Update data stream options * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-options * @group serverless * * @param array{ @@ -1909,7 +2155,7 @@ public function putDataLifecycle(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The data stream options configuration that consist of the failure store configuration. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The data stream options configuration that consist of the failure store configuration. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1922,7 +2168,7 @@ public function putDataLifecycle(?array $params = null) public function putDataStreamOptions(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['name'], $params); + $this->checkRequiredParameters(['name','body'], $params); $url = '/_data_stream/' . $this->encode($this->convertValue($params['name'])) . '/_options'; $method = 'PUT'; @@ -1938,9 +2184,9 @@ public function putDataStreamOptions(?array $params = null) /** - * Updates a data stream's settings + * Update data stream settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-settings * @group serverless * * @param array{ @@ -1973,6 +2219,7 @@ public function putDataStreamSettings(?array $params = null) $url = $this->addQueryString($url, $params, ['dry_run','timeout','master_timeout','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, 'indices.put_data_stream_settings'); @@ -1981,9 +2228,9 @@ public function putDataStreamSettings(?array $params = null) /** - * Creates or updates an index template. + * Create or update an index template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template * @group serverless * * @param array{ @@ -2025,9 +2272,9 @@ public function putIndexTemplate(?array $params = null) /** - * Updates the index mappings. + * Update field mappings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping * @group serverless * * @param array{ @@ -2072,9 +2319,9 @@ public function putMapping(?array $params = null) /** - * Updates the index settings. + * Update index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings * @group serverless * * @param array{ @@ -2124,9 +2371,9 @@ public function putSettings(?array $params = null) /** - * Creates or updates an index template. + * Create or update a legacy index template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template * * @param array{ * name: string, // (REQUIRED) The name of the template @@ -2168,9 +2415,9 @@ public function putTemplate(?array $params = null) /** - * Returns information about ongoing index shard recoveries. + * Get index recovery information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-recovery * * @param array{ * index?: string|array, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -2213,9 +2460,9 @@ public function recovery(?array $params = null) /** - * Performs the refresh operation in one or more indices. + * Refresh an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh * @group serverless * * @param array{ @@ -2257,9 +2504,9 @@ public function refresh(?array $params = null) /** - * Reloads an index's search analyzers and their resources. + * Reload search analyzers * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-reload-search-analyzers * * @param array{ * index: string|array, // (REQUIRED) A comma-separated list of index names to reload analyzers for @@ -2299,9 +2546,9 @@ public function reloadSearchAnalyzers(?array $params = null) /** - * Removes a block from an index. + * Remove an index block * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block * @group serverless * * @param array{ @@ -2344,9 +2591,9 @@ public function removeBlock(?array $params = null) /** - * Resolves the specified index expressions to return information about each cluster. If no index expression is provided, this endpoint will return information about all the remote clusters that are configured on the local cluster. + * Resolve the cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-cluster * * @param array{ * name?: string|array, // A comma-separated list of cluster:index names or wildcard expressions @@ -2389,9 +2636,9 @@ public function resolveCluster(?array $params = null) /** - * Returns information about any matching indices, aliases, and data streams + * Resolve indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-index * @group serverless * * @param array{ @@ -2399,6 +2646,8 @@ public function resolveCluster(?array $params = null) * expand_wildcards?: string, // Whether wildcard expressions should get expanded to open or closed indices (default: open) * ignore_unavailable?: bool, // Whether specified concrete indices should be ignored when unavailable (missing or closed) * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * mode?: string, // Filter indices by index mode. Comma-separated list of IndexMode. Empty means no filter. + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -2420,7 +2669,7 @@ public function resolveIndex(?array $params = null) $url = '/_resolve/index/' . $this->encode($this->convertValue($params['name'])); $method = 'GET'; - $url = $this->addQueryString($url, $params, ['expand_wildcards','ignore_unavailable','allow_no_indices','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['expand_wildcards','ignore_unavailable','allow_no_indices','mode','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; @@ -2431,10 +2680,9 @@ public function resolveIndex(?array $params = null) /** - * Updates an alias to point to a new index when the existing index - * is considered to be too large or too old. + * Roll over to a new index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-rollover * @group serverless * * @param array{ @@ -2483,9 +2731,9 @@ public function rollover(?array $params = null) /** - * Provides low-level information about segments in a Lucene index. + * Get index segments * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-segments * * @param array{ * index?: string|array, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -2526,9 +2774,9 @@ public function segments(?array $params = null) /** - * Provides store information for shard copies of indices. + * Get index shard stores * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shard-stores * * @param array{ * index?: string|array, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -2570,9 +2818,9 @@ public function shardStores(?array $params = null) /** - * Allow to shrink an existing index into a new index with fewer primary shards. + * Shrink an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shrink * * @param array{ * index: string, // (REQUIRED) The name of the source index to shrink @@ -2585,7 +2833,7 @@ public function shardStores(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The configuration for the target index (`settings` and `aliases`). If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The configuration for the target index (`settings` and `aliases`). If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -2598,7 +2846,7 @@ public function shardStores(?array $params = null) public function shrink(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index','target'], $params); + $this->checkRequiredParameters(['index','target','body'], $params); $url = '/' . $this->encode($params['index']) . '/_shrink/' . $this->encode($params['target']); $method = 'PUT'; @@ -2614,9 +2862,9 @@ public function shrink(?array $params = null) /** - * Simulate matching the given index name against the index templates in the system + * Simulate an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-index-template * @group serverless * * @param array{ @@ -2659,9 +2907,9 @@ public function simulateIndexTemplate(?array $params = null) /** - * Simulate resolving the given template name or body + * Simulate an index template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-template * @group serverless * * @param array{ @@ -2706,9 +2954,9 @@ public function simulateTemplate(?array $params = null) /** - * Allows you to split an existing index into a new index with more primary shards. + * Split an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-split * * @param array{ * index: string, // (REQUIRED) The name of the source index to split @@ -2721,7 +2969,7 @@ public function simulateTemplate(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The configuration for the target index (`settings` and `aliases`). If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The configuration for the target index (`settings` and `aliases`). If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -2734,7 +2982,7 @@ public function simulateTemplate(?array $params = null) public function split(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index','target'], $params); + $this->checkRequiredParameters(['index','target','body'], $params); $url = '/' . $this->encode($params['index']) . '/_split/' . $this->encode($params['target']); $method = 'PUT'; @@ -2750,9 +2998,9 @@ public function split(?array $params = null) /** - * Provides statistics on operations happening in an index. + * Get index statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-stats * * @param array{ * metric?: string|array, // Limit the information returned the specific metrics. @@ -2806,9 +3054,9 @@ public function stats(?array $params = null) /** - * Updates index aliases. + * Create or update an alias * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-update-aliases * @group serverless * * @param array{ @@ -2847,9 +3095,9 @@ public function updateAliases(?array $params = null) /** - * Allows a user to validate a potentially expensive query without executing it. + * Validate a query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-validate-query * @group serverless * * @param array{ diff --git a/src/Endpoints/Inference.php b/src/Endpoints/Inference.php index 0f677874c..e94f6feaf 100644 --- a/src/Endpoints/Inference.php +++ b/src/Endpoints/Inference.php @@ -31,17 +31,18 @@ class Inference extends AbstractEndpoint /** * Perform chat completion inference * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/chat-completion-inference.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -54,11 +55,11 @@ class Inference extends AbstractEndpoint public function chatCompletionUnified(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/chat_completion/' . $this->encode($params['inference_id']) . '/_stream'; $method = 'POST'; - $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' => 'text/event-stream', 'Content-Type' => 'application/json', @@ -70,19 +71,20 @@ public function chatCompletionUnified(?array $params = null) /** - * Perform completion inference + * Perform completion inference on the service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -95,11 +97,11 @@ public function chatCompletionUnified(?array $params = null) public function completion(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/completion/' . $this->encode($params['inference_id']); $method = 'POST'; - $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', @@ -113,7 +115,7 @@ public function completion(?array $params = null) /** * Delete an inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete * @group serverless * * @param array{ @@ -159,7 +161,7 @@ public function delete(?array $params = null) /** * Get an inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get * @group serverless * * @param array{ @@ -202,20 +204,21 @@ public function get(?array $params = null) /** - * Perform inference + * Perform inference on the service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id * task_type?: string, // The task type + * timeout?: int|string, // The amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -228,7 +231,7 @@ public function get(?array $params = null) public function inference(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); if (isset($params['task_type'])) { $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); $method = 'POST'; @@ -236,7 +239,7 @@ public function inference(?array $params = null) $url = '/_inference/' . $this->encode($params['inference_id']); $method = 'POST'; } - $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', @@ -248,20 +251,21 @@ public function inference(?array $params = null) /** - * Configure an inference endpoint for use in the Inference API + * Create an inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put * @group serverless * * @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. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -274,7 +278,7 @@ public function inference(?array $params = null) public function put(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); if (isset($params['task_type'])) { $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']); $method = 'PUT'; @@ -282,7 +286,7 @@ public function put(?array $params = null) $url = '/_inference/' . $this->encode($params['inference_id']); $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', @@ -294,20 +298,64 @@ public function put(?array $params = null) /** - * Configure an AlibabaCloud AI Search inference endpoint + * Create a AI21 inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-alibabacloud-ai-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-ai21 + * @group serverless + * + * @param array{ + * task_type: string, // (REQUIRED) The task type + * ai21_inference_id: string, // (REQUIRED) The inference ID + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. + * 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) The inference endpoint's task and service settings. 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 putAi21(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['task_type','ai21_inference_id','body'], $params); + $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['ai21_inference_id']); + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['timeout','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, ['task_type', 'ai21_inference_id'], $request, 'inference.put_ai21'); + return $this->client->sendRequest($request); + } + + + /** + * Create an AlibabaCloud AI Search inference endpoint + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-alibabacloud * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * alibabacloud_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -320,11 +368,11 @@ public function put(?array $params = null) public function putAlibabacloud(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','alibabacloud_inference_id'], $params); + $this->checkRequiredParameters(['task_type','alibabacloud_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['alibabacloud_inference_id']); $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', @@ -336,20 +384,21 @@ public function putAlibabacloud(?array $params = null) /** - * Configure an Amazon Bedrock inference endpoint + * Create an Amazon Bedrock inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-bedrock.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonbedrock * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * amazonbedrock_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -362,11 +411,11 @@ public function putAlibabacloud(?array $params = null) public function putAmazonbedrock(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','amazonbedrock_inference_id'], $params); + $this->checkRequiredParameters(['task_type','amazonbedrock_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['amazonbedrock_inference_id']); $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', @@ -378,20 +427,21 @@ public function putAmazonbedrock(?array $params = null) /** - * Configure a Amazon SageMaker inference endpoint + * Create an Amazon SageMaker inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-amazon-sagemaker.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * amazonsagemaker_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -404,11 +454,11 @@ public function putAmazonbedrock(?array $params = null) public function putAmazonsagemaker(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','amazonsagemaker_inference_id'], $params); + $this->checkRequiredParameters(['task_type','amazonsagemaker_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['amazonsagemaker_inference_id']); $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', @@ -420,20 +470,21 @@ public function putAmazonsagemaker(?array $params = null) /** - * Configure an Anthropic inference endpoint + * Create an Anthropic inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-anthropic.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * anthropic_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -446,11 +497,11 @@ public function putAmazonsagemaker(?array $params = null) public function putAnthropic(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','anthropic_inference_id'], $params); + $this->checkRequiredParameters(['task_type','anthropic_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['anthropic_inference_id']); $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', @@ -462,20 +513,21 @@ public function putAnthropic(?array $params = null) /** - * Configure an Azure AI Studio inference endpoint + * Create an Azure AI studio inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-azure-ai-studio.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * azureaistudio_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -488,11 +540,11 @@ public function putAnthropic(?array $params = null) public function putAzureaistudio(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','azureaistudio_inference_id'], $params); + $this->checkRequiredParameters(['task_type','azureaistudio_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['azureaistudio_inference_id']); $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', @@ -504,20 +556,21 @@ public function putAzureaistudio(?array $params = null) /** - * Configure an Azure OpenAI inference endpoint + * Create an Azure OpenAI inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-azure-openai.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * azureopenai_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -530,11 +583,11 @@ public function putAzureaistudio(?array $params = null) public function putAzureopenai(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','azureopenai_inference_id'], $params); + $this->checkRequiredParameters(['task_type','azureopenai_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['azureopenai_inference_id']); $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', @@ -546,20 +599,21 @@ public function putAzureopenai(?array $params = null) /** - * Configure a Cohere inference endpoint + * Create a Cohere inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-cohere.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * cohere_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -572,11 +626,11 @@ public function putAzureopenai(?array $params = null) public function putCohere(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','cohere_inference_id'], $params); + $this->checkRequiredParameters(['task_type','cohere_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['cohere_inference_id']); $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', @@ -588,7 +642,50 @@ public function putCohere(?array $params = null) /** - * Configure a custom inference endpoint + * Create an Contextual AI inference endpoint + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-contextualai + * @group serverless + * + * @param array{ + * task_type: string, // (REQUIRED) The task type + * contextualai_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. + * 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) The inference endpoint's task and service settings. 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 putContextualai(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['task_type','contextualai_inference_id','body'], $params); + $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['contextualai_inference_id']); + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['timeout','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, ['task_type', 'contextualai_inference_id'], $request, 'inference.put_contextualai'); + return $this->client->sendRequest($request); + } + + + /** + * Create a custom inference endpoint * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom * @group serverless @@ -601,7 +698,7 @@ public function putCohere(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -614,7 +711,7 @@ public function putCohere(?array $params = null) public function putCustom(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','custom_inference_id'], $params); + $this->checkRequiredParameters(['task_type','custom_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['custom_inference_id']); $method = 'PUT'; @@ -630,20 +727,21 @@ public function putCustom(?array $params = null) /** - * Configure a DeepSeek inference endpoint + * Create a DeepSeek inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-deepseek.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * deepseek_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -656,11 +754,11 @@ public function putCustom(?array $params = null) public function putDeepseek(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','deepseek_inference_id'], $params); + $this->checkRequiredParameters(['task_type','deepseek_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['deepseek_inference_id']); $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', @@ -672,20 +770,21 @@ public function putDeepseek(?array $params = null) /** - * Configure an Elasticsearch inference endpoint + * Create an Elasticsearch inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-elasticsearch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * elasticsearch_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -698,11 +797,11 @@ public function putDeepseek(?array $params = null) public function putElasticsearch(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','elasticsearch_inference_id'], $params); + $this->checkRequiredParameters(['task_type','elasticsearch_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['elasticsearch_inference_id']); $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', @@ -714,20 +813,21 @@ public function putElasticsearch(?array $params = null) /** - * Configure an ELSER inference endpoint + * Create an ELSER inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-elser.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elser * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * elser_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -740,11 +840,11 @@ public function putElasticsearch(?array $params = null) public function putElser(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','elser_inference_id'], $params); + $this->checkRequiredParameters(['task_type','elser_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['elser_inference_id']); $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', @@ -756,20 +856,21 @@ public function putElser(?array $params = null) /** - * Configure a Google AI Studio inference endpoint + * Create an Google AI Studio inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-google-ai-studio.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googleaistudio * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * googleaistudio_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -782,11 +883,11 @@ public function putElser(?array $params = null) public function putGoogleaistudio(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','googleaistudio_inference_id'], $params); + $this->checkRequiredParameters(['task_type','googleaistudio_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['googleaistudio_inference_id']); $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', @@ -798,20 +899,21 @@ public function putGoogleaistudio(?array $params = null) /** - * Configure a Google Vertex AI inference endpoint + * Create a Google Vertex AI inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-google-vertex-ai.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googlevertexai * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * googlevertexai_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -824,11 +926,11 @@ public function putGoogleaistudio(?array $params = null) public function putGooglevertexai(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','googlevertexai_inference_id'], $params); + $this->checkRequiredParameters(['task_type','googlevertexai_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['googlevertexai_inference_id']); $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', @@ -840,20 +942,21 @@ public function putGooglevertexai(?array $params = null) /** - * Configure a HuggingFace inference endpoint + * Create a Hugging Face inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-hugging-face.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-hugging-face * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * huggingface_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -866,11 +969,11 @@ public function putGooglevertexai(?array $params = null) public function putHuggingFace(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','huggingface_inference_id'], $params); + $this->checkRequiredParameters(['task_type','huggingface_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['huggingface_inference_id']); $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', @@ -882,20 +985,21 @@ public function putHuggingFace(?array $params = null) /** - * Configure a JinaAI inference endpoint + * Create an JinaAI inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-jinaai.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-jinaai * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * jinaai_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -908,11 +1012,11 @@ public function putHuggingFace(?array $params = null) public function putJinaai(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','jinaai_inference_id'], $params); + $this->checkRequiredParameters(['task_type','jinaai_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['jinaai_inference_id']); $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', @@ -924,20 +1028,64 @@ public function putJinaai(?array $params = null) /** - * Configure a Mistral inference endpoint + * Create a Llama inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-mistral.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-llama + * @group serverless + * + * @param array{ + * task_type: string, // (REQUIRED) The task type + * llama_inference_id: string, // (REQUIRED) The inference ID + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. + * 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) The inference endpoint's task and service settings. 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 putLlama(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['task_type','llama_inference_id','body'], $params); + $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['llama_inference_id']); + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['timeout','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, ['task_type', 'llama_inference_id'], $request, 'inference.put_llama'); + return $this->client->sendRequest($request); + } + + + /** + * Create a Mistral inference endpoint + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-mistral * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * mistral_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -950,11 +1098,11 @@ public function putJinaai(?array $params = null) public function putMistral(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','mistral_inference_id'], $params); + $this->checkRequiredParameters(['task_type','mistral_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['mistral_inference_id']); $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', @@ -966,20 +1114,21 @@ public function putMistral(?array $params = null) /** - * Configure an OpenAI inference endpoint + * Create an OpenAI inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-openai.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-openai * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * openai_inference_id: string, // (REQUIRED) The inference ID + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -992,11 +1141,11 @@ public function putMistral(?array $params = null) public function putOpenai(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','openai_inference_id'], $params); + $this->checkRequiredParameters(['task_type','openai_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['openai_inference_id']); $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', @@ -1008,20 +1157,21 @@ public function putOpenai(?array $params = null) /** - * Configure a VoyageAI inference endpoint + * Create a VoyageAI inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-voyageai * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * voyageai_inference_id: string, // (REQUIRED) The inference ID + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1034,11 +1184,11 @@ public function putOpenai(?array $params = null) public function putVoyageai(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','voyageai_inference_id'], $params); + $this->checkRequiredParameters(['task_type','voyageai_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['voyageai_inference_id']); $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', @@ -1050,20 +1200,21 @@ public function putVoyageai(?array $params = null) /** - * Configure a Watsonx inference endpoint + * Create a Watsonx inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-watsonx-ai.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-watsonx * @group serverless * * @param array{ * task_type: string, // (REQUIRED) The task type * watsonx_inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. * 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, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1076,11 +1227,11 @@ public function putVoyageai(?array $params = null) public function putWatsonx(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['task_type','watsonx_inference_id'], $params); + $this->checkRequiredParameters(['task_type','watsonx_inference_id','body'], $params); $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['watsonx_inference_id']); $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', @@ -1092,19 +1243,20 @@ public function putWatsonx(?array $params = null) /** - * Perform reranking inference + * Perform reranking inference on the service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // The amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1117,11 +1269,11 @@ public function putWatsonx(?array $params = null) public function rerank(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/rerank/' . $this->encode($params['inference_id']); $method = 'POST'; - $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', @@ -1133,19 +1285,20 @@ public function rerank(?array $params = null) /** - * Perform sparse embedding inference + * Perform sparse embedding inference on the service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1158,11 +1311,11 @@ public function rerank(?array $params = null) public function sparseEmbedding(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/sparse_embedding/' . $this->encode($params['inference_id']); $method = 'POST'; - $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', @@ -1174,18 +1327,19 @@ public function sparseEmbedding(?array $params = null) /** - * Perform streaming completion inference + * Perform streaming inference * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-stream-inference * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // The amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1198,11 +1352,11 @@ public function sparseEmbedding(?array $params = null) public function streamCompletion(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/completion/' . $this->encode($params['inference_id']) . '/_stream'; $method = 'POST'; - $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' => 'text/event-stream', 'Content-Type' => 'application/json', @@ -1214,19 +1368,20 @@ public function streamCompletion(?array $params = null) /** - * Perform text embedding inference + * Perform text embedding inference on the service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference * @group serverless * * @param array{ * inference_id: string, // (REQUIRED) The inference Id + * timeout?: int|string, // Specifies the amount of time to wait for the inference request to complete. * 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, // The inference payload. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference payload. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1239,11 +1394,11 @@ public function streamCompletion(?array $params = null) public function textEmbedding(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); $url = '/_inference/text_embedding/' . $this->encode($params['inference_id']); $method = 'POST'; - $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', @@ -1255,9 +1410,9 @@ public function textEmbedding(?array $params = null) /** - * Update inference + * Update an inference endpoint * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-inference-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-update * * @param array{ * inference_id: string, // (REQUIRED) The inference Id @@ -1267,7 +1422,7 @@ public function textEmbedding(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The inference endpoint's task and service settings. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The inference endpoint's task and service settings. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1280,7 +1435,7 @@ public function textEmbedding(?array $params = null) public function update(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['inference_id'], $params); + $this->checkRequiredParameters(['inference_id','body'], $params); if (isset($params['task_type'])) { $url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']) . '/_update'; $method = 'PUT'; diff --git a/src/Endpoints/Ingest.php b/src/Endpoints/Ingest.php index 3feb3dfad..8676500ec 100644 --- a/src/Endpoints/Ingest.php +++ b/src/Endpoints/Ingest.php @@ -29,9 +29,9 @@ class Ingest extends AbstractEndpoint { /** - * Deletes a geoip database configuration + * Delete GeoIP database configurations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-geoip-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-geoip-database * * @param array{ * id: string|array, // (REQUIRED) A comma-separated list of geoip database configurations to delete @@ -69,9 +69,9 @@ public function deleteGeoipDatabase(?array $params = null) /** - * Deletes an ip location database configuration + * Delete IP geolocation database configurations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-ip-location-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-ip-location-database * * @param array{ * id: string|array, // (REQUIRED) A comma-separated list of ip location database configurations to delete @@ -109,9 +109,9 @@ public function deleteIpLocationDatabase(?array $params = null) /** - * Deletes a pipeline. + * Delete pipelines * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-pipeline * @group serverless * * @param array{ @@ -150,9 +150,9 @@ public function deletePipeline(?array $params = null) /** - * Returns statistical information about geoip databases + * Get GeoIP statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html + * @link https://www.elastic.co/docs/reference/enrich-processor/geoip-processor * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -185,9 +185,9 @@ public function geoIpStats(?array $params = null) /** - * Returns geoip database configuration. + * Get GeoIP database configurations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-geoip-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-geoip-database * * @param array{ * id?: string|array, // A comma-separated list of geoip database configurations to get; use `*` to get all geoip database configurations @@ -225,9 +225,9 @@ public function getGeoipDatabase(?array $params = null) /** - * Returns the specified ip location database configuration + * Get IP geolocation database configurations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ip-location-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-ip-location-database * * @param array{ * id?: string|array, // A comma-separated list of ip location database configurations to get; use `*` to get all ip location database configurations @@ -265,9 +265,9 @@ public function getIpLocationDatabase(?array $params = null) /** - * Returns a pipeline. + * Get pipelines * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-pipeline * @group serverless * * @param array{ @@ -308,9 +308,9 @@ public function getPipeline(?array $params = null) /** - * Returns a list of the built-in patterns. + * Run a grok processor * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get + * @link https://www.elastic.co/docs/reference/enrich-processor/grok-processor * @group serverless * * @param array{ @@ -344,9 +344,9 @@ public function processorGrok(?array $params = null) /** - * Puts the configuration for a geoip database to be downloaded + * Create or update a GeoIP database configuration * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-geoip-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-geoip-database * * @param array{ * id: string, // (REQUIRED) The id of the database configuration @@ -386,9 +386,9 @@ public function putGeoipDatabase(?array $params = null) /** - * Puts the configuration for a ip location database to be downloaded + * Create or update an IP geolocation database configuration * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-ip-location-database-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-ip-location-database * * @param array{ * id: string, // (REQUIRED) The id of the database configuration @@ -428,9 +428,9 @@ public function putIpLocationDatabase(?array $params = null) /** - * Creates or updates a pipeline. + * Create or update a pipeline * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html + * @link https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines * @group serverless * * @param array{ @@ -472,9 +472,9 @@ public function putPipeline(?array $params = null) /** - * Allows to simulate a pipeline with example documents. + * Simulate a pipeline * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-simulate * @group serverless * * @param array{ diff --git a/src/Endpoints/License.php b/src/Endpoints/License.php index 2a96d87a3..b18a0b8ed 100644 --- a/src/Endpoints/License.php +++ b/src/Endpoints/License.php @@ -29,9 +29,9 @@ class License extends AbstractEndpoint { /** - * Deletes licensing information for the cluster + * Delete the license * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-delete * * @param array{ * master_timeout?: int|string, // Timeout for processing on master node @@ -66,9 +66,9 @@ public function delete(?array $params = null) /** - * Retrieves licensing information for the cluster + * Get license information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get * @group serverless * * @param array{ @@ -104,9 +104,9 @@ public function get(?array $params = null) /** - * Retrieves information about the status of the basic license. + * Get the basic license status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-basic-status * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -139,9 +139,9 @@ public function getBasicStatus(?array $params = null) /** - * Retrieves information about the status of the trial license. + * Get the trial status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-trial-status * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -174,9 +174,9 @@ public function getTrialStatus(?array $params = null) /** - * Updates the license for the cluster. + * Update the license * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post * * @param array{ * acknowledge?: bool, // whether the user has acknowledged acknowledge messages (default: false) @@ -214,9 +214,9 @@ public function post(?array $params = null) /** - * Starts an indefinite basic license. + * Start a basic license * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-basic * * @param array{ * acknowledge?: bool, // whether the user has acknowledged acknowledge messages (default: false) @@ -252,9 +252,9 @@ public function postStartBasic(?array $params = null) /** - * starts a limited time trial license. + * Start a trial * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-trial * * @param array{ * type?: string, // The type of trial license to generate (default: "trial") diff --git a/src/Endpoints/Logstash.php b/src/Endpoints/Logstash.php index 3e94e6fff..1f2b9b71e 100644 --- a/src/Endpoints/Logstash.php +++ b/src/Endpoints/Logstash.php @@ -29,9 +29,9 @@ class Logstash extends AbstractEndpoint { /** - * Deletes Logstash Pipelines used by Central Management + * Delete a Logstash pipeline * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-delete-pipeline * @group serverless * * @param array{ @@ -68,9 +68,9 @@ public function deletePipeline(?array $params = null) /** - * Retrieves Logstash Pipelines used by Central Management + * Get Logstash pipelines * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-get-pipeline * @group serverless * * @param array{ @@ -109,9 +109,9 @@ public function getPipeline(?array $params = null) /** - * Adds and updates Logstash Pipelines used for Central Management + * Create or update a Logstash pipeline * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-put-pipeline * @group serverless * * @param array{ diff --git a/src/Endpoints/Migration.php b/src/Endpoints/Migration.php index 7e628f3e0..313b1aa68 100644 --- a/src/Endpoints/Migration.php +++ b/src/Endpoints/Migration.php @@ -29,9 +29,9 @@ class Migration extends AbstractEndpoint { /** - * Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. + * Get deprecation information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-deprecations * * @param array{ * index?: string, // Index pattern @@ -69,9 +69,9 @@ public function deprecations(?array $params = null) /** - * Find out whether system features need to be upgraded or not + * Get feature migration information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -104,9 +104,9 @@ public function getFeatureUpgradeStatus(?array $params = null) /** - * Begin upgrades for system features + * Start the feature migration * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) diff --git a/src/Endpoints/Ml.php b/src/Endpoints/Ml.php index 2d70f8dd0..f68ca336a 100644 --- a/src/Endpoints/Ml.php +++ b/src/Endpoints/Ml.php @@ -29,9 +29,9 @@ class Ml extends AbstractEndpoint { /** - * Clear the cached results from a trained model deployment + * Clear trained model deployment cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-clear-trained-model-deployment-cache * * @param array{ * model_id: string, // (REQUIRED) The unique identifier of the trained model. @@ -68,9 +68,9 @@ public function clearTrainedModelDeploymentCache(?array $params = null) /** - * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + * Close anomaly detection jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-close-job * @group serverless * * @param array{ @@ -112,9 +112,9 @@ public function closeJob(?array $params = null) /** - * Deletes a calendar. + * Delete a calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar * @group serverless * * @param array{ @@ -151,9 +151,9 @@ public function deleteCalendar(?array $params = null) /** - * Deletes scheduled events from a calendar. + * Delete events from a calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-event * @group serverless * * @param array{ @@ -191,9 +191,9 @@ public function deleteCalendarEvent(?array $params = null) /** - * Deletes anomaly detection jobs from a calendar. + * Delete anomaly jobs from a calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-job * @group serverless * * @param array{ @@ -231,9 +231,9 @@ public function deleteCalendarJob(?array $params = null) /** - * Deletes an existing data frame analytics job. + * Delete a data frame analytics job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-data-frame-analytics * @group serverless * * @param array{ @@ -272,9 +272,9 @@ public function deleteDataFrameAnalytics(?array $params = null) /** - * Deletes an existing datafeed. + * Delete a datafeed * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-datafeed * @group serverless * * @param array{ @@ -312,9 +312,9 @@ public function deleteDatafeed(?array $params = null) /** - * Deletes expired and unused machine learning data. + * Delete expired ML data * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-expired-data * * @param array{ * job_id?: string, // The ID of the job(s) to perform expired data hygiene for @@ -356,9 +356,9 @@ public function deleteExpiredData(?array $params = null) /** - * Deletes a filter. + * Delete a filter * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-filter * @group serverless * * @param array{ @@ -395,9 +395,9 @@ public function deleteFilter(?array $params = null) /** - * Deletes forecasts from a machine learning job. + * Delete forecasts from a job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-forecast * * @param array{ * job_id: string, // (REQUIRED) The ID of the job from which to delete forecasts @@ -440,9 +440,9 @@ public function deleteForecast(?array $params = null) /** - * Deletes an existing anomaly detection job. + * Delete an anomaly detection job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-job * @group serverless * * @param array{ @@ -482,9 +482,9 @@ public function deleteJob(?array $params = null) /** - * Deletes an existing model snapshot. + * Delete a model snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-model-snapshot * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to fetch @@ -521,9 +521,9 @@ public function deleteModelSnapshot(?array $params = null) /** - * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + * Delete an unreferenced trained model * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model * @group serverless * * @param array{ @@ -562,9 +562,9 @@ public function deleteTrainedModel(?array $params = null) /** - * Deletes a model alias that refers to the trained model + * Delete a trained model alias * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model-alias * @group serverless * * @param array{ @@ -603,9 +603,9 @@ public function deleteTrainedModelAlias(?array $params = null) /** - * Estimates the model memory + * Estimate job model memory usage * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-estimate-model-memory * @group serverless * * @param array{ @@ -642,9 +642,9 @@ public function estimateModelMemory(?array $params = null) /** - * Evaluates the data frame analytics for an annotated index. + * Evaluate data frame analytics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-evaluate-data-frame * @group serverless * * @param array{ @@ -681,9 +681,9 @@ public function evaluateDataFrame(?array $params = null) /** - * Explains a data frame analytics config. + * Explain data frame analytics config * - * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-explain-data-frame-analytics * * @param array{ * id?: string, // The ID of the data frame analytics to explain @@ -723,9 +723,9 @@ public function explainDataFrameAnalytics(?array $params = null) /** - * Forces any buffered data to be processed by the job. + * Force buffered data to be processed * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-flush-job * @group serverless * * @param array{ @@ -769,9 +769,9 @@ public function flushJob(?array $params = null) /** - * Predicts the future behavior of a time series by using its historical behavior. + * Predict future behavior of a time series * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-forecast * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to forecast for @@ -812,9 +812,9 @@ public function forecast(?array $params = null) /** - * Retrieves anomaly detection job results for one or more buckets. + * Get anomaly detection job results for buckets * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-buckets * * @param array{ * job_id: string, // (REQUIRED) ID of the job to get bucket results from @@ -866,9 +866,9 @@ public function getBuckets(?array $params = null) /** - * Retrieves information about the scheduled events in calendars. + * Get info about events in calendars * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendar-events * @group serverless * * @param array{ @@ -910,9 +910,9 @@ public function getCalendarEvents(?array $params = null) /** - * Retrieves configuration information for calendars. + * Get calendar configuration info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendars * @group serverless * * @param array{ @@ -955,9 +955,9 @@ public function getCalendars(?array $params = null) /** - * Retrieves anomaly detection job results for one or more categories. + * Get anomaly detection job results for categories * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-categories * * @param array{ * job_id: string, // (REQUIRED) The name of the job @@ -1003,9 +1003,9 @@ public function getCategories(?array $params = null) /** - * Retrieves configuration information for data frame analytics jobs. + * Get data frame analytics job configuration info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics * @group serverless * * @param array{ @@ -1048,9 +1048,9 @@ public function getDataFrameAnalytics(?array $params = null) /** - * Retrieves usage information for data frame analytics jobs. + * Get data frame analytics job stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics-stats * @group serverless * * @param array{ @@ -1093,9 +1093,9 @@ public function getDataFrameAnalyticsStats(?array $params = null) /** - * Retrieves usage information for datafeeds. + * Get datafeed stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeed-stats * @group serverless * * @param array{ @@ -1135,9 +1135,9 @@ public function getDatafeedStats(?array $params = null) /** - * Retrieves configuration information for datafeeds. + * Get datafeeds configuration info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeeds * @group serverless * * @param array{ @@ -1178,9 +1178,9 @@ public function getDatafeeds(?array $params = null) /** - * Retrieves filters. + * Get filters * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-filters * @group serverless * * @param array{ @@ -1221,9 +1221,9 @@ public function getFilters(?array $params = null) /** - * Retrieves anomaly detection job results for one or more influencers. + * Get anomaly detection job results for influencers * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-influencers * * @param array{ * job_id: string, // (REQUIRED) Identifier for the anomaly detection job @@ -1269,9 +1269,9 @@ public function getInfluencers(?array $params = null) /** - * Retrieves usage information for anomaly detection jobs. + * Get anomaly detection job stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-job-stats * @group serverless * * @param array{ @@ -1311,9 +1311,9 @@ public function getJobStats(?array $params = null) /** - * Retrieves configuration information for anomaly detection jobs. + * Get anomaly detection jobs configuration info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-jobs * @group serverless * * @param array{ @@ -1354,9 +1354,9 @@ public function getJobs(?array $params = null) /** - * Returns information on how ML is using memory. + * Get machine learning memory usage info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-memory-stats * * @param array{ * node_id?: string, // Specifies the node or nodes to retrieve stats for. @@ -1396,9 +1396,9 @@ public function getMemoryStats(?array $params = null) /** - * Gets stats for anomaly detection job model snapshot upgrades that are in progress. + * Get anomaly detection job model snapshot upgrade usage info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshot-upgrade-stats * * @param array{ * job_id: string, // (REQUIRED) The ID of the job. May be a wildcard, comma separated list or `_all`. @@ -1436,9 +1436,9 @@ public function getModelSnapshotUpgradeStats(?array $params = null) /** - * Retrieves information about model snapshots. + * Get model snapshots info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshots * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to fetch @@ -1487,9 +1487,9 @@ public function getModelSnapshots(?array $params = null) /** - * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + * Get overall bucket results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-overall-buckets * @group serverless * * @param array{ @@ -1535,9 +1535,9 @@ public function getOverallBuckets(?array $params = null) /** - * Retrieves anomaly records for an anomaly detection job. + * Get anomaly records for an anomaly detection job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-records * * @param array{ * job_id: string, // (REQUIRED) The ID of the job @@ -1583,15 +1583,15 @@ public function getRecords(?array $params = null) /** - * Retrieves configuration information for a trained inference model. + * Get trained model configuration info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models * @group serverless * * @param array{ * model_id?: string, // The ID of the trained models to fetch * allow_no_match?: bool, // Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) - * include?: string, // A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. + * include?: string, // A comma delimited string of optional fields to include in the responsebody. * decompress_definition?: bool, // Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. * from?: int, // skips a number of trained models * size?: int, // specifies a max number of trained models to get @@ -1631,9 +1631,9 @@ public function getTrainedModels(?array $params = null) /** - * Retrieves usage information for trained inference models. + * Get trained models usage info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models-stats * @group serverless * * @param array{ @@ -1675,9 +1675,9 @@ public function getTrainedModelsStats(?array $params = null) /** - * Evaluate a trained model. + * Evaluate a trained model * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-infer-trained-model * @group serverless * * @param array{ @@ -1717,9 +1717,9 @@ public function inferTrainedModel(?array $params = null) /** - * Returns defaults and limits used by machine learning. + * Get machine learning information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-info * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1752,9 +1752,9 @@ public function info(?array $params = null) /** - * Opens one or more anomaly detection jobs. + * Open anomaly detection jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-open-job * @group serverless * * @param array{ @@ -1793,9 +1793,9 @@ public function openJob(?array $params = null) /** - * Posts scheduled events in a calendar. + * Add scheduled events to the calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-calendar-events * @group serverless * * @param array{ @@ -1834,9 +1834,9 @@ public function postCalendarEvents(?array $params = null) /** - * Sends data to an anomaly detection job for analysis. + * Send data to an anomaly detection job for analysis * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-data * * @param array{ * job_id: string, // (REQUIRED) The name of the job receiving the data @@ -1876,9 +1876,9 @@ public function postData(?array $params = null) /** - * Previews that will be analyzed given a data frame analytics config. + * Preview features used by data frame analytics * - * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-data-frame-analytics * @group serverless * * @param array{ @@ -1919,9 +1919,9 @@ public function previewDataFrameAnalytics(?array $params = null) /** - * Previews a datafeed. + * Preview a datafeed * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-datafeed * @group serverless * * @param array{ @@ -1964,9 +1964,9 @@ public function previewDatafeed(?array $params = null) /** - * Instantiates a calendar. + * Create a calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar * @group serverless * * @param array{ @@ -2005,9 +2005,9 @@ public function putCalendar(?array $params = null) /** - * Adds an anomaly detection job to a calendar. + * Add anomaly detection job to calendar * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar-job * @group serverless * * @param array{ @@ -2045,9 +2045,9 @@ public function putCalendarJob(?array $params = null) /** - * Instantiates a data frame analytics job. + * Create a data frame analytics job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-data-frame-analytics * @group serverless * * @param array{ @@ -2086,9 +2086,9 @@ public function putDataFrameAnalytics(?array $params = null) /** - * Instantiates a datafeed. + * Create a datafeed * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-datafeed * @group serverless * * @param array{ @@ -2131,9 +2131,9 @@ public function putDatafeed(?array $params = null) /** - * Instantiates a filter. + * Create a filter * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-filter * @group serverless * * @param array{ @@ -2172,9 +2172,9 @@ public function putFilter(?array $params = null) /** - * Instantiates an anomaly detection job. + * Create an anomaly detection job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-job * @group serverless * * @param array{ @@ -2217,9 +2217,9 @@ public function putJob(?array $params = null) /** - * Creates an inference trained model. + * Create a trained model * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model * @group serverless * * @param array{ @@ -2260,9 +2260,9 @@ public function putTrainedModel(?array $params = null) /** - * Creates a new model alias (or reassigns an existing one) to refer to the trained model + * Create or update a trained model alias * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-alias * @group serverless * * @param array{ @@ -2302,9 +2302,9 @@ public function putTrainedModelAlias(?array $params = null) /** - * Creates part of a trained model definition + * Create part of a trained model definition * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-definition-part * @group serverless * * @param array{ @@ -2344,9 +2344,9 @@ public function putTrainedModelDefinitionPart(?array $params = null) /** - * Creates a trained model vocabulary + * Create a trained model vocabulary * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-vocabulary * @group serverless * * @param array{ @@ -2385,9 +2385,9 @@ public function putTrainedModelVocabulary(?array $params = null) /** - * Resets an existing anomaly detection job. + * Reset an anomaly detection job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-reset-job * @group serverless * * @param array{ @@ -2426,9 +2426,9 @@ public function resetJob(?array $params = null) /** - * Reverts to a specific snapshot. + * Revert to a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-revert-model-snapshot * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to fetch @@ -2468,9 +2468,9 @@ public function revertModelSnapshot(?array $params = null) /** - * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + * Set upgrade_mode for ML indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-set-upgrade-mode * * @param array{ * enabled?: bool, // Whether to enable upgrade_mode ML setting or not. Defaults to false. @@ -2505,9 +2505,9 @@ public function setUpgradeMode(?array $params = null) /** - * Starts a data frame analytics job. + * Start a data frame analytics job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics * @group serverless * * @param array{ @@ -2547,9 +2547,9 @@ public function startDataFrameAnalytics(?array $params = null) /** - * Starts one or more datafeeds. + * Start datafeeds * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed * @group serverless * * @param array{ @@ -2591,9 +2591,9 @@ public function startDatafeed(?array $params = null) /** - * Start a trained model deployment. + * Start a trained model deployment * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-trained-model-deployment * @group serverless * * @param array{ @@ -2605,7 +2605,7 @@ public function startDatafeed(?array $params = null) * priority?: string, // The deployment priority. * queue_capacity?: int, // Controls how many inference requests are allowed in the queue at a time. * timeout?: int|string, // Controls the amount of time to wait for the model to deploy. - * wait_for?: string, // The allocation status for which to wait + * wait_for?: string, // Specifies the allocation status to wait for before returning. * 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) @@ -2640,9 +2640,9 @@ public function startTrainedModelDeployment(?array $params = null) /** - * Stops one or more data frame analytics jobs. + * Stop data frame analytics jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-data-frame-analytics * @group serverless * * @param array{ @@ -2684,9 +2684,9 @@ public function stopDataFrameAnalytics(?array $params = null) /** - * Stops one or more datafeeds. + * Stop datafeeds * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-datafeed * @group serverless * * @param array{ @@ -2728,9 +2728,9 @@ public function stopDatafeed(?array $params = null) /** - * Stop a trained model deployment. + * Stop a trained model deployment * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment * @group serverless * * @param array{ @@ -2771,9 +2771,9 @@ public function stopTrainedModelDeployment(?array $params = null) /** - * Updates certain properties of a data frame analytics job. + * Update a data frame analytics job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics * @group serverless * * @param array{ @@ -2812,9 +2812,9 @@ public function updateDataFrameAnalytics(?array $params = null) /** - * Updates certain properties of a datafeed. + * Update a datafeed * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-datafeed * @group serverless * * @param array{ @@ -2857,9 +2857,9 @@ public function updateDatafeed(?array $params = null) /** - * Updates the description of a filter, adds items, or removes items. + * Update a filter * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-filter * @group serverless * * @param array{ @@ -2898,9 +2898,9 @@ public function updateFilter(?array $params = null) /** - * Updates certain properties of an anomaly detection job. + * Update an anomaly detection job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-job * @group serverless * * @param array{ @@ -2939,9 +2939,9 @@ public function updateJob(?array $params = null) /** - * Updates certain properties of a snapshot. + * Update a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-model-snapshot * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to fetch @@ -2980,9 +2980,9 @@ public function updateModelSnapshot(?array $params = null) /** - * Updates certain properties of trained model deployment. + * Update a trained model deployment * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-trained-model-deployment * @group serverless * * @param array{ @@ -3022,9 +3022,9 @@ public function updateTrainedModelDeployment(?array $params = null) /** - * Upgrades a given job snapshot to the current major version. + * Upgrade a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-upgrade-job-snapshot * * @param array{ * job_id: string, // (REQUIRED) The ID of the job @@ -3063,7 +3063,7 @@ public function upgradeJobSnapshot(?array $params = null) /** - * Validates an anomaly detection job. + * Validate an anomaly detection job * * @link https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html * @@ -3101,9 +3101,8 @@ public function validate(?array $params = null) /** - * Validates an anomaly detection detector. + * Validate an anomaly detection job * - * @link https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) diff --git a/src/Endpoints/Monitoring.php b/src/Endpoints/Monitoring.php index 25fa3a0e4..7d62aef3e 100644 --- a/src/Endpoints/Monitoring.php +++ b/src/Endpoints/Monitoring.php @@ -29,9 +29,9 @@ class Monitoring extends AbstractEndpoint { /** - * Used by the monitoring features to send monitoring data. + * Send monitoring data * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch * * @param array{ * type?: string, // Default document type for items which don't provide one diff --git a/src/Endpoints/Nodes.php b/src/Endpoints/Nodes.php index 703c46e98..9ae2b8c33 100644 --- a/src/Endpoints/Nodes.php +++ b/src/Endpoints/Nodes.php @@ -29,9 +29,9 @@ class Nodes extends AbstractEndpoint { /** - * Removes the archived repositories metering information present in the cluster. + * Clear the archived repositories metering * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-clear-repositories-metering-archive * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -69,9 +69,9 @@ public function clearRepositoriesMeteringArchive(?array $params = null) /** - * Returns cluster repositories metering information. + * Get cluster repositories metering * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-get-repositories-metering-info * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -108,9 +108,9 @@ public function getRepositoriesMeteringInfo(?array $params = null) /** - * Returns information about hot threads on each node in the cluster. + * Get the hot threads for nodes * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-hot-threads * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes @@ -155,9 +155,9 @@ public function hotThreads(?array $params = null) /** - * Returns information about nodes in the cluster. + * Get node information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-info * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes @@ -204,9 +204,9 @@ public function info(?array $params = null) /** - * Reloads secure settings. + * Reload the keystore on nodes in the cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-reload-secure-settings * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. @@ -247,9 +247,9 @@ public function reloadSecureSettings(?array $params = null) /** - * Returns statistical information about nodes in the cluster. + * Get node statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-stats * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes @@ -310,9 +310,9 @@ public function stats(?array $params = null) /** - * Returns low-level information about REST actions usage on nodes. + * Get feature usage information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-usage * * @param array{ * node_id?: string|array, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes diff --git a/src/Endpoints/Profiling.php b/src/Endpoints/Profiling.php index b7f59985c..5fb068db9 100644 --- a/src/Endpoints/Profiling.php +++ b/src/Endpoints/Profiling.php @@ -29,7 +29,7 @@ class Profiling extends AbstractEndpoint { /** - * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. + * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling * * @link https://www.elastic.co/guide/en/observability/current/universal-profiling.html * @@ -67,7 +67,7 @@ public function flamegraph(?array $params = null) /** - * Extracts raw stacktrace information from Universal Profiling. + * Extracts raw stacktrace information from Universal Profiling * * @link https://www.elastic.co/guide/en/observability/current/universal-profiling.html * @@ -105,7 +105,7 @@ public function stacktraces(?array $params = null) /** - * Returns basic information about the status of Universal Profiling. + * Returns basic information about the status of Universal Profiling * * @link https://www.elastic.co/guide/en/observability/current/universal-profiling.html * @@ -143,7 +143,7 @@ public function status(?array $params = null) /** - * Extracts a list of topN functions from Universal Profiling. + * Extracts a list of topN functions from Universal Profiling * * @link https://www.elastic.co/guide/en/observability/current/universal-profiling.html * diff --git a/src/Endpoints/Project.php b/src/Endpoints/Project.php new file mode 100644 index 000000000..630db6496 --- /dev/null +++ b/src/Endpoints/Project.php @@ -0,0 +1,65 @@ +, // 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 tags(?array $params = null) + { + $params = $params ?? []; + $url = '/_project/tags'; + $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, 'project.tags'); + return $this->client->sendRequest($request); + } +} diff --git a/src/Endpoints/QueryRules.php b/src/Endpoints/QueryRules.php index 16ea174b5..5b733fb38 100644 --- a/src/Endpoints/QueryRules.php +++ b/src/Endpoints/QueryRules.php @@ -29,9 +29,9 @@ class QueryRules extends AbstractEndpoint { /** - * Deletes an individual query rule within a ruleset. + * Delete a query rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-rule * @group serverless * * @param array{ @@ -69,9 +69,9 @@ public function deleteRule(?array $params = null) /** - * Deletes a query ruleset. + * Delete a query ruleset * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-ruleset * @group serverless * * @param array{ @@ -108,9 +108,9 @@ public function deleteRuleset(?array $params = null) /** - * Returns the details about an individual query rule within a ruleset. + * Get a query rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-rule * @group serverless * * @param array{ @@ -148,9 +148,9 @@ public function getRule(?array $params = null) /** - * Returns the details about a query ruleset. + * Get a query ruleset * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-ruleset * @group serverless * * @param array{ @@ -187,9 +187,9 @@ public function getRuleset(?array $params = null) /** - * Lists query rulesets. + * Get all query rulesets * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-list-rulesets * @group serverless * * @param array{ @@ -225,9 +225,9 @@ public function listRulesets(?array $params = null) /** - * Creates or updates a query rule within a ruleset. + * Create or update a query rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-rule * @group serverless * * @param array{ @@ -267,9 +267,9 @@ public function putRule(?array $params = null) /** - * Creates or updates a query ruleset. + * Create or update a query ruleset * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-ruleset * @group serverless * * @param array{ @@ -308,11 +308,10 @@ public function putRuleset(?array $params = null) /** - * Tests a query ruleset to identify the rules that would match input criteria + * Test a query ruleset * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/test-query-ruleset.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-test * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * ruleset_id: string, // (REQUIRED) The unique identifier of the ruleset to test. diff --git a/src/Endpoints/Rollup.php b/src/Endpoints/Rollup.php index 2a11fa511..bf000cb54 100644 --- a/src/Endpoints/Rollup.php +++ b/src/Endpoints/Rollup.php @@ -29,9 +29,9 @@ class Rollup extends AbstractEndpoint { /** - * Deletes an existing rollup job. + * Delete a rollup job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-delete-job * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -68,9 +68,9 @@ public function deleteJob(?array $params = null) /** - * Retrieves the configuration, stats, and status of rollup jobs. + * Get rollup job information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-jobs * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -109,9 +109,9 @@ public function getJobs(?array $params = null) /** - * Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + * Get the rollup job capabilities * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-rollup-caps * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -150,9 +150,9 @@ public function getRollupCaps(?array $params = null) /** - * Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + * Get the rollup index capabilities * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-get-rollup-index-caps * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -189,9 +189,9 @@ public function getRollupIndexCaps(?array $params = null) /** - * Creates a rollup job. + * Create a rollup job * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-put-job * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -230,9 +230,9 @@ public function putJob(?array $params = null) /** - * Enables searching rolled-up data using the standard query DSL. + * Search rolled-up data * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-rollup-search * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -273,9 +273,9 @@ public function rollupSearch(?array $params = null) /** - * Starts an existing, stopped rollup job. + * Start rollup jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-start-job * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -312,9 +312,9 @@ public function startJob(?array $params = null) /** - * Stops an existing, started rollup job. + * Stop rollup jobs * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rollup-stop-job * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ diff --git a/src/Endpoints/SearchApplication.php b/src/Endpoints/SearchApplication.php index 957fbc1c2..4503bf9ac 100644 --- a/src/Endpoints/SearchApplication.php +++ b/src/Endpoints/SearchApplication.php @@ -29,11 +29,10 @@ class SearchApplication extends AbstractEndpoint { /** - * Deletes a search application. + * Delete a search application * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-search-application.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete * @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 search application @@ -69,9 +68,9 @@ public function delete(?array $params = null) /** - * Delete a behavioral analytics collection. + * Delete a behavioral analytics collection * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -109,11 +108,10 @@ public function deleteBehavioralAnalytics(?array $params = null) /** - * Returns the details about a search application. + * Get search application details * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get * @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 search application @@ -149,9 +147,9 @@ public function get(?array $params = null) /** - * Returns the existing behavioral analytics collections. + * Get behavioral analytics collections * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -191,11 +189,10 @@ public function getBehavioralAnalytics(?array $params = null) /** - * Returns the existing search applications. + * Get search applications * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * q?: string, // Query in the Lucene query string syntax @@ -231,9 +228,9 @@ public function list(?array $params = null) /** - * Creates a behavioral analytics event for existing collection. + * Create a behavioral analytics collection event * - * @link http://todo.com/tbd + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-post-behavioral-analytics-event * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -274,11 +271,10 @@ public function postBehavioralAnalyticsEvent(?array $params = null) /** - * Creates or updates a search application. + * Create or update a search application * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put * @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 search application to be created or updated @@ -317,9 +313,9 @@ public function put(?array $params = null) /** - * Creates a behavioral analytics collection. + * Create a behavioral analytics collection * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -357,9 +353,9 @@ public function putBehavioralAnalytics(?array $params = null) /** - * Renders a query for given search application search parameters + * Render a search application query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-render-query.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-render-query * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -398,11 +394,10 @@ public function renderQuery(?array $params = null) /** - * Perform a search against a search application + * Run a search application search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-search * @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 search application to be searched diff --git a/src/Endpoints/SearchableSnapshots.php b/src/Endpoints/SearchableSnapshots.php index 3533353d5..aaa80424a 100644 --- a/src/Endpoints/SearchableSnapshots.php +++ b/src/Endpoints/SearchableSnapshots.php @@ -29,9 +29,9 @@ class SearchableSnapshots extends AbstractEndpoint { /** - * Retrieve node-level cache statistics about searchable snapshots. + * Get cache statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -72,11 +72,11 @@ public function cacheStats(?array $params = null) /** * Clear the cache of searchable snapshots. * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-clear-cache * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ - * index?: string|array, // A comma-separated list of index names + * index?: string|array, // Clear the cache * ignore_unavailable?: bool, // Whether specified concrete indices should be ignored when unavailable (missing or closed) * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -114,9 +114,9 @@ public function clearCache(?array $params = null) /** - * Mount a snapshot as a searchable index. + * Mount a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-mount * * @param array{ * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount @@ -158,9 +158,9 @@ public function mount(?array $params = null) /** - * Retrieve shard-level statistics about searchable snapshots. + * Get searchable snapshot statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-stats * * @param array{ * index?: string|array, // A comma-separated list of index names diff --git a/src/Endpoints/Security.php b/src/Endpoints/Security.php index 555499e83..61a214dd1 100644 --- a/src/Endpoints/Security.php +++ b/src/Endpoints/Security.php @@ -29,9 +29,9 @@ class Security extends AbstractEndpoint { /** - * Creates or updates the user profile on behalf of another user. + * Activate a user profile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-activate-user-profile * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -67,9 +67,9 @@ public function activateUserProfile(?array $params = null) /** - * Enables authentication as a user and retrieve information about the authenticated user. + * Authenticate a user * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-authenticate * @group serverless * * @param array{ @@ -103,9 +103,9 @@ public function authenticate(?array $params = null) /** - * Bulk delete roles in the native realm. + * Bulk delete roles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-delete-role * * @param array{ * refresh?: string, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. @@ -142,9 +142,9 @@ public function bulkDeleteRole(?array $params = null) /** - * Bulk adds and updates roles in the native realm. + * Bulk create or update roles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-put-role * * @param array{ * refresh?: string, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. @@ -181,9 +181,9 @@ public function bulkPutRole(?array $params = null) /** - * Updates the attributes of multiple existing API keys. + * Bulk update API keys * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-update-api-keys * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -219,9 +219,9 @@ public function bulkUpdateApiKeys(?array $params = null) /** - * Changes the passwords of users in the native realm and built-in users. + * Change passwords * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-change-password * * @param array{ * username?: string, // The username of the user to change the password for @@ -263,9 +263,9 @@ public function changePassword(?array $params = null) /** - * Clear a subset or all entries from the API key cache. + * Clear the API key cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-api-key-cache * * @param array{ * ids: string|array, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache @@ -301,9 +301,9 @@ public function clearApiKeyCache(?array $params = null) /** - * Evicts application privileges from the native application privileges cache. + * Clear the privileges cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-privileges * * @param array{ * application: string|array, // (REQUIRED) A comma-separated list of application names @@ -339,9 +339,9 @@ public function clearCachedPrivileges(?array $params = null) /** - * Evicts users from the user cache. Can completely clear the cache or evict specific users. + * Clear the user cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-realms * * @param array{ * realms: string|array, // (REQUIRED) Comma-separated list of realms to clear @@ -378,9 +378,9 @@ public function clearCachedRealms(?array $params = null) /** - * Evicts roles from the native role cache. + * Clear the roles cache * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-roles * * @param array{ * name: string|array, // (REQUIRED) Role name @@ -416,9 +416,9 @@ public function clearCachedRoles(?array $params = null) /** - * Evicts tokens from the service account token caches. + * Clear service account token caches * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-service-tokens * * @param array{ * namespace: string, // (REQUIRED) An identifier for the namespace @@ -456,9 +456,9 @@ public function clearCachedServiceTokens(?array $params = null) /** - * Creates an API key for access without requiring basic authentication. + * Create an API key * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key * @group serverless * * @param array{ @@ -496,9 +496,9 @@ public function createApiKey(?array $params = null) /** - * Creates a cross-cluster API key for API key based remote cluster access. + * Create a cross-cluster API key * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -534,9 +534,9 @@ public function createCrossClusterApiKey(?array $params = null) /** - * Creates a service account token for access without requiring basic authentication. + * Create a service account token * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token * * @param array{ * namespace: string, // (REQUIRED) An identifier for the namespace @@ -579,9 +579,9 @@ public function createServiceToken(?array $params = null) /** - * Delegate PKI authentication. + * Delegate PKI authentication * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-delegate-pki-authentication.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delegate-pki * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -608,6 +608,7 @@ public function delegatePki(?array $params = null) $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, 'security.delegate_pki'); @@ -616,9 +617,9 @@ public function delegatePki(?array $params = null) /** - * Removes application privileges. + * Delete application privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-privileges * * @param array{ * application: string, // (REQUIRED) Application name @@ -656,9 +657,9 @@ public function deletePrivileges(?array $params = null) /** - * Removes roles in the native realm. + * Delete roles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role * @group serverless * * @param array{ @@ -696,9 +697,9 @@ public function deleteRole(?array $params = null) /** - * Removes role mappings. + * Delete role mappings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role-mapping * * @param array{ * name: string, // (REQUIRED) Role-mapping name @@ -735,9 +736,9 @@ public function deleteRoleMapping(?array $params = null) /** - * Deletes a service account token. + * Delete service account tokens * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-service-token * * @param array{ * namespace: string, // (REQUIRED) An identifier for the namespace @@ -776,9 +777,9 @@ public function deleteServiceToken(?array $params = null) /** - * Deletes users from the native realm. + * Delete users * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-user * * @param array{ * username: string, // (REQUIRED) username @@ -815,9 +816,9 @@ public function deleteUser(?array $params = null) /** - * Disables users in the native realm. + * Disable users * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user * * @param array{ * username: string, // (REQUIRED) The username of the user to disable @@ -854,9 +855,9 @@ public function disableUser(?array $params = null) /** - * Disables a user profile so it's not visible in user profile searches. + * Disable a user profile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user-profile * * @param array{ * uid: string, // (REQUIRED) Unique identifier for the user profile @@ -893,9 +894,9 @@ public function disableUserProfile(?array $params = null) /** - * Enables users in the native realm. + * Enable users * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user * * @param array{ * username: string, // (REQUIRED) The username of the user to enable @@ -932,9 +933,9 @@ public function enableUser(?array $params = null) /** - * Enables a user profile so it's visible in user profile searches. + * Enable a user profile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user-profile * * @param array{ * uid: string, // (REQUIRED) An unique identifier of the user profile @@ -971,9 +972,9 @@ public function enableUserProfile(?array $params = null) /** - * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. + * Enroll Kibana * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-kibana * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1007,9 +1008,9 @@ public function enrollKibana(?array $params = null) /** - * Allows a new node to enroll to an existing cluster with security enabled. + * Enroll a node * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-node * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1043,9 +1044,9 @@ public function enrollNode(?array $params = null) /** - * Retrieves information for one or more API keys. + * Get API key information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-api-key * @group serverless * * @param array{ @@ -1087,9 +1088,9 @@ public function getApiKey(?array $params = null) /** - * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. + * Get builtin privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-builtin-privileges * @group serverless * * @param array{ @@ -1123,9 +1124,9 @@ public function getBuiltinPrivileges(?array $params = null) /** - * Retrieves application privileges. + * Get application privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-privileges * * @param array{ * application?: string, // Application name @@ -1167,9 +1168,9 @@ public function getPrivileges(?array $params = null) /** - * Retrieves roles in the native realm. + * Get roles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role * @group serverless * * @param array{ @@ -1208,9 +1209,9 @@ public function getRole(?array $params = null) /** - * Retrieves role mappings. + * Get role mappings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role-mapping * * @param array{ * name?: string|array, // A comma-separated list of role-mapping names @@ -1248,9 +1249,9 @@ public function getRoleMapping(?array $params = null) /** - * Retrieves information about service accounts. + * Get service accounts * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-accounts * * @param array{ * namespace?: string, // An identifier for the namespace @@ -1292,9 +1293,9 @@ public function getServiceAccounts(?array $params = null) /** - * Retrieves information of all service credentials for a service account. + * Get service account credentials * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-credentials * * @param array{ * namespace: string, // (REQUIRED) An identifier for the namespace @@ -1331,9 +1332,9 @@ public function getServiceCredentials(?array $params = null) /** - * Retrieve settings for the security system indices + * Get security index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-settings * * @param array{ * master_timeout?: int|string, // Timeout for connection to master @@ -1368,9 +1369,45 @@ public function getSettings(?array $params = null) /** - * Creates a bearer token for access without requiring basic authentication. + * Get security statistics for all nodes + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-stats + * + * @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 getStats(?array $params = null) + { + $params = $params ?? []; + $url = '/_security/stats'; + $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, 'security.get_stats'); + return $this->client->sendRequest($request); + } + + + /** + * Get a token * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-token * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1406,9 +1443,9 @@ public function getToken(?array $params = null) /** - * Retrieves information about users in the native realm and built-in users. + * Get users * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user * * @param array{ * username?: string|array, // A comma-separated list of usernames @@ -1447,9 +1484,9 @@ public function getUser(?array $params = null) /** - * Retrieves security privileges for the logged in user. + * Get user privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-privileges * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1482,9 +1519,9 @@ public function getUserPrivileges(?array $params = null) /** - * Retrieves user profiles for the given unique ID(s). + * Get a user profile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-profile * * @param array{ * uid: string|array, // (REQUIRED) A comma-separated list of unique identifier for user profiles @@ -1521,9 +1558,9 @@ public function getUserProfile(?array $params = null) /** - * Creates an API key on behalf of another user. + * Grant an API key * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-grant-api-key * * @param array{ * refresh?: string, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. @@ -1560,9 +1597,9 @@ public function grantApiKey(?array $params = null) /** - * Determines whether the specified user has a specified list of privileges. + * Check user privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges * @group serverless * * @param array{ @@ -1604,9 +1641,9 @@ public function hasPrivileges(?array $params = null) /** - * Determines whether the users associated with the specified profile IDs have all the requested privileges. + * Check user profile privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges-user-profile * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1642,9 +1679,9 @@ public function hasPrivilegesUserProfile(?array $params = null) /** - * Invalidates one or more API keys. + * Invalidate API keys * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-api-key * @group serverless * * @param array{ @@ -1681,9 +1718,9 @@ public function invalidateApiKey(?array $params = null) /** - * Invalidates one or more access tokens or refresh tokens. + * Invalidate a token * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-token * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1719,9 +1756,9 @@ public function invalidateToken(?array $params = null) /** - * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair + * Authenticate OpenID Connect * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-authenticate * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1757,9 +1794,9 @@ public function oidcAuthenticate(?array $params = null) /** - * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API + * Logout of OpenID Connect * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-logout * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1795,9 +1832,9 @@ public function oidcLogout(?array $params = null) /** - * Creates an OAuth 2.0 authentication request as a URL string + * Prepare OpenID connect authentication * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-prepare-authentication * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1833,9 +1870,9 @@ public function oidcPrepareAuthentication(?array $params = null) /** - * Adds or updates application privileges. + * Create or update application privileges * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-privileges * * @param array{ * refresh?: string, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. @@ -1872,9 +1909,9 @@ public function putPrivileges(?array $params = null) /** - * Adds and updates roles in the native realm. + * Create or update roles * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role * @group serverless * * @param array{ @@ -1914,9 +1951,9 @@ public function putRole(?array $params = null) /** - * Creates and updates role mappings. + * Create or update role mappings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role-mapping * * @param array{ * name: string, // (REQUIRED) Role-mapping name @@ -1955,9 +1992,9 @@ public function putRoleMapping(?array $params = null) /** - * Adds and updates users in the native realm. These users are commonly referred to as native users. + * Create or update users * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user * * @param array{ * username: string, // (REQUIRED) The username of the User @@ -1996,9 +2033,9 @@ public function putUser(?array $params = null) /** - * Retrieves information for API keys using a subset of query DSL + * Find API keys with a query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-api-keys * @group serverless * * @param array{ @@ -2037,9 +2074,9 @@ public function queryApiKeys(?array $params = null) /** - * Retrieves information for Roles using a subset of query DSL + * Find roles with a query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-role * @group serverless * * @param array{ @@ -2075,9 +2112,9 @@ public function queryRole(?array $params = null) /** - * Retrieves information for Users using a subset of query DSL + * Find users with a query * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-user * * @param array{ * with_profile_uid?: bool, // flag to retrieve profile uid (if exists) associated with the user @@ -2113,9 +2150,9 @@ public function queryUser(?array $params = null) /** - * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair + * Authenticate SAML * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-authenticate * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -2151,9 +2188,9 @@ public function samlAuthenticate(?array $params = null) /** - * Verifies the logout response sent from the SAML IdP + * Logout of SAML completely * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-complete-logout * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -2189,9 +2226,9 @@ public function samlCompleteLogout(?array $params = null) /** - * Consumes a SAML LogoutRequest + * Invalidate SAML * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-invalidate * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -2227,9 +2264,9 @@ public function samlInvalidate(?array $params = null) /** - * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API + * Logout of SAML * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-logout * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -2265,9 +2302,9 @@ public function samlLogout(?array $params = null) /** - * Creates a SAML authentication request + * Prepare SAML authentication * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-prepare-authentication * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -2303,9 +2340,9 @@ public function samlPrepareAuthentication(?array $params = null) /** - * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider + * Create SAML service provider metadata * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-service-provider-metadata * * @param array{ * realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for @@ -2342,9 +2379,9 @@ public function samlServiceProviderMetadata(?array $params = null) /** - * Get suggestions for user profiles that match specified search criteria. + * Suggest a user profile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-suggest-user-profiles * * @param array{ * data?: string|array, // A comma-separated list of keys for which the corresponding application data are retrieved. @@ -2380,9 +2417,9 @@ public function suggestUserProfiles(?array $params = null) /** - * Updates attributes of an existing API key. + * Update an API key * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-api-key * @group serverless * * @param array{ @@ -2421,9 +2458,9 @@ public function updateApiKey(?array $params = null) /** - * Updates attributes of an existing cross-cluster API key. + * Update a cross-cluster API key * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-cross-cluster-api-key * * @param array{ * id: string, // (REQUIRED) The ID of the cross-cluster API key to update @@ -2461,9 +2498,9 @@ public function updateCrossClusterApiKey(?array $params = null) /** - * Update settings for the security system index + * Update security index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-settings * * @param array{ * master_timeout?: int|string, // Timeout for connection to master @@ -2501,9 +2538,9 @@ public function updateSettings(?array $params = null) /** - * Update application specific data for the user profile of the given unique ID. + * Update user profile data * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-user-profile-data * * @param array{ * uid: string, // (REQUIRED) An unique identifier of the user profile diff --git a/src/Endpoints/Shutdown.php b/src/Endpoints/Shutdown.php index fa1650805..66923d259 100644 --- a/src/Endpoints/Shutdown.php +++ b/src/Endpoints/Shutdown.php @@ -29,9 +29,9 @@ class Shutdown extends AbstractEndpoint { /** - * Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Cancel node shutdown preparations * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-delete-node * * @param array{ * node_id: string, // (REQUIRED) The node id of node to be removed from the shutdown state @@ -70,9 +70,9 @@ public function deleteNode(?array $params = null) /** - * Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Get the shutdown status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-get-node * * @param array{ * node_id?: string, // Which node for which to retrieve the shutdown status @@ -112,9 +112,9 @@ public function getNode(?array $params = null) /** - * Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Prepare a node to be shut down * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-shutdown-put-node * * @param array{ * node_id: string, // (REQUIRED) The node id of node to be shut down diff --git a/src/Endpoints/Simulate.php b/src/Endpoints/Simulate.php index 2b25a3061..e76930a4c 100644 --- a/src/Endpoints/Simulate.php +++ b/src/Endpoints/Simulate.php @@ -29,14 +29,15 @@ class Simulate extends AbstractEndpoint { /** - * Simulates running ingest with example documents. + * Simulate data ingestion * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-simulate-ingest * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * index?: string, // Default index for docs which don't provide one * pipeline?: string, // The pipeline id to preprocess incoming documents with if no pipeline is given for a particular document + * merge_type?: string, // The mapping merge type if mapping overrides are being provided in mapping_addition.The allowed values are one of index or template.The index option merges mappings the way they would be merged into an existing index.The template option merges mappings the way they would be merged into a template. * 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) @@ -62,7 +63,7 @@ public function ingest(?array $params = null) $url = '/_ingest/_simulate'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['pipeline','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['pipeline','merge_type','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', diff --git a/src/Endpoints/Slm.php b/src/Endpoints/Slm.php index 6601098dc..b6f9be912 100644 --- a/src/Endpoints/Slm.php +++ b/src/Endpoints/Slm.php @@ -29,9 +29,9 @@ class Slm extends AbstractEndpoint { /** - * Deletes an existing snapshot lifecycle policy. + * Delete a policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-delete-lifecycle * * @param array{ * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove @@ -69,9 +69,9 @@ public function deleteLifecycle(?array $params = null) /** - * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + * Run a policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-lifecycle * * @param array{ * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed @@ -109,9 +109,9 @@ public function executeLifecycle(?array $params = null) /** - * Deletes any snapshots that are expired according to the policy's retention rules. + * Run a retention policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-retention * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -146,9 +146,9 @@ public function executeRetention(?array $params = null) /** - * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + * Get policy information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-lifecycle * * @param array{ * policy_id?: string|array, // Comma-separated list of snapshot lifecycle policies to retrieve @@ -188,9 +188,9 @@ public function getLifecycle(?array $params = null) /** - * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + * Get snapshot lifecycle management statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-stats * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -225,9 +225,9 @@ public function getStats(?array $params = null) /** - * Retrieves the status of snapshot lifecycle management (SLM). + * Get the snapshot lifecycle management status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-status * * @param array{ * master_timeout?: int|string, // Explicit operation timeout for connection to master node @@ -262,9 +262,9 @@ public function getStatus(?array $params = null) /** - * Creates or updates a snapshot lifecycle policy. + * Create or update a policy * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-put-lifecycle * * @param array{ * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy @@ -275,7 +275,7 @@ public function getStatus(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The snapshot lifecycle policy definition to register. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The snapshot lifecycle policy definition to register. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -288,7 +288,7 @@ public function getStatus(?array $params = null) public function putLifecycle(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['policy_id'], $params); + $this->checkRequiredParameters(['policy_id','body'], $params); $url = '/_slm/policy/' . $this->encode($params['policy_id']); $method = 'PUT'; @@ -304,9 +304,9 @@ public function putLifecycle(?array $params = null) /** - * Turns on snapshot lifecycle management (SLM). + * Start snapshot lifecycle management * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-start * * @param array{ * master_timeout?: int|string, // Timeout for processing on master node @@ -341,9 +341,9 @@ public function start(?array $params = null) /** - * Turns off snapshot lifecycle management (SLM). + * Stop snapshot lifecycle management * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-stop * * @param array{ * master_timeout?: int|string, // Timeout for processing on master node diff --git a/src/Endpoints/Snapshot.php b/src/Endpoints/Snapshot.php index bf045f224..d97405397 100644 --- a/src/Endpoints/Snapshot.php +++ b/src/Endpoints/Snapshot.php @@ -29,9 +29,9 @@ class Snapshot extends AbstractEndpoint { /** - * Removes stale data from repository. + * Clean up the snapshot repository * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-cleanup-repository * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -69,9 +69,9 @@ public function cleanupRepository(?array $params = null) /** - * Clones indices from one snapshot into another snapshot in the same repository. + * Clone a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-clone * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -112,9 +112,9 @@ public function clone(?array $params = null) /** - * Creates a snapshot in a repository. + * Create a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -155,9 +155,9 @@ public function create(?array $params = null) /** - * Creates a repository. + * Create or update a snapshot repository * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create-repository * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -198,9 +198,9 @@ public function createRepository(?array $params = null) /** - * Deletes one or more snapshots. + * Delete snapshots * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -239,9 +239,9 @@ public function delete(?array $params = null) /** - * Deletes a repository. + * Delete snapshot repositories * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete-repository * * @param array{ * repository: string|array, // (REQUIRED) Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -279,9 +279,9 @@ public function deleteRepository(?array $params = null) /** - * Returns information about a snapshot. + * Get snapshot information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -332,9 +332,9 @@ public function get(?array $params = null) /** - * Returns information about a repository. + * Get snapshot repository information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get-repository * * @param array{ * repository?: string|array, // A comma-separated list of repository names @@ -374,9 +374,9 @@ public function getRepository(?array $params = null) /** - * Analyzes a repository for correctness and performance + * Analyze a snapshot repository * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-analyze * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -386,7 +386,7 @@ public function getRepository(?array $params = null) * read_node_count?: int, // Number of nodes on which to read a blob after writing. Defaults to 10. * early_read_node_count?: int, // Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. * seed?: int, // Seed for the random number generator used to create the test workload. Defaults to a random value. - * rare_action_probability?: int, // Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. + * rare_action_probability?: float, // Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. * max_blob_size?: string, // Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. * max_total_data_size?: string, // Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. * timeout?: int|string, // Explicit operation timeout. Defaults to '30s'. @@ -424,9 +424,9 @@ public function repositoryAnalyze(?array $params = null) /** - * Verifies the integrity of the contents of a snapshot repository + * Verify the repository integrity * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-verify-integrity * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -471,9 +471,9 @@ public function repositoryVerifyIntegrity(?array $params = null) /** - * Restores a snapshot. + * Restore a snapshot * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-restore * * @param array{ * repository: string, // (REQUIRED) A repository name @@ -514,9 +514,9 @@ public function restore(?array $params = null) /** - * Returns information about the status of a snapshot. + * Get the snapshot status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-status * * @param array{ * repository?: string, // A repository name @@ -560,9 +560,9 @@ public function status(?array $params = null) /** - * Verifies a repository. + * Verify a snapshot repository * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-verify-repository * * @param array{ * repository: string, // (REQUIRED) A repository name diff --git a/src/Endpoints/Sql.php b/src/Endpoints/Sql.php index f96e827c1..d119ba105 100644 --- a/src/Endpoints/Sql.php +++ b/src/Endpoints/Sql.php @@ -29,9 +29,9 @@ class Sql extends AbstractEndpoint { /** - * Clears the SQL cursor + * Clear an SQL search cursor * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-clear-cursor * @group serverless * * @param array{ @@ -68,9 +68,9 @@ public function clearCursor(?array $params = null) /** - * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. + * Delete an async SQL search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-delete-async * @group serverless * * @param array{ @@ -107,9 +107,9 @@ public function deleteAsync(?array $params = null) /** - * Returns the current status and available results for an async SQL search or stored synchronous SQL search + * Get async SQL search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async * @group serverless * * @param array{ @@ -150,9 +150,9 @@ public function getAsync(?array $params = null) /** - * Returns the current status of an async SQL search or a stored synchronous SQL search + * Get the async SQL search status * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async-status * @group serverless * * @param array{ @@ -189,13 +189,14 @@ public function getAsyncStatus(?array $params = null) /** - * Executes a SQL request + * Get SQL search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-query * @group serverless * * @param array{ - * format?: string, // a short version of the Accept header, e.g. json, yaml + * format?: string, // The format for the response.You can also specify a format using the `Accept` HTTP header.If you specify both this parameter and the `Accept` HTTP header, this parameter takes precedence. + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -217,7 +218,7 @@ public function query(?array $params = null) $url = '/_sql'; $method = empty($params['body']) ? 'GET' : 'POST'; - $url = $this->addQueryString($url, $params, ['format','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['format','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -229,9 +230,9 @@ public function query(?array $params = null) /** - * Translates SQL into Elasticsearch queries + * Translate SQL into Elasticsearch queries * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-translate * @group serverless * * @param array{ diff --git a/src/Endpoints/Ssl.php b/src/Endpoints/Ssl.php index 25441e2d8..37b2684b3 100644 --- a/src/Endpoints/Ssl.php +++ b/src/Endpoints/Ssl.php @@ -29,9 +29,9 @@ class Ssl extends AbstractEndpoint { /** - * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. + * Get SSL certificates * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ssl-certificates * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) diff --git a/src/Endpoints/Streams.php b/src/Endpoints/Streams.php index b94db754f..f04bd8889 100644 --- a/src/Endpoints/Streams.php +++ b/src/Endpoints/Streams.php @@ -31,7 +31,8 @@ class Streams extends AbstractEndpoint /** * Disable the Logs Streams feature for this cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. @@ -68,7 +69,8 @@ public function logsDisable(?array $params = null) /** * Enable the Logs Streams feature for this cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. @@ -105,10 +107,11 @@ public function logsEnable(?array $params = null) /** * Return the current status of the streams feature for each streams type * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ - * mater_timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * master_timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * 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) @@ -128,7 +131,7 @@ public function status(?array $params = null) $url = '/_streams/status'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['mater_timeout','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['master_timeout','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; diff --git a/src/Endpoints/Synonyms.php b/src/Endpoints/Synonyms.php index 008cd44f1..cb0309f66 100644 --- a/src/Endpoints/Synonyms.php +++ b/src/Endpoints/Synonyms.php @@ -29,9 +29,9 @@ class Synonyms extends AbstractEndpoint { /** - * Deletes a synonym set + * Delete a synonym set * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym * @group serverless * * @param array{ @@ -68,9 +68,9 @@ public function deleteSynonym(?array $params = null) /** - * Deletes a synonym rule in a synonym set + * Delete a synonym rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym-rule * @group serverless * * @param array{ @@ -110,9 +110,9 @@ public function deleteSynonymRule(?array $params = null) /** - * Retrieves a synonym set + * Get a synonym set * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym * @group serverless * * @param array{ @@ -151,9 +151,9 @@ public function getSynonym(?array $params = null) /** - * Retrieves a synonym rule from a synonym set + * Get a synonym rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym-rule * @group serverless * * @param array{ @@ -192,9 +192,9 @@ public function getSynonymRule(?array $params = null) /** - * Retrieves a summary of all defined synonym sets + * Get all synonym sets * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym * @group serverless * * @param array{ @@ -230,9 +230,9 @@ public function getSynonymsSets(?array $params = null) /** - * Creates or updates a synonyms set + * Create or update a synonym set * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym * @group serverless * * @param array{ @@ -272,9 +272,9 @@ public function putSynonym(?array $params = null) /** - * Creates or updates a synonym rule in a synonym set + * Create or update a synonym rule * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym-rule * @group serverless * * @param array{ diff --git a/src/Endpoints/Tasks.php b/src/Endpoints/Tasks.php index 4d4ebeb82..5cbaf08c0 100644 --- a/src/Endpoints/Tasks.php +++ b/src/Endpoints/Tasks.php @@ -29,9 +29,9 @@ class Tasks extends AbstractEndpoint { /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -74,9 +74,9 @@ public function cancel(?array $params = null) /** - * Returns information about a task. + * Get task information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -116,9 +116,9 @@ public function get(?array $params = null) /** - * Returns a list of tasks. + * Get all tasks * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ diff --git a/src/Endpoints/TextStructure.php b/src/Endpoints/TextStructure.php index 1e07c9f19..7a346cc25 100644 --- a/src/Endpoints/TextStructure.php +++ b/src/Endpoints/TextStructure.php @@ -29,9 +29,9 @@ class TextStructure extends AbstractEndpoint { /** - * Finds the structure of a text field in an index. + * Find the structure of a text field * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-text_structure * * @param array{ * index?: string, // The index containing the analyzed field @@ -44,7 +44,7 @@ class TextStructure extends AbstractEndpoint * quote?: string, // Optional parameter to specify the quote character for a delimited file - must be a single character * should_trim_fields?: bool, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them * grok_pattern?: string, // Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file - * ecs_compatibility?: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' + * ecs_compatibility?: string, // The mode of compatibility with ECS compliant Grok patterns.Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.This setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.If the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.The intention in that situation is that a user who knows the meanings will rename the fields before using them. * timestamp_field?: string, // Optional parameter to specify the timestamp field in the file * timestamp_format?: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format * explain?: bool, // Whether to include a commentary on how the structure was derived @@ -79,9 +79,9 @@ public function findFieldStructure(?array $params = null) /** - * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. + * Find the structure of text messages * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-message-structure * * @param array{ * timeout?: int|string, // Timeout after which the analysis will be aborted @@ -91,7 +91,7 @@ public function findFieldStructure(?array $params = null) * quote?: string, // Optional parameter to specify the quote character for a delimited file - must be a single character * should_trim_fields?: bool, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them * grok_pattern?: string, // Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file - * ecs_compatibility?: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' + * ecs_compatibility?: string, // The mode of compatibility with ECS compliant Grok patterns.Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.This setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.If the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it. * timestamp_field?: string, // Optional parameter to specify the timestamp field in the file * timestamp_format?: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format * explain?: bool, // Whether to include a commentary on how the structure was derived @@ -128,9 +128,9 @@ public function findMessageStructure(?array $params = null) /** - * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. + * Find the structure of a text file * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-structure * * @param array{ * lines_to_sample?: int, // How many lines of the file should be included in the analysis @@ -181,9 +181,9 @@ public function findStructure(?array $params = null) /** - * Tests a Grok pattern on some text. + * Test a Grok pattern * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-test-grok-pattern * * @param array{ * ecs_compatibility?: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' diff --git a/src/Endpoints/Transform.php b/src/Endpoints/Transform.php index 7d83b62c9..aacce8cb1 100644 --- a/src/Endpoints/Transform.php +++ b/src/Endpoints/Transform.php @@ -29,9 +29,9 @@ class Transform extends AbstractEndpoint { /** - * Deletes an existing transform. + * Delete a transform * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform * @group serverless * * @param array{ @@ -71,7 +71,7 @@ public function deleteTransform(?array $params = null) /** - * Retrieves transform usage information for transform nodes. + * Retrieves transform usage information for transform nodes * * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html * @@ -106,9 +106,9 @@ public function getNodeStats(?array $params = null) /** - * Retrieves configuration information for transforms. + * Get transforms * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform * @group serverless * * @param array{ @@ -151,9 +151,9 @@ public function getTransform(?array $params = null) /** - * Retrieves usage information for transforms. + * Get transform stats * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats * @group serverless * * @param array{ @@ -194,9 +194,9 @@ public function getTransformStats(?array $params = null) /** - * Previews a transform. + * Preview a transform * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform * @group serverless * * @param array{ @@ -238,9 +238,9 @@ public function previewTransform(?array $params = null) /** - * Instantiates a transform. + * Create a transform * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform * @group serverless * * @param array{ @@ -281,9 +281,9 @@ public function putTransform(?array $params = null) /** - * Resets an existing transform. + * Reset a transform * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform * @group serverless * * @param array{ @@ -322,9 +322,9 @@ public function resetTransform(?array $params = null) /** - * Schedules now a transform. + * Schedule a transform to start now * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform * @group serverless * * @param array{ @@ -363,9 +363,46 @@ public function scheduleNowTransform(?array $params = null) /** - * Starts one or more transforms. + * Set upgrade_mode for transform indices * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode + * + * @param array{ + * enabled?: bool, // Whether to enable upgrade_mode Transform setting or not. Defaults to false. + * timeout?: int|string, // Controls the time to wait before action times out. Defaults to 30 seconds + * 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 setUpgradeMode(?array $params = null) + { + $params = $params ?? []; + $url = '/_transform/set_upgrade_mode'; + $method = 'POST'; + + $url = $this->addQueryString($url, $params, ['enabled','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, [], $request, 'transform.set_upgrade_mode'); + return $this->client->sendRequest($request); + } + + + /** + * Start a transform + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform * @group serverless * * @param array{ @@ -404,9 +441,9 @@ public function startTransform(?array $params = null) /** - * Stops one or more transforms. + * Stop transforms * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform * @group serverless * * @param array{ @@ -448,9 +485,9 @@ public function stopTransform(?array $params = null) /** - * Updates certain properties of a transform. + * Update a transform * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform * @group serverless * * @param array{ @@ -491,9 +528,9 @@ public function updateTransform(?array $params = null) /** - * Upgrades all transforms. + * Upgrade all transforms * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-upgrade-transforms * * @param array{ * dry_run?: bool, // Whether to only check for updates but don't execute diff --git a/src/Endpoints/Watcher.php b/src/Endpoints/Watcher.php index 97e285f17..4e75a957f 100644 --- a/src/Endpoints/Watcher.php +++ b/src/Endpoints/Watcher.php @@ -29,9 +29,9 @@ class Watcher extends AbstractEndpoint { /** - * Acknowledges a watch, manually throttling the execution of the watch's actions. + * Acknowledge a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-ack-watch * * @param array{ * watch_id: string, // (REQUIRED) Watch ID @@ -72,9 +72,9 @@ public function ackWatch(?array $params = null) /** - * Activates a currently inactive watch. + * Activate a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch * * @param array{ * watch_id: string, // (REQUIRED) Watch ID @@ -110,9 +110,9 @@ public function activateWatch(?array $params = null) /** - * Deactivates a currently active watch. + * Deactivate a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch * * @param array{ * watch_id: string, // (REQUIRED) Watch ID @@ -148,9 +148,9 @@ public function deactivateWatch(?array $params = null) /** - * Removes a watch from Watcher. + * Delete a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-delete-watch * * @param array{ * id: string, // (REQUIRED) Watch ID @@ -186,9 +186,9 @@ public function deleteWatch(?array $params = null) /** - * Forces the execution of a stored watch. + * Run a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-execute-watch * * @param array{ * id?: string, // Watch ID @@ -229,9 +229,9 @@ public function executeWatch(?array $params = null) /** - * Retrieve settings for the watcher system index + * Get Watcher index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-settings * * @param array{ * master_timeout?: int|string, // Specify timeout for connection to master @@ -266,9 +266,9 @@ public function getSettings(?array $params = null) /** - * Retrieves a watch by its ID. + * Get a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-watch * * @param array{ * id: string, // (REQUIRED) Watch ID @@ -304,9 +304,9 @@ public function getWatch(?array $params = null) /** - * Creates a new watch, or updates an existing one. + * Create or update a watch * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-put-watch * * @param array{ * id: string, // (REQUIRED) Watch ID @@ -319,7 +319,7 @@ public function getWatch(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The watch. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The watch. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -332,7 +332,7 @@ public function getWatch(?array $params = null) public function putWatch(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['id'], $params); + $this->checkRequiredParameters(['id','body'], $params); $url = '/_watcher/watch/' . $this->encode($params['id']); $method = 'PUT'; @@ -348,9 +348,9 @@ public function putWatch(?array $params = null) /** - * Retrieves stored watches. + * Query watches * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-query-watches * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -385,9 +385,9 @@ public function queryWatches(?array $params = null) /** - * Starts Watcher if it is not already running. + * Start the watch service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start * * @param array{ * master_timeout?: int|string, // Specify timeout for connection to master @@ -421,9 +421,9 @@ public function start(?array $params = null) /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stats * * @param array{ * metric?: string|array, // Controls what additional stat metrics should be include in the response @@ -462,9 +462,9 @@ public function stats(?array $params = null) /** - * Stops Watcher if it is running. + * Stop the watch service * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop * * @param array{ * master_timeout?: int|string, // Specify timeout for connection to master @@ -498,9 +498,9 @@ public function stop(?array $params = null) /** - * Update settings for the watcher system index + * Update Watcher index settings * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings * * @param array{ * timeout?: int|string, // Specify timeout for waiting for acknowledgement from all nodes diff --git a/src/Endpoints/Xpack.php b/src/Endpoints/Xpack.php index 0bc0a20f3..167b4abab 100644 --- a/src/Endpoints/Xpack.php +++ b/src/Endpoints/Xpack.php @@ -29,9 +29,9 @@ class Xpack extends AbstractEndpoint { /** - * Retrieves information about the installed X-Pack features. + * Get information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info * * @param array{ * human?: bool, // Defines whether additional human-readable information is included in the response. In particular, it adds descriptions and a tag line. The default value is true. @@ -67,9 +67,9 @@ public function info(?array $params = null) /** - * Retrieves usage information about the installed X-Pack features. + * Get usage information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-xpack * * @param array{ * master_timeout?: int|string, // Specify timeout for watch write operation diff --git a/src/Traits/ClientEndpointsTrait.php b/src/Traits/ClientEndpointsTrait.php index 0ac26f032..d65f93c5d 100644 --- a/src/Traits/ClientEndpointsTrait.php +++ b/src/Traits/ClientEndpointsTrait.php @@ -29,9 +29,9 @@ trait ClientEndpointsTrait { /** - * Allows to perform multiple index/update/delete operations in a single request. + * Bulk index or delete documents * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk * @group serverless * * @param array{ @@ -44,7 +44,7 @@ trait ClientEndpointsTrait * _source_excludes?: string|array, // Default list of fields to exclude from the returned _source field, can be overridden on each sub-request * _source_includes?: string|array, // Default list of fields to extract and return from the _source field, can be overridden on each sub-request * pipeline?: string, // The pipeline id to preprocess incoming documents with - * require_alias?: bool, // If true, the request’s actions must target an index alias. Defaults to false. + * require_alias?: bool, // If true, the request's actions must target an index alias. Defaults to false. * require_data_stream?: bool, // If true, the request's actions must target a data stream (existing or to-be-created). Default to false * list_executed_pipelines?: bool, // Sets list_executed_pipelines for all incoming documents. Defaults to unset (false) * include_source_on_error?: bool, // True or false if to include the document source in the error message in case of parsing errors. Defaults to true. @@ -85,9 +85,9 @@ public function bulk(?array $params = null) /** - * Explicitly clears the search context for a scroll. + * Clear a scrolling search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll * @group serverless * * @param array{ @@ -130,7 +130,7 @@ public function clearScroll(?array $params = null) /** * Close a point in time * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time * @group serverless * * @param array{ @@ -139,7 +139,7 @@ public function clearScroll(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // a point-in-time id to close. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) a point-in-time id to close. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline @@ -151,6 +151,7 @@ public function clearScroll(?array $params = null) public function closePointInTime(?array $params = null) { $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); $url = '/_pit'; $method = 'DELETE'; @@ -166,9 +167,9 @@ public function closePointInTime(?array $params = null) /** - * Returns number of documents matching a query. + * Count search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-count * @group serverless * * @param array{ @@ -177,8 +178,9 @@ public function closePointInTime(?array $params = null) * ignore_throttled?: bool, // Whether specified concrete, expanded or aliased indices should be ignored when throttled * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. - * min_score?: int, // Include only documents with a specific `_score` value in the result + * min_score?: float, // Include only documents with a specific `_score` value in the result * preference?: string, // Specify the node or shard the operation should be performed on (default: random) + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * routing?: string|array, // A comma-separated list of specific routing values * q?: string, // Query in the Lucene query string syntax * analyzer?: string, // The analyzer to use for the query string @@ -211,7 +213,7 @@ public function count(?array $params = null) $url = '/_count'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','min_score','preference','routing','q','analyzer','analyze_wildcard','default_operator','df','lenient','terminate_after','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','min_score','preference','project_routing','routing','q','analyzer','analyze_wildcard','default_operator','df','lenient','terminate_after','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -223,11 +225,9 @@ public function count(?array $params = null) /** - * Creates a new document in the index. - * - * Returns a 409 response when a document with a same ID already exists in the index. + * Create a new document in the index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create * @group serverless * * @param array{ @@ -277,9 +277,9 @@ public function create(?array $params = null) /** - * Removes a document from the index. + * Delete a document * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete * @group serverless * * @param array{ @@ -325,9 +325,9 @@ public function delete(?array $params = null) /** - * Deletes documents matching the provided query. + * Delete documents * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query * @group serverless * * @param array{ @@ -395,9 +395,9 @@ public function deleteByQuery(?array $params = null) /** - * Changes the number of requests per second for a particular Delete By Query operation. + * Throttle a delete by query operation * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query-rethrottle * * @param array{ * task_id: string, // (REQUIRED) The task id to rethrottle @@ -434,9 +434,9 @@ public function deleteByQueryRethrottle(?array $params = null) /** - * Deletes a script. + * Delete a script or search template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script * @group serverless * * @param array{ @@ -475,9 +475,9 @@ public function deleteScript(?array $params = null) /** - * Returns information about whether a document exists in an index. + * Check a document * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get * @group serverless * * @param array{ @@ -525,9 +525,9 @@ public function exists(?array $params = null) /** - * Returns information about whether a document source exists in an index. + * Check for a document source * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get * @group serverless * * @param array{ @@ -574,9 +574,9 @@ public function existsSource(?array $params = null) /** - * Returns information about why a specific matches (or doesn't match) a query. + * Explain a document match result * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain * @group serverless * * @param array{ @@ -628,9 +628,9 @@ public function explain(?array $params = null) /** - * Returns the information about the capabilities of fields among multiple indices. + * Get the field capabilities * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-field-caps * @group serverless * * @param array{ @@ -643,6 +643,7 @@ public function explain(?array $params = null) * filters?: string|array, // An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent * types?: string|array, // Only return results for fields that have one of the types in the list * include_empty_fields?: bool, // Include empty fields in result + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -667,7 +668,7 @@ public function fieldCaps(?array $params = null) $url = '/_field_caps'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['fields','ignore_unavailable','allow_no_indices','expand_wildcards','include_unmapped','filters','types','include_empty_fields','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['fields','ignore_unavailable','allow_no_indices','expand_wildcards','include_unmapped','filters','types','include_empty_fields','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -679,9 +680,9 @@ public function fieldCaps(?array $params = null) /** - * Returns a document. + * Get a document by its ID * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get * @group serverless * * @param array{ @@ -696,6 +697,7 @@ public function fieldCaps(?array $params = null) * _source?: string|array, // True or false to return the _source field or not, or a list of fields to return * _source_excludes?: string|array, // A list of fields to exclude from the returned _source field * _source_includes?: string|array, // A list of fields to extract and return from the _source field + * _source_exclude_vectors?: bool, // Whether vectors should be excluded from _source * version?: int, // Explicit version number for concurrency control * version_type?: string, // Specific version type * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -719,7 +721,7 @@ public function get(?array $params = null) $url = '/' . $this->encode($params['index']) . '/_doc/' . $this->encode($params['id']); $method = 'GET'; - $url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','version','version_type','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','_source_exclude_vectors','version','version_type','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; @@ -730,9 +732,9 @@ public function get(?array $params = null) /** - * Returns a script. + * Get a script or search template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script * @group serverless * * @param array{ @@ -770,9 +772,9 @@ public function getScript(?array $params = null) /** - * Returns all script contexts. + * Get script contexts * - * @link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-context * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -805,9 +807,9 @@ public function getScriptContext(?array $params = null) /** - * Returns available script types, languages and contexts + * Get script languages * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-languages * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -840,9 +842,9 @@ public function getScriptLanguages(?array $params = null) /** - * Returns the source of a document. + * Get a document's source * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get * @group serverless * * @param array{ @@ -889,9 +891,9 @@ public function getSource(?array $params = null) /** - * Returns the health of the cluster. + * Get the cluster health * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-health-report * * @param array{ * feature?: string, // A feature of the cluster, as returned by the top-level health API @@ -932,9 +934,9 @@ public function healthReport(?array $params = null) /** - * Creates or updates a document in an index. + * Create or update a document in an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create * @group serverless * * @param array{ @@ -991,9 +993,9 @@ public function index(?array $params = null) /** - * Returns basic information about the cluster. + * Get cluster info * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info * @group serverless * * @param array{ @@ -1027,9 +1029,8 @@ public function info(?array $params = null) /** - * Performs a kNN search. + * Performs a kNN search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -1040,7 +1041,7 @@ public function info(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The search definition. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The search definition. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1053,7 +1054,7 @@ public function info(?array $params = null) public function knnSearch(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index'], $params); + $this->checkRequiredParameters(['index','body'], $params); $url = '/' . $this->encode($this->convertValue($params['index'])) . '/_knn_search'; $method = empty($params['body']) ? 'GET' : 'POST'; @@ -1069,9 +1070,9 @@ public function knnSearch(?array $params = null) /** - * Allows to get multiple documents in one request. + * Get multiple documents * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mget * @group serverless * * @param array{ @@ -1122,9 +1123,9 @@ public function mget(?array $params = null) /** - * Allows to execute several search operations in one request. + * Run multiple searches * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch * @group serverless * * @param array{ @@ -1132,7 +1133,7 @@ public function mget(?array $params = null) * search_type?: string, // Search operation type * max_concurrent_searches?: int, // Controls the maximum number of concurrent searches the multi search api will execute * typed_keys?: bool, // Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * pre_filter_shard_size?: int, // A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * pre_filter_shard_size?: int, // A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. * max_concurrent_shard_requests?: int, // The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests * rest_total_hits_as_int?: bool, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response * ccs_minimize_roundtrips?: bool, // Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution @@ -1140,6 +1141,7 @@ public function mget(?array $params = null) * ignore_throttled?: bool, // Whether specified concrete, expanded or aliased indices should be ignored when throttled * allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * routing?: string|array, // A comma-separated list of specific routing values * include_named_queries_score?: bool, // Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1167,7 +1169,7 @@ public function msearch(?array $params = null) $url = '/_msearch'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['search_type','max_concurrent_searches','typed_keys','pre_filter_shard_size','max_concurrent_shard_requests','rest_total_hits_as_int','ccs_minimize_roundtrips','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','routing','include_named_queries_score','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['search_type','max_concurrent_searches','typed_keys','pre_filter_shard_size','max_concurrent_shard_requests','rest_total_hits_as_int','ccs_minimize_roundtrips','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','project_routing','routing','include_named_queries_score','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson', @@ -1179,9 +1181,9 @@ public function msearch(?array $params = null) /** - * Allows to execute several search template operations in one request. + * Run multiple templated searches * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch-template * @group serverless * * @param array{ @@ -1191,6 +1193,7 @@ public function msearch(?array $params = null) * max_concurrent_searches?: int, // Controls the maximum number of concurrent searches the multi search api will execute * rest_total_hits_as_int?: bool, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response * ccs_minimize_roundtrips?: bool, // Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -1216,7 +1219,7 @@ public function msearchTemplate(?array $params = null) $url = '/_msearch/template'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['search_type','typed_keys','max_concurrent_searches','rest_total_hits_as_int','ccs_minimize_roundtrips','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['search_type','typed_keys','max_concurrent_searches','rest_total_hits_as_int','ccs_minimize_roundtrips','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson', @@ -1228,9 +1231,9 @@ public function msearchTemplate(?array $params = null) /** - * Returns multiple termvectors in one request. + * Get multiple term vectors * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mtermvectors * @group serverless * * @param array{ @@ -1283,9 +1286,9 @@ public function mtermvectors(?array $params = null) /** - * Open a point in time that can be used in subsequent searches + * Open a point in time * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time * @group serverless * * @param array{ @@ -1297,6 +1300,7 @@ public function mtermvectors(?array $params = null) * keep_alive?: string, // Specific the time to live for the point in time * allow_partial_search_results?: bool, // Specify whether to tolerate shards missing when creating the point-in-time, or otherwise throw an exception. (default: false) * max_concurrent_shard_requests?: int, // The number of concurrent shard requests per node executed concurrently when opening this point-in-time. This value should be used to limit the impact of opening the point-in-time on the cluster + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -1319,7 +1323,7 @@ public function openPointInTime(?array $params = null) $url = '/' . $this->encode($this->convertValue($params['index'])) . '/_pit'; $method = 'POST'; - $url = $this->addQueryString($url, $params, ['preference','routing','ignore_unavailable','expand_wildcards','keep_alive','allow_partial_search_results','max_concurrent_shard_requests','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['preference','routing','ignore_unavailable','expand_wildcards','keep_alive','allow_partial_search_results','max_concurrent_shard_requests','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -1331,9 +1335,9 @@ public function openPointInTime(?array $params = null) /** - * Returns whether the cluster is running. + * Ping the cluster * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster * @group serverless * * @param array{ @@ -1367,9 +1371,9 @@ public function ping(?array $params = null) /** - * Creates or updates a script. + * Create or update a script or search template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script * @group serverless * * @param array{ @@ -1415,9 +1419,9 @@ public function putScript(?array $params = null) /** - * Allows to evaluate the quality of ranked search results over a set of typical search queries + * Evaluate ranked search results * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rank-eval * @group serverless * * @param array{ @@ -1463,11 +1467,9 @@ public function rankEval(?array $params = null) /** - * Allows to copy documents from one index to another, optionally filtering the source - * documents by a query, changing the destination index settings, or fetching the - * documents from a remote cluster. + * Reindex documents * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex * @group serverless * * @param array{ @@ -1513,9 +1515,9 @@ public function reindex(?array $params = null) /** - * Changes the number of requests per second for a particular Reindex operation. + * Throttle a reindex operation * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex * * @param array{ * task_id: string, // (REQUIRED) The task id to rethrottle @@ -1552,9 +1554,9 @@ public function reindexRethrottle(?array $params = null) /** - * Allows to use the Mustache language to pre-render a search definition. + * Render a search template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/render-search-template-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-render-search-template * @group serverless * * @param array{ @@ -1564,7 +1566,7 @@ public function reindexRethrottle(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The search definition template and its params. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The search definition template and its params. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline @@ -1576,6 +1578,7 @@ public function reindexRethrottle(?array $params = null) public function renderSearchTemplate(?array $params = null) { $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); if (isset($params['id'])) { $url = '/_render/template/' . $this->encode($params['id']); $method = empty($params['body']) ? 'GET' : 'POST'; @@ -1595,9 +1598,9 @@ public function renderSearchTemplate(?array $params = null) /** - * Allows an arbitrary script to be executed and a result to be returned + * Run a script * - * @link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html + * @link https://www.elastic.co/docs/reference/scripting-languages/painless/painless-api-examples * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * @@ -1607,7 +1610,7 @@ public function renderSearchTemplate(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // The script to execute. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The script to execute. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline @@ -1619,6 +1622,7 @@ public function renderSearchTemplate(?array $params = null) public function scriptsPainlessExecute(?array $params = null) { $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); $url = '/_scripts/painless/_execute'; $method = empty($params['body']) ? 'GET' : 'POST'; @@ -1634,9 +1638,9 @@ public function scriptsPainlessExecute(?array $params = null) /** - * Allows to retrieve a large numbers of results from a single search request. + * Run a scrolling search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-scroll * @group serverless * * @param array{ @@ -1679,9 +1683,9 @@ public function scroll(?array $params = null) /** - * Returns results matching a query. + * Run a search * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search * @group serverless * * @param array{ @@ -1702,6 +1706,7 @@ public function scroll(?array $params = null) * expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both. * lenient?: bool, // Specify whether format-based query failures (such as providing text to a numeric field) should be ignored * preference?: string, // Specify the node or shard the operation should be performed on (default: random) + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * q?: string, // Query in the Lucene query string syntax * routing?: string|array, // A comma-separated list of specific routing values * scroll?: int|string, // Specify how long a consistent view of the index should be maintained for scrolled search @@ -1711,6 +1716,7 @@ public function scroll(?array $params = null) * _source?: string|array, // True or false to return the _source field or not, or a list of fields to return * _source_excludes?: string|array, // A list of fields to exclude from the returned _source field * _source_includes?: string|array, // A list of fields to extract and return from the _source field + * _source_exclude_vectors?: bool, // Whether vectors should be excluded from _source * terminate_after?: int, // The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * stats?: string|array, // Specific 'tag' of the request for logging and statistical purposes * suggest_field?: string, // Specify which field to use for suggestions @@ -1727,7 +1733,7 @@ public function scroll(?array $params = null) * request_cache?: bool, // Specify if request cache should be used for this request or not, defaults to index level setting * batched_reduce_size?: int, // The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. * max_concurrent_shard_requests?: int, // The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * pre_filter_shard_size?: int, // A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * pre_filter_shard_size?: int, // A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. * rest_total_hits_as_int?: bool, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response * include_named_queries_score?: bool, // Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -1754,7 +1760,7 @@ public function search(?array $params = null) $url = '/_search'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','force_synthetic_source','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','include_named_queries_score','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','force_synthetic_source','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','project_routing','q','routing','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','_source_exclude_vectors','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','include_named_queries_score','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -1766,11 +1772,10 @@ public function search(?array $params = null) /** - * Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + * Search a vector tile * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt * @group serverless - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * index: string|array, // (REQUIRED) Comma-separated list of data streams, indices, or aliases to search @@ -1783,6 +1788,7 @@ public function search(?array $params = null) * grid_precision?: int, // Additional zoom levels available through the aggs layer. Accepts 0-8. * grid_type?: string, // Determines the geometry type for features in the aggs layer. * grid_agg?: string, // Aggregation used to create a grid for `field`. + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * size?: int, // Maximum number of features to return in the hits layer. Accepts 0-10000. * track_total_hits?: bool|int, // Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. * with_labels?: bool, // If true, the hits and aggs layers will contain additional point features with suggested label positions for the original features. @@ -1808,7 +1814,7 @@ public function searchMvt(?array $params = null) $url = '/' . $this->encode($this->convertValue($params['index'])) . '/_mvt/' . $this->encode($params['field']) . '/' . $this->encode($params['zoom']) . '/' . $this->encode($params['x']) . '/' . $this->encode($params['y']); $method = empty($params['body']) ? 'GET' : 'POST'; - $url = $this->addQueryString($url, $params, ['exact_bounds','extent','grid_precision','grid_type','grid_agg','size','track_total_hits','with_labels','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['exact_bounds','extent','grid_precision','grid_type','grid_agg','project_routing','size','track_total_hits','with_labels','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/vnd.mapbox-vector-tile', 'Content-Type' => 'application/json', @@ -1820,9 +1826,9 @@ public function searchMvt(?array $params = null) /** - * Returns information about the indices and shards that a search request would be executed against. + * Get the search shards * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-shards * * @param array{ * index?: string|array, // A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1867,9 +1873,9 @@ public function searchShards(?array $params = null) /** - * Allows to use the Mustache language to pre-render a search definition. + * Run a search with a search template * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-template * @group serverless * * @param array{ @@ -1887,6 +1893,7 @@ public function searchShards(?array $params = null) * typed_keys?: bool, // Specify whether aggregation and suggester names should be prefixed by their respective types in the response * rest_total_hits_as_int?: bool, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response * ccs_minimize_roundtrips?: bool, // Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * project_routing?: string, // A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless. * 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) @@ -1912,7 +1919,7 @@ public function searchTemplate(?array $params = null) $url = '/_search/template'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','preference','routing','scroll','search_type','explain','profile','typed_keys','rest_total_hits_as_int','ccs_minimize_roundtrips','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','preference','routing','scroll','search_type','explain','profile','typed_keys','rest_total_hits_as_int','ccs_minimize_roundtrips','project_routing','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -1924,9 +1931,9 @@ public function searchTemplate(?array $params = null) /** - * The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + * Get terms in an index * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-terms-enum * @group serverless * * @param array{ @@ -1936,7 +1943,7 @@ public function searchTemplate(?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, // A comma-separated list of filters used to reduce the response. - * body?: string|array, // field name, string which is the prefix expected in matching terms, timeout and size for max number of results. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) field name, string which is the prefix expected in matching terms, timeout and size for max number of results. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -1949,7 +1956,7 @@ public function searchTemplate(?array $params = null) public function termsEnum(?array $params = null) { $params = $params ?? []; - $this->checkRequiredParameters(['index'], $params); + $this->checkRequiredParameters(['index','body'], $params); $url = '/' . $this->encode($this->convertValue($params['index'])) . '/_terms_enum'; $method = empty($params['body']) ? 'GET' : 'POST'; @@ -1965,9 +1972,9 @@ public function termsEnum(?array $params = null) /** - * Returns information and statistics about terms in the fields of a particular document. + * Get term vector information * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-termvectors * @group serverless * * @param array{ @@ -2022,9 +2029,9 @@ public function termvectors(?array $params = null) /** - * Updates a document with a script or partial document. + * Update a document * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update * @group serverless * * @param array{ @@ -2077,10 +2084,9 @@ public function update(?array $params = null) /** - * Performs an update on every document in the index without changing the source, - * for example to pick up a mapping change. + * Update documents * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query * @group serverless * * @param array{ @@ -2150,9 +2156,9 @@ public function updateByQuery(?array $params = null) /** - * Changes the number of requests per second for a particular Update By Query operation. + * Throttle an update by query operation * - * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query-rethrottle * * @param array{ * task_id: string, // (REQUIRED) The task id to rethrottle diff --git a/src/Traits/NamespaceTrait.php b/src/Traits/NamespaceTrait.php index 3706e6d9a..469a3fa84 100644 --- a/src/Traits/NamespaceTrait.php +++ b/src/Traits/NamespaceTrait.php @@ -40,6 +40,7 @@ use Elastic\Elasticsearch\Endpoints\Monitoring; use Elastic\Elasticsearch\Endpoints\Nodes; use Elastic\Elasticsearch\Endpoints\Profiling; +use Elastic\Elasticsearch\Endpoints\Project; use Elastic\Elasticsearch\Endpoints\QueryRules; use Elastic\Elasticsearch\Endpoints\Rollup; use Elastic\Elasticsearch\Endpoints\SearchApplication; @@ -284,6 +285,15 @@ public function profiling(): Profiling } + public function project(): Project + { + if (!isset($this->namespace['Project'])) { + $this->namespace['Project'] = new Project($this); + } + return $this->namespace['Project']; + } + + public function queryRules(): QueryRules { if (!isset($this->namespace['QueryRules'])) { diff --git a/tests/BuildPHPUnitClass.php b/tests/BuildPHPUnitClass.php index 9a0e47e72..43c162715 100644 --- a/tests/BuildPHPUnitClass.php +++ b/tests/BuildPHPUnitClass.php @@ -303,7 +303,7 @@ protected function match(array $actions): string break; case 'array': case 'object': - if (empty($value)) { + if (empty((array) $value)) { $output .= sprintf("\$this->assertEmpty(%s);\n", $key); } else { $output .= sprintf("\$this->assertEquals(%s, %s);\n", var_export($value, true), $key);