@@ -25,43 +25,43 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Simulate extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Simulates running ingest with example documents. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html |
|
| 32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | - * |
|
| 34 | - * @param array{ |
|
| 35 | - * index: string, // Default index for docs which don't provide one |
|
| 36 | - * pipeline: string, // The pipeline id to preprocess incoming documents with if no pipeline is given for a particular document |
|
| 37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | - * body: array, // (REQUIRED) The simulate definition |
|
| 43 | - * } $params |
|
| 44 | - * |
|
| 45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | - * |
|
| 49 | - * @return Elasticsearch|Promise |
|
| 50 | - */ |
|
| 51 | - public function ingest(array $params = []) |
|
| 52 | - { |
|
| 53 | - $this->checkRequiredParameters(['body'], $params); |
|
| 54 | - if (isset($params['index'])) { |
|
| 55 | - $url = '/_ingest/' . $this->encode($params['index']) . '/_simulate'; |
|
| 56 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 57 | - } else { |
|
| 58 | - $url = '/_ingest/_simulate'; |
|
| 59 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 60 | - } |
|
| 61 | - $url = $this->addQueryString($url, $params, ['pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 62 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 63 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 64 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'simulate.ingest'); |
|
| 65 | - return $this->client->sendRequest($request); |
|
| 66 | - } |
|
| 28 | + /** |
|
| 29 | + * Simulates running ingest with example documents. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html |
|
| 32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | + * |
|
| 34 | + * @param array{ |
|
| 35 | + * index: string, // Default index for docs which don't provide one |
|
| 36 | + * pipeline: string, // The pipeline id to preprocess incoming documents with if no pipeline is given for a particular document |
|
| 37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | + * body: array, // (REQUIRED) The simulate definition |
|
| 43 | + * } $params |
|
| 44 | + * |
|
| 45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | + * |
|
| 49 | + * @return Elasticsearch|Promise |
|
| 50 | + */ |
|
| 51 | + public function ingest(array $params = []) |
|
| 52 | + { |
|
| 53 | + $this->checkRequiredParameters(['body'], $params); |
|
| 54 | + if (isset($params['index'])) { |
|
| 55 | + $url = '/_ingest/' . $this->encode($params['index']) . '/_simulate'; |
|
| 56 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 57 | + } else { |
|
| 58 | + $url = '/_ingest/_simulate'; |
|
| 59 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 60 | + } |
|
| 61 | + $url = $this->addQueryString($url, $params, ['pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 62 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 63 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 64 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'simulate.ingest'); |
|
| 65 | + return $this->client->sendRequest($request); |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -25,569 +25,569 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Cluster extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Provides explanations for shard allocations in the cluster. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * master_timeout: time, // Timeout for connection to master node |
|
| 35 | - * include_yes_decisions: boolean, // Return 'YES' decisions in explanation (default: false) |
|
| 36 | - * include_disk_info: boolean, // Return information about disk usage and shard sizes (default: false) |
|
| 37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | - * body: array, // The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard' |
|
| 43 | - * } $params |
|
| 44 | - * |
|
| 45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | - * |
|
| 49 | - * @return Elasticsearch|Promise |
|
| 50 | - */ |
|
| 51 | - public function allocationExplain(array $params = []) |
|
| 52 | - { |
|
| 53 | - $url = '/_cluster/allocation/explain'; |
|
| 54 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 55 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 56 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 57 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 58 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.allocation_explain'); |
|
| 59 | - return $this->client->sendRequest($request); |
|
| 60 | - } |
|
| 61 | - /** |
|
| 62 | - * Deletes a component template |
|
| 63 | - * |
|
| 64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 65 | - * |
|
| 66 | - * @param array{ |
|
| 67 | - * name: string, // (REQUIRED) The name of the template |
|
| 68 | - * timeout: time, // Explicit operation timeout |
|
| 69 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | - * } $params |
|
| 76 | - * |
|
| 77 | - * @throws MissingParameterException if a required parameter is missing |
|
| 78 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 79 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 80 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 81 | - * |
|
| 82 | - * @return Elasticsearch|Promise |
|
| 83 | - */ |
|
| 84 | - public function deleteComponentTemplate(array $params = []) |
|
| 85 | - { |
|
| 86 | - $this->checkRequiredParameters(['name'], $params); |
|
| 87 | - $url = '/_component_template/' . $this->encode($params['name']); |
|
| 88 | - $method = 'DELETE'; |
|
| 89 | - $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 90 | - $headers = ['Accept' => 'application/json']; |
|
| 91 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 92 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.delete_component_template'); |
|
| 93 | - return $this->client->sendRequest($request); |
|
| 94 | - } |
|
| 95 | - /** |
|
| 96 | - * Clears cluster voting config exclusions. |
|
| 97 | - * |
|
| 98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html |
|
| 99 | - * |
|
| 100 | - * @param array{ |
|
| 101 | - * wait_for_removal: boolean, // Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. |
|
| 102 | - * master_timeout: time, // Timeout for submitting request to master |
|
| 103 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 104 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 105 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 106 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 107 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 108 | - * } $params |
|
| 109 | - * |
|
| 110 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 111 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 112 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 113 | - * |
|
| 114 | - * @return Elasticsearch|Promise |
|
| 115 | - */ |
|
| 116 | - public function deleteVotingConfigExclusions(array $params = []) |
|
| 117 | - { |
|
| 118 | - $url = '/_cluster/voting_config_exclusions'; |
|
| 119 | - $method = 'DELETE'; |
|
| 120 | - $url = $this->addQueryString($url, $params, ['wait_for_removal', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 121 | - $headers = ['Accept' => 'application/json']; |
|
| 122 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 123 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.delete_voting_config_exclusions'); |
|
| 124 | - return $this->client->sendRequest($request); |
|
| 125 | - } |
|
| 126 | - /** |
|
| 127 | - * Returns information about whether a particular component template exist |
|
| 128 | - * |
|
| 129 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 130 | - * |
|
| 131 | - * @param array{ |
|
| 132 | - * name: string, // (REQUIRED) The name of the template |
|
| 133 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 134 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 135 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 136 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 137 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 138 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 139 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 140 | - * } $params |
|
| 141 | - * |
|
| 142 | - * @throws MissingParameterException if a required parameter is missing |
|
| 143 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 144 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 145 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 146 | - * |
|
| 147 | - * @return Elasticsearch|Promise |
|
| 148 | - */ |
|
| 149 | - public function existsComponentTemplate(array $params = []) |
|
| 150 | - { |
|
| 151 | - $this->checkRequiredParameters(['name'], $params); |
|
| 152 | - $url = '/_component_template/' . $this->encode($params['name']); |
|
| 153 | - $method = 'HEAD'; |
|
| 154 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 155 | - $headers = ['Accept' => 'application/json']; |
|
| 156 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 157 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.exists_component_template'); |
|
| 158 | - return $this->client->sendRequest($request); |
|
| 159 | - } |
|
| 160 | - /** |
|
| 161 | - * Returns one or more component templates |
|
| 162 | - * |
|
| 163 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 164 | - * |
|
| 165 | - * @param array{ |
|
| 166 | - * name: list, // The comma separated names of the component templates |
|
| 167 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 168 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 169 | - * include_defaults: boolean, // Return all default configurations for the component template (default: false) |
|
| 170 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 171 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 172 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 173 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 174 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 175 | - * } $params |
|
| 176 | - * |
|
| 177 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 178 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 179 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 180 | - * |
|
| 181 | - * @return Elasticsearch|Promise |
|
| 182 | - */ |
|
| 183 | - public function getComponentTemplate(array $params = []) |
|
| 184 | - { |
|
| 185 | - if (isset($params['name'])) { |
|
| 186 | - $url = '/_component_template/' . $this->encode($params['name']); |
|
| 187 | - $method = 'GET'; |
|
| 188 | - } else { |
|
| 189 | - $url = '/_component_template'; |
|
| 190 | - $method = 'GET'; |
|
| 191 | - } |
|
| 192 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 193 | - $headers = ['Accept' => 'application/json']; |
|
| 194 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 195 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.get_component_template'); |
|
| 196 | - return $this->client->sendRequest($request); |
|
| 197 | - } |
|
| 198 | - /** |
|
| 199 | - * Returns cluster settings. |
|
| 200 | - * |
|
| 201 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html |
|
| 202 | - * |
|
| 203 | - * @param array{ |
|
| 204 | - * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 205 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 206 | - * timeout: time, // Explicit operation timeout |
|
| 207 | - * include_defaults: boolean, // Whether to return all default clusters setting. |
|
| 208 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 209 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 210 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 211 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 212 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 213 | - * } $params |
|
| 214 | - * |
|
| 215 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 216 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 217 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 218 | - * |
|
| 219 | - * @return Elasticsearch|Promise |
|
| 220 | - */ |
|
| 221 | - public function getSettings(array $params = []) |
|
| 222 | - { |
|
| 223 | - $url = '/_cluster/settings'; |
|
| 224 | - $method = 'GET'; |
|
| 225 | - $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 226 | - $headers = ['Accept' => 'application/json']; |
|
| 227 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 228 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.get_settings'); |
|
| 229 | - return $this->client->sendRequest($request); |
|
| 230 | - } |
|
| 231 | - /** |
|
| 232 | - * Returns basic information about the health of the cluster. |
|
| 233 | - * |
|
| 234 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html |
|
| 235 | - * |
|
| 236 | - * @param array{ |
|
| 237 | - * index: list, // Limit the information returned to a specific index |
|
| 238 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 239 | - * level: enum, // Specify the level of detail for returned information |
|
| 240 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 241 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 242 | - * timeout: time, // Explicit operation timeout |
|
| 243 | - * wait_for_active_shards: string, // Wait until the specified number of shards is active |
|
| 244 | - * wait_for_nodes: string, // Wait until the specified number of nodes is available |
|
| 245 | - * wait_for_events: enum, // Wait until all currently queued events with the given priority are processed |
|
| 246 | - * wait_for_no_relocating_shards: boolean, // Whether to wait until there are no relocating shards in the cluster |
|
| 247 | - * wait_for_no_initializing_shards: boolean, // Whether to wait until there are no initializing shards in the cluster |
|
| 248 | - * wait_for_status: enum, // Wait until cluster is in a specific state |
|
| 249 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 250 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 251 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 252 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 253 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 254 | - * } $params |
|
| 255 | - * |
|
| 256 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 257 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 258 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 259 | - * |
|
| 260 | - * @return Elasticsearch|Promise |
|
| 261 | - */ |
|
| 262 | - public function health(array $params = []) |
|
| 263 | - { |
|
| 264 | - if (isset($params['index'])) { |
|
| 265 | - $url = '/_cluster/health/' . $this->encode($params['index']); |
|
| 266 | - $method = 'GET'; |
|
| 267 | - } else { |
|
| 268 | - $url = '/_cluster/health'; |
|
| 269 | - $method = 'GET'; |
|
| 270 | - } |
|
| 271 | - $url = $this->addQueryString($url, $params, ['expand_wildcards', 'level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 272 | - $headers = ['Accept' => 'application/json']; |
|
| 273 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 274 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cluster.health'); |
|
| 275 | - return $this->client->sendRequest($request); |
|
| 276 | - } |
|
| 277 | - /** |
|
| 278 | - * Returns different information about the cluster. |
|
| 279 | - * |
|
| 280 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html |
|
| 281 | - * |
|
| 282 | - * @param array{ |
|
| 283 | - * target: list, // (REQUIRED) Limit the information returned to the specified target. |
|
| 284 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 285 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 286 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 287 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 288 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 289 | - * } $params |
|
| 290 | - * |
|
| 291 | - * @throws MissingParameterException if a required parameter is missing |
|
| 292 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 293 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 294 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 295 | - * |
|
| 296 | - * @return Elasticsearch|Promise |
|
| 297 | - */ |
|
| 298 | - public function info(array $params = []) |
|
| 299 | - { |
|
| 300 | - $this->checkRequiredParameters(['target'], $params); |
|
| 301 | - $url = '/_info/' . $this->encode($params['target']); |
|
| 302 | - $method = 'GET'; |
|
| 303 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 304 | - $headers = ['Accept' => 'application/json']; |
|
| 305 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 306 | - $request = $this->addOtelAttributes($params, ['target'], $request, 'cluster.info'); |
|
| 307 | - return $this->client->sendRequest($request); |
|
| 308 | - } |
|
| 309 | - /** |
|
| 310 | - * Returns a list of any cluster-level changes (e.g. create index, update mapping, |
|
| 311 | - * allocate or fail shard) which have not yet been executed. |
|
| 312 | - * |
|
| 313 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html |
|
| 314 | - * |
|
| 315 | - * @param array{ |
|
| 316 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 317 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 318 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 319 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 320 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 321 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 322 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 323 | - * } $params |
|
| 324 | - * |
|
| 325 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 326 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 327 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 328 | - * |
|
| 329 | - * @return Elasticsearch|Promise |
|
| 330 | - */ |
|
| 331 | - public function pendingTasks(array $params = []) |
|
| 332 | - { |
|
| 333 | - $url = '/_cluster/pending_tasks'; |
|
| 334 | - $method = 'GET'; |
|
| 335 | - $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 336 | - $headers = ['Accept' => 'application/json']; |
|
| 337 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 338 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.pending_tasks'); |
|
| 339 | - return $this->client->sendRequest($request); |
|
| 340 | - } |
|
| 341 | - /** |
|
| 342 | - * Updates the cluster voting config exclusions by node ids or node names. |
|
| 343 | - * |
|
| 344 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html |
|
| 345 | - * |
|
| 346 | - * @param array{ |
|
| 347 | - * 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. |
|
| 348 | - * node_names: string, // A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. |
|
| 349 | - * timeout: time, // Explicit operation timeout |
|
| 350 | - * master_timeout: time, // Timeout for submitting request to master |
|
| 351 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 352 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 353 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 354 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 355 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 356 | - * } $params |
|
| 357 | - * |
|
| 358 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 359 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 360 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 361 | - * |
|
| 362 | - * @return Elasticsearch|Promise |
|
| 363 | - */ |
|
| 364 | - public function postVotingConfigExclusions(array $params = []) |
|
| 365 | - { |
|
| 366 | - $url = '/_cluster/voting_config_exclusions'; |
|
| 367 | - $method = 'POST'; |
|
| 368 | - $url = $this->addQueryString($url, $params, ['node_ids', 'node_names', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 369 | - $headers = ['Accept' => 'application/json']; |
|
| 370 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 371 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.post_voting_config_exclusions'); |
|
| 372 | - return $this->client->sendRequest($request); |
|
| 373 | - } |
|
| 374 | - /** |
|
| 375 | - * Creates or updates a component template |
|
| 376 | - * |
|
| 377 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 378 | - * |
|
| 379 | - * @param array{ |
|
| 380 | - * name: string, // (REQUIRED) The name of the template |
|
| 381 | - * create: boolean, // Whether the index template should only be added if new or can also replace an existing one |
|
| 382 | - * timeout: time, // Explicit operation timeout |
|
| 383 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 384 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 385 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 386 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 387 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 388 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 389 | - * body: array, // (REQUIRED) The template definition |
|
| 390 | - * } $params |
|
| 391 | - * |
|
| 392 | - * @throws MissingParameterException if a required parameter is missing |
|
| 393 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 394 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 395 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 396 | - * |
|
| 397 | - * @return Elasticsearch|Promise |
|
| 398 | - */ |
|
| 399 | - public function putComponentTemplate(array $params = []) |
|
| 400 | - { |
|
| 401 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 402 | - $url = '/_component_template/' . $this->encode($params['name']); |
|
| 403 | - $method = 'PUT'; |
|
| 404 | - $url = $this->addQueryString($url, $params, ['create', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 405 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 406 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 407 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.put_component_template'); |
|
| 408 | - return $this->client->sendRequest($request); |
|
| 409 | - } |
|
| 410 | - /** |
|
| 411 | - * Updates the cluster settings. |
|
| 412 | - * |
|
| 413 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html |
|
| 414 | - * |
|
| 415 | - * @param array{ |
|
| 416 | - * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 417 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 418 | - * timeout: time, // Explicit operation timeout |
|
| 419 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 420 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 421 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 422 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 423 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 424 | - * body: array, // (REQUIRED) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). |
|
| 425 | - * } $params |
|
| 426 | - * |
|
| 427 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 428 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 429 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 430 | - * |
|
| 431 | - * @return Elasticsearch|Promise |
|
| 432 | - */ |
|
| 433 | - public function putSettings(array $params = []) |
|
| 434 | - { |
|
| 435 | - $this->checkRequiredParameters(['body'], $params); |
|
| 436 | - $url = '/_cluster/settings'; |
|
| 437 | - $method = 'PUT'; |
|
| 438 | - $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 439 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 440 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 441 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.put_settings'); |
|
| 442 | - return $this->client->sendRequest($request); |
|
| 443 | - } |
|
| 444 | - /** |
|
| 445 | - * Returns the information about configured remote clusters. |
|
| 446 | - * |
|
| 447 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html |
|
| 448 | - * |
|
| 449 | - * @param array{ |
|
| 450 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 451 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 452 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 453 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 454 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 455 | - * } $params |
|
| 456 | - * |
|
| 457 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 458 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 459 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 460 | - * |
|
| 461 | - * @return Elasticsearch|Promise |
|
| 462 | - */ |
|
| 463 | - public function remoteInfo(array $params = []) |
|
| 464 | - { |
|
| 465 | - $url = '/_remote/info'; |
|
| 466 | - $method = 'GET'; |
|
| 467 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 468 | - $headers = ['Accept' => 'application/json']; |
|
| 469 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 470 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.remote_info'); |
|
| 471 | - return $this->client->sendRequest($request); |
|
| 472 | - } |
|
| 473 | - /** |
|
| 474 | - * Allows to manually change the allocation of individual shards in the cluster. |
|
| 475 | - * |
|
| 476 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html |
|
| 477 | - * |
|
| 478 | - * @param array{ |
|
| 479 | - * dry_run: boolean, // Simulate the operation only and return the resulting state |
|
| 480 | - * explain: boolean, // Return an explanation of why the commands can or cannot be executed |
|
| 481 | - * retry_failed: boolean, // Retries allocation of shards that are blocked due to too many subsequent allocation failures |
|
| 482 | - * metric: list, // Limit the information returned to the specified metrics. Defaults to all but metadata |
|
| 483 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 484 | - * timeout: time, // Explicit operation timeout |
|
| 485 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 486 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 487 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 488 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 489 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 490 | - * body: array, // The definition of `commands` to perform (`move`, `cancel`, `allocate`) |
|
| 491 | - * } $params |
|
| 492 | - * |
|
| 493 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 494 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 495 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 496 | - * |
|
| 497 | - * @return Elasticsearch|Promise |
|
| 498 | - */ |
|
| 499 | - public function reroute(array $params = []) |
|
| 500 | - { |
|
| 501 | - $url = '/_cluster/reroute'; |
|
| 502 | - $method = 'POST'; |
|
| 503 | - $url = $this->addQueryString($url, $params, ['dry_run', 'explain', 'retry_failed', 'metric', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 504 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 505 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 506 | - $request = $this->addOtelAttributes($params, [], $request, 'cluster.reroute'); |
|
| 507 | - return $this->client->sendRequest($request); |
|
| 508 | - } |
|
| 509 | - /** |
|
| 510 | - * Returns a comprehensive information about the state of the cluster. |
|
| 511 | - * |
|
| 512 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html |
|
| 513 | - * |
|
| 514 | - * @param array{ |
|
| 515 | - * metric: list, // Limit the information returned to the specified metrics |
|
| 516 | - * index: list, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices |
|
| 517 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 518 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 519 | - * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 520 | - * wait_for_metadata_version: number, // Wait for the metadata version to be equal or greater than the specified metadata version |
|
| 521 | - * wait_for_timeout: time, // The maximum time to wait for wait_for_metadata_version before timing out |
|
| 522 | - * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
| 523 | - * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
| 524 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 525 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 526 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 527 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 528 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 529 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 530 | - * } $params |
|
| 531 | - * |
|
| 532 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 533 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 534 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 535 | - * |
|
| 536 | - * @return Elasticsearch|Promise |
|
| 537 | - */ |
|
| 538 | - public function state(array $params = []) |
|
| 539 | - { |
|
| 540 | - if (isset($params['index']) && isset($params['metric'])) { |
|
| 541 | - $url = '/_cluster/state/' . $this->encode($params['metric']) . '/' . $this->encode($params['index']); |
|
| 542 | - $method = 'GET'; |
|
| 543 | - } elseif (isset($params['metric'])) { |
|
| 544 | - $url = '/_cluster/state/' . $this->encode($params['metric']); |
|
| 545 | - $method = 'GET'; |
|
| 546 | - } else { |
|
| 547 | - $url = '/_cluster/state'; |
|
| 548 | - $method = 'GET'; |
|
| 549 | - } |
|
| 550 | - $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'flat_settings', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 551 | - $headers = ['Accept' => 'application/json']; |
|
| 552 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 553 | - $request = $this->addOtelAttributes($params, ['metric', 'index'], $request, 'cluster.state'); |
|
| 554 | - return $this->client->sendRequest($request); |
|
| 555 | - } |
|
| 556 | - /** |
|
| 557 | - * Returns high-level overview of cluster statistics. |
|
| 558 | - * |
|
| 559 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html |
|
| 560 | - * |
|
| 561 | - * @param array{ |
|
| 562 | - * node_id: list, // 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 |
|
| 563 | - * include_remotes: boolean, // Include remote cluster data into the response (default: false) |
|
| 564 | - * timeout: time, // Explicit operation timeout |
|
| 565 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 566 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 567 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 568 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 569 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 570 | - * } $params |
|
| 571 | - * |
|
| 572 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 573 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 574 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 575 | - * |
|
| 576 | - * @return Elasticsearch|Promise |
|
| 577 | - */ |
|
| 578 | - public function stats(array $params = []) |
|
| 579 | - { |
|
| 580 | - if (isset($params['node_id'])) { |
|
| 581 | - $url = '/_cluster/stats/nodes/' . $this->encode($params['node_id']); |
|
| 582 | - $method = 'GET'; |
|
| 583 | - } else { |
|
| 584 | - $url = '/_cluster/stats'; |
|
| 585 | - $method = 'GET'; |
|
| 586 | - } |
|
| 587 | - $url = $this->addQueryString($url, $params, ['include_remotes', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 588 | - $headers = ['Accept' => 'application/json']; |
|
| 589 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 590 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'cluster.stats'); |
|
| 591 | - return $this->client->sendRequest($request); |
|
| 592 | - } |
|
| 28 | + /** |
|
| 29 | + * Provides explanations for shard allocations in the cluster. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * master_timeout: time, // Timeout for connection to master node |
|
| 35 | + * include_yes_decisions: boolean, // Return 'YES' decisions in explanation (default: false) |
|
| 36 | + * include_disk_info: boolean, // Return information about disk usage and shard sizes (default: false) |
|
| 37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | + * body: array, // The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard' |
|
| 43 | + * } $params |
|
| 44 | + * |
|
| 45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | + * |
|
| 49 | + * @return Elasticsearch|Promise |
|
| 50 | + */ |
|
| 51 | + public function allocationExplain(array $params = []) |
|
| 52 | + { |
|
| 53 | + $url = '/_cluster/allocation/explain'; |
|
| 54 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 55 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 56 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 57 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 58 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.allocation_explain'); |
|
| 59 | + return $this->client->sendRequest($request); |
|
| 60 | + } |
|
| 61 | + /** |
|
| 62 | + * Deletes a component template |
|
| 63 | + * |
|
| 64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 65 | + * |
|
| 66 | + * @param array{ |
|
| 67 | + * name: string, // (REQUIRED) The name of the template |
|
| 68 | + * timeout: time, // Explicit operation timeout |
|
| 69 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | + * } $params |
|
| 76 | + * |
|
| 77 | + * @throws MissingParameterException if a required parameter is missing |
|
| 78 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 79 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 80 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 81 | + * |
|
| 82 | + * @return Elasticsearch|Promise |
|
| 83 | + */ |
|
| 84 | + public function deleteComponentTemplate(array $params = []) |
|
| 85 | + { |
|
| 86 | + $this->checkRequiredParameters(['name'], $params); |
|
| 87 | + $url = '/_component_template/' . $this->encode($params['name']); |
|
| 88 | + $method = 'DELETE'; |
|
| 89 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 90 | + $headers = ['Accept' => 'application/json']; |
|
| 91 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 92 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.delete_component_template'); |
|
| 93 | + return $this->client->sendRequest($request); |
|
| 94 | + } |
|
| 95 | + /** |
|
| 96 | + * Clears cluster voting config exclusions. |
|
| 97 | + * |
|
| 98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html |
|
| 99 | + * |
|
| 100 | + * @param array{ |
|
| 101 | + * wait_for_removal: boolean, // Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. |
|
| 102 | + * master_timeout: time, // Timeout for submitting request to master |
|
| 103 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 104 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 105 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 106 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 107 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 108 | + * } $params |
|
| 109 | + * |
|
| 110 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 111 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 112 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 113 | + * |
|
| 114 | + * @return Elasticsearch|Promise |
|
| 115 | + */ |
|
| 116 | + public function deleteVotingConfigExclusions(array $params = []) |
|
| 117 | + { |
|
| 118 | + $url = '/_cluster/voting_config_exclusions'; |
|
| 119 | + $method = 'DELETE'; |
|
| 120 | + $url = $this->addQueryString($url, $params, ['wait_for_removal', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 121 | + $headers = ['Accept' => 'application/json']; |
|
| 122 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 123 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.delete_voting_config_exclusions'); |
|
| 124 | + return $this->client->sendRequest($request); |
|
| 125 | + } |
|
| 126 | + /** |
|
| 127 | + * Returns information about whether a particular component template exist |
|
| 128 | + * |
|
| 129 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 130 | + * |
|
| 131 | + * @param array{ |
|
| 132 | + * name: string, // (REQUIRED) The name of the template |
|
| 133 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 134 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 135 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 136 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 137 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 138 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 139 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 140 | + * } $params |
|
| 141 | + * |
|
| 142 | + * @throws MissingParameterException if a required parameter is missing |
|
| 143 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 144 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 145 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 146 | + * |
|
| 147 | + * @return Elasticsearch|Promise |
|
| 148 | + */ |
|
| 149 | + public function existsComponentTemplate(array $params = []) |
|
| 150 | + { |
|
| 151 | + $this->checkRequiredParameters(['name'], $params); |
|
| 152 | + $url = '/_component_template/' . $this->encode($params['name']); |
|
| 153 | + $method = 'HEAD'; |
|
| 154 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 155 | + $headers = ['Accept' => 'application/json']; |
|
| 156 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 157 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.exists_component_template'); |
|
| 158 | + return $this->client->sendRequest($request); |
|
| 159 | + } |
|
| 160 | + /** |
|
| 161 | + * Returns one or more component templates |
|
| 162 | + * |
|
| 163 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 164 | + * |
|
| 165 | + * @param array{ |
|
| 166 | + * name: list, // The comma separated names of the component templates |
|
| 167 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 168 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 169 | + * include_defaults: boolean, // Return all default configurations for the component template (default: false) |
|
| 170 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 171 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 172 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 173 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 174 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 175 | + * } $params |
|
| 176 | + * |
|
| 177 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 178 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 179 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 180 | + * |
|
| 181 | + * @return Elasticsearch|Promise |
|
| 182 | + */ |
|
| 183 | + public function getComponentTemplate(array $params = []) |
|
| 184 | + { |
|
| 185 | + if (isset($params['name'])) { |
|
| 186 | + $url = '/_component_template/' . $this->encode($params['name']); |
|
| 187 | + $method = 'GET'; |
|
| 188 | + } else { |
|
| 189 | + $url = '/_component_template'; |
|
| 190 | + $method = 'GET'; |
|
| 191 | + } |
|
| 192 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 193 | + $headers = ['Accept' => 'application/json']; |
|
| 194 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 195 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.get_component_template'); |
|
| 196 | + return $this->client->sendRequest($request); |
|
| 197 | + } |
|
| 198 | + /** |
|
| 199 | + * Returns cluster settings. |
|
| 200 | + * |
|
| 201 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html |
|
| 202 | + * |
|
| 203 | + * @param array{ |
|
| 204 | + * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 205 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 206 | + * timeout: time, // Explicit operation timeout |
|
| 207 | + * include_defaults: boolean, // Whether to return all default clusters setting. |
|
| 208 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 209 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 210 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 211 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 212 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 213 | + * } $params |
|
| 214 | + * |
|
| 215 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 216 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 217 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 218 | + * |
|
| 219 | + * @return Elasticsearch|Promise |
|
| 220 | + */ |
|
| 221 | + public function getSettings(array $params = []) |
|
| 222 | + { |
|
| 223 | + $url = '/_cluster/settings'; |
|
| 224 | + $method = 'GET'; |
|
| 225 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'include_defaults', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 226 | + $headers = ['Accept' => 'application/json']; |
|
| 227 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 228 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.get_settings'); |
|
| 229 | + return $this->client->sendRequest($request); |
|
| 230 | + } |
|
| 231 | + /** |
|
| 232 | + * Returns basic information about the health of the cluster. |
|
| 233 | + * |
|
| 234 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html |
|
| 235 | + * |
|
| 236 | + * @param array{ |
|
| 237 | + * index: list, // Limit the information returned to a specific index |
|
| 238 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 239 | + * level: enum, // Specify the level of detail for returned information |
|
| 240 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 241 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 242 | + * timeout: time, // Explicit operation timeout |
|
| 243 | + * wait_for_active_shards: string, // Wait until the specified number of shards is active |
|
| 244 | + * wait_for_nodes: string, // Wait until the specified number of nodes is available |
|
| 245 | + * wait_for_events: enum, // Wait until all currently queued events with the given priority are processed |
|
| 246 | + * wait_for_no_relocating_shards: boolean, // Whether to wait until there are no relocating shards in the cluster |
|
| 247 | + * wait_for_no_initializing_shards: boolean, // Whether to wait until there are no initializing shards in the cluster |
|
| 248 | + * wait_for_status: enum, // Wait until cluster is in a specific state |
|
| 249 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 250 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 251 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 252 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 253 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 254 | + * } $params |
|
| 255 | + * |
|
| 256 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 257 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 258 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 259 | + * |
|
| 260 | + * @return Elasticsearch|Promise |
|
| 261 | + */ |
|
| 262 | + public function health(array $params = []) |
|
| 263 | + { |
|
| 264 | + if (isset($params['index'])) { |
|
| 265 | + $url = '/_cluster/health/' . $this->encode($params['index']); |
|
| 266 | + $method = 'GET'; |
|
| 267 | + } else { |
|
| 268 | + $url = '/_cluster/health'; |
|
| 269 | + $method = 'GET'; |
|
| 270 | + } |
|
| 271 | + $url = $this->addQueryString($url, $params, ['expand_wildcards', 'level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 272 | + $headers = ['Accept' => 'application/json']; |
|
| 273 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 274 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cluster.health'); |
|
| 275 | + return $this->client->sendRequest($request); |
|
| 276 | + } |
|
| 277 | + /** |
|
| 278 | + * Returns different information about the cluster. |
|
| 279 | + * |
|
| 280 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html |
|
| 281 | + * |
|
| 282 | + * @param array{ |
|
| 283 | + * target: list, // (REQUIRED) Limit the information returned to the specified target. |
|
| 284 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 285 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 286 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 287 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 288 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 289 | + * } $params |
|
| 290 | + * |
|
| 291 | + * @throws MissingParameterException if a required parameter is missing |
|
| 292 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 293 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 294 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 295 | + * |
|
| 296 | + * @return Elasticsearch|Promise |
|
| 297 | + */ |
|
| 298 | + public function info(array $params = []) |
|
| 299 | + { |
|
| 300 | + $this->checkRequiredParameters(['target'], $params); |
|
| 301 | + $url = '/_info/' . $this->encode($params['target']); |
|
| 302 | + $method = 'GET'; |
|
| 303 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 304 | + $headers = ['Accept' => 'application/json']; |
|
| 305 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 306 | + $request = $this->addOtelAttributes($params, ['target'], $request, 'cluster.info'); |
|
| 307 | + return $this->client->sendRequest($request); |
|
| 308 | + } |
|
| 309 | + /** |
|
| 310 | + * Returns a list of any cluster-level changes (e.g. create index, update mapping, |
|
| 311 | + * allocate or fail shard) which have not yet been executed. |
|
| 312 | + * |
|
| 313 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html |
|
| 314 | + * |
|
| 315 | + * @param array{ |
|
| 316 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 317 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 318 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 319 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 320 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 321 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 322 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 323 | + * } $params |
|
| 324 | + * |
|
| 325 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 326 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 327 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 328 | + * |
|
| 329 | + * @return Elasticsearch|Promise |
|
| 330 | + */ |
|
| 331 | + public function pendingTasks(array $params = []) |
|
| 332 | + { |
|
| 333 | + $url = '/_cluster/pending_tasks'; |
|
| 334 | + $method = 'GET'; |
|
| 335 | + $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 336 | + $headers = ['Accept' => 'application/json']; |
|
| 337 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 338 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.pending_tasks'); |
|
| 339 | + return $this->client->sendRequest($request); |
|
| 340 | + } |
|
| 341 | + /** |
|
| 342 | + * Updates the cluster voting config exclusions by node ids or node names. |
|
| 343 | + * |
|
| 344 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html |
|
| 345 | + * |
|
| 346 | + * @param array{ |
|
| 347 | + * 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. |
|
| 348 | + * node_names: string, // A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. |
|
| 349 | + * timeout: time, // Explicit operation timeout |
|
| 350 | + * master_timeout: time, // Timeout for submitting request to master |
|
| 351 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 352 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 353 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 354 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 355 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 356 | + * } $params |
|
| 357 | + * |
|
| 358 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 359 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 360 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 361 | + * |
|
| 362 | + * @return Elasticsearch|Promise |
|
| 363 | + */ |
|
| 364 | + public function postVotingConfigExclusions(array $params = []) |
|
| 365 | + { |
|
| 366 | + $url = '/_cluster/voting_config_exclusions'; |
|
| 367 | + $method = 'POST'; |
|
| 368 | + $url = $this->addQueryString($url, $params, ['node_ids', 'node_names', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 369 | + $headers = ['Accept' => 'application/json']; |
|
| 370 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 371 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.post_voting_config_exclusions'); |
|
| 372 | + return $this->client->sendRequest($request); |
|
| 373 | + } |
|
| 374 | + /** |
|
| 375 | + * Creates or updates a component template |
|
| 376 | + * |
|
| 377 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html |
|
| 378 | + * |
|
| 379 | + * @param array{ |
|
| 380 | + * name: string, // (REQUIRED) The name of the template |
|
| 381 | + * create: boolean, // Whether the index template should only be added if new or can also replace an existing one |
|
| 382 | + * timeout: time, // Explicit operation timeout |
|
| 383 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 384 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 385 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 386 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 387 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 388 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 389 | + * body: array, // (REQUIRED) The template definition |
|
| 390 | + * } $params |
|
| 391 | + * |
|
| 392 | + * @throws MissingParameterException if a required parameter is missing |
|
| 393 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 394 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 395 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 396 | + * |
|
| 397 | + * @return Elasticsearch|Promise |
|
| 398 | + */ |
|
| 399 | + public function putComponentTemplate(array $params = []) |
|
| 400 | + { |
|
| 401 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 402 | + $url = '/_component_template/' . $this->encode($params['name']); |
|
| 403 | + $method = 'PUT'; |
|
| 404 | + $url = $this->addQueryString($url, $params, ['create', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 405 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 406 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 407 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cluster.put_component_template'); |
|
| 408 | + return $this->client->sendRequest($request); |
|
| 409 | + } |
|
| 410 | + /** |
|
| 411 | + * Updates the cluster settings. |
|
| 412 | + * |
|
| 413 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html |
|
| 414 | + * |
|
| 415 | + * @param array{ |
|
| 416 | + * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 417 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 418 | + * timeout: time, // Explicit operation timeout |
|
| 419 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 420 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 421 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 422 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 423 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 424 | + * body: array, // (REQUIRED) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). |
|
| 425 | + * } $params |
|
| 426 | + * |
|
| 427 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 428 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 429 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 430 | + * |
|
| 431 | + * @return Elasticsearch|Promise |
|
| 432 | + */ |
|
| 433 | + public function putSettings(array $params = []) |
|
| 434 | + { |
|
| 435 | + $this->checkRequiredParameters(['body'], $params); |
|
| 436 | + $url = '/_cluster/settings'; |
|
| 437 | + $method = 'PUT'; |
|
| 438 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 439 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 440 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 441 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.put_settings'); |
|
| 442 | + return $this->client->sendRequest($request); |
|
| 443 | + } |
|
| 444 | + /** |
|
| 445 | + * Returns the information about configured remote clusters. |
|
| 446 | + * |
|
| 447 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html |
|
| 448 | + * |
|
| 449 | + * @param array{ |
|
| 450 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 451 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 452 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 453 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 454 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 455 | + * } $params |
|
| 456 | + * |
|
| 457 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 458 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 459 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 460 | + * |
|
| 461 | + * @return Elasticsearch|Promise |
|
| 462 | + */ |
|
| 463 | + public function remoteInfo(array $params = []) |
|
| 464 | + { |
|
| 465 | + $url = '/_remote/info'; |
|
| 466 | + $method = 'GET'; |
|
| 467 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 468 | + $headers = ['Accept' => 'application/json']; |
|
| 469 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 470 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.remote_info'); |
|
| 471 | + return $this->client->sendRequest($request); |
|
| 472 | + } |
|
| 473 | + /** |
|
| 474 | + * Allows to manually change the allocation of individual shards in the cluster. |
|
| 475 | + * |
|
| 476 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html |
|
| 477 | + * |
|
| 478 | + * @param array{ |
|
| 479 | + * dry_run: boolean, // Simulate the operation only and return the resulting state |
|
| 480 | + * explain: boolean, // Return an explanation of why the commands can or cannot be executed |
|
| 481 | + * retry_failed: boolean, // Retries allocation of shards that are blocked due to too many subsequent allocation failures |
|
| 482 | + * metric: list, // Limit the information returned to the specified metrics. Defaults to all but metadata |
|
| 483 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 484 | + * timeout: time, // Explicit operation timeout |
|
| 485 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 486 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 487 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 488 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 489 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 490 | + * body: array, // The definition of `commands` to perform (`move`, `cancel`, `allocate`) |
|
| 491 | + * } $params |
|
| 492 | + * |
|
| 493 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 494 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 495 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 496 | + * |
|
| 497 | + * @return Elasticsearch|Promise |
|
| 498 | + */ |
|
| 499 | + public function reroute(array $params = []) |
|
| 500 | + { |
|
| 501 | + $url = '/_cluster/reroute'; |
|
| 502 | + $method = 'POST'; |
|
| 503 | + $url = $this->addQueryString($url, $params, ['dry_run', 'explain', 'retry_failed', 'metric', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 504 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 505 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 506 | + $request = $this->addOtelAttributes($params, [], $request, 'cluster.reroute'); |
|
| 507 | + return $this->client->sendRequest($request); |
|
| 508 | + } |
|
| 509 | + /** |
|
| 510 | + * Returns a comprehensive information about the state of the cluster. |
|
| 511 | + * |
|
| 512 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html |
|
| 513 | + * |
|
| 514 | + * @param array{ |
|
| 515 | + * metric: list, // Limit the information returned to the specified metrics |
|
| 516 | + * index: list, // A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices |
|
| 517 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
| 518 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 519 | + * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 520 | + * wait_for_metadata_version: number, // Wait for the metadata version to be equal or greater than the specified metadata version |
|
| 521 | + * wait_for_timeout: time, // The maximum time to wait for wait_for_metadata_version before timing out |
|
| 522 | + * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
| 523 | + * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
| 524 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 525 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 526 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 527 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 528 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 529 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 530 | + * } $params |
|
| 531 | + * |
|
| 532 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 533 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 534 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 535 | + * |
|
| 536 | + * @return Elasticsearch|Promise |
|
| 537 | + */ |
|
| 538 | + public function state(array $params = []) |
|
| 539 | + { |
|
| 540 | + if (isset($params['index']) && isset($params['metric'])) { |
|
| 541 | + $url = '/_cluster/state/' . $this->encode($params['metric']) . '/' . $this->encode($params['index']); |
|
| 542 | + $method = 'GET'; |
|
| 543 | + } elseif (isset($params['metric'])) { |
|
| 544 | + $url = '/_cluster/state/' . $this->encode($params['metric']); |
|
| 545 | + $method = 'GET'; |
|
| 546 | + } else { |
|
| 547 | + $url = '/_cluster/state'; |
|
| 548 | + $method = 'GET'; |
|
| 549 | + } |
|
| 550 | + $url = $this->addQueryString($url, $params, ['local', 'master_timeout', 'flat_settings', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 551 | + $headers = ['Accept' => 'application/json']; |
|
| 552 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 553 | + $request = $this->addOtelAttributes($params, ['metric', 'index'], $request, 'cluster.state'); |
|
| 554 | + return $this->client->sendRequest($request); |
|
| 555 | + } |
|
| 556 | + /** |
|
| 557 | + * Returns high-level overview of cluster statistics. |
|
| 558 | + * |
|
| 559 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html |
|
| 560 | + * |
|
| 561 | + * @param array{ |
|
| 562 | + * node_id: list, // 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 |
|
| 563 | + * include_remotes: boolean, // Include remote cluster data into the response (default: false) |
|
| 564 | + * timeout: time, // Explicit operation timeout |
|
| 565 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 566 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 567 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 568 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 569 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 570 | + * } $params |
|
| 571 | + * |
|
| 572 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 573 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 574 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 575 | + * |
|
| 576 | + * @return Elasticsearch|Promise |
|
| 577 | + */ |
|
| 578 | + public function stats(array $params = []) |
|
| 579 | + { |
|
| 580 | + if (isset($params['node_id'])) { |
|
| 581 | + $url = '/_cluster/stats/nodes/' . $this->encode($params['node_id']); |
|
| 582 | + $method = 'GET'; |
|
| 583 | + } else { |
|
| 584 | + $url = '/_cluster/stats'; |
|
| 585 | + $method = 'GET'; |
|
| 586 | + } |
|
| 587 | + $url = $this->addQueryString($url, $params, ['include_remotes', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 588 | + $headers = ['Accept' => 'application/json']; |
|
| 589 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 590 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'cluster.stats'); |
|
| 591 | + return $this->client->sendRequest($request); |
|
| 592 | + } |
|
| 593 | 593 | } |
@@ -25,295 +25,295 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Nodes extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Removes the archived repositories metering information present in the cluster. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html |
|
| 32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | - * |
|
| 34 | - * @param array{ |
|
| 35 | - * node_id: list, // (REQUIRED) Comma-separated list of node IDs or names used to limit returned information. |
|
| 36 | - * max_archive_version: long, // (REQUIRED) Specifies the maximum archive_version to be cleared from the archive. |
|
| 37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | - * } $params |
|
| 43 | - * |
|
| 44 | - * @throws MissingParameterException if a required parameter is missing |
|
| 45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | - * |
|
| 49 | - * @return Elasticsearch|Promise |
|
| 50 | - */ |
|
| 51 | - public function clearRepositoriesMeteringArchive(array $params = []) |
|
| 52 | - { |
|
| 53 | - $this->checkRequiredParameters(['node_id', 'max_archive_version'], $params); |
|
| 54 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/_repositories_metering/' . $this->encode($params['max_archive_version']); |
|
| 55 | - $method = 'DELETE'; |
|
| 56 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 57 | - $headers = ['Accept' => 'application/json']; |
|
| 58 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 59 | - $request = $this->addOtelAttributes($params, ['node_id', 'max_archive_version'], $request, 'nodes.clear_repositories_metering_archive'); |
|
| 60 | - return $this->client->sendRequest($request); |
|
| 61 | - } |
|
| 62 | - /** |
|
| 63 | - * Returns cluster repositories metering information. |
|
| 64 | - * |
|
| 65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html |
|
| 66 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 67 | - * |
|
| 68 | - * @param array{ |
|
| 69 | - * node_id: list, // (REQUIRED) A comma-separated list of node IDs or names to limit the returned information. |
|
| 70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | - * } $params |
|
| 76 | - * |
|
| 77 | - * @throws MissingParameterException if a required parameter is missing |
|
| 78 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 79 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 80 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 81 | - * |
|
| 82 | - * @return Elasticsearch|Promise |
|
| 83 | - */ |
|
| 84 | - public function getRepositoriesMeteringInfo(array $params = []) |
|
| 85 | - { |
|
| 86 | - $this->checkRequiredParameters(['node_id'], $params); |
|
| 87 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/_repositories_metering'; |
|
| 88 | - $method = 'GET'; |
|
| 89 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 90 | - $headers = ['Accept' => 'application/json']; |
|
| 91 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 92 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.get_repositories_metering_info'); |
|
| 93 | - return $this->client->sendRequest($request); |
|
| 94 | - } |
|
| 95 | - /** |
|
| 96 | - * Returns information about hot threads on each node in the cluster. |
|
| 97 | - * |
|
| 98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html |
|
| 99 | - * |
|
| 100 | - * @param array{ |
|
| 101 | - * node_id: list, // 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 |
|
| 102 | - * interval: time, // The interval for the second sampling of threads |
|
| 103 | - * snapshots: number, // Number of samples of thread stacktrace (default: 10) |
|
| 104 | - * threads: number, // Specify the number of threads to provide information for (default: 3) |
|
| 105 | - * ignore_idle_threads: boolean, // Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) |
|
| 106 | - * type: enum, // The type to sample (default: cpu) |
|
| 107 | - * sort: enum, // The sort order for 'cpu' type (default: total) |
|
| 108 | - * timeout: time, // Explicit operation timeout |
|
| 109 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 110 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 111 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 112 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 113 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 114 | - * } $params |
|
| 115 | - * |
|
| 116 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 117 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 118 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 119 | - * |
|
| 120 | - * @return Elasticsearch|Promise |
|
| 121 | - */ |
|
| 122 | - public function hotThreads(array $params = []) |
|
| 123 | - { |
|
| 124 | - if (isset($params['node_id'])) { |
|
| 125 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/hot_threads'; |
|
| 126 | - $method = 'GET'; |
|
| 127 | - } else { |
|
| 128 | - $url = '/_nodes/hot_threads'; |
|
| 129 | - $method = 'GET'; |
|
| 130 | - } |
|
| 131 | - $url = $this->addQueryString($url, $params, ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'sort', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 132 | - $headers = ['Accept' => 'text/plain']; |
|
| 133 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 134 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.hot_threads'); |
|
| 135 | - return $this->client->sendRequest($request); |
|
| 136 | - } |
|
| 137 | - /** |
|
| 138 | - * Returns information about nodes in the cluster. |
|
| 139 | - * |
|
| 140 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html |
|
| 141 | - * |
|
| 142 | - * @param array{ |
|
| 143 | - * node_id: list, // 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 |
|
| 144 | - * metric: list, // A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics. |
|
| 145 | - * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 146 | - * timeout: time, // Explicit operation timeout |
|
| 147 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 148 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 149 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 150 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 151 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 152 | - * } $params |
|
| 153 | - * |
|
| 154 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 155 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 156 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 157 | - * |
|
| 158 | - * @return Elasticsearch|Promise |
|
| 159 | - */ |
|
| 160 | - public function info(array $params = []) |
|
| 161 | - { |
|
| 162 | - if (isset($params['node_id']) && isset($params['metric'])) { |
|
| 163 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/' . $this->encode($params['metric']); |
|
| 164 | - $method = 'GET'; |
|
| 165 | - } elseif (isset($params['node_id'])) { |
|
| 166 | - $url = '/_nodes/' . $this->encode($params['node_id']); |
|
| 167 | - $method = 'GET'; |
|
| 168 | - } elseif (isset($params['metric'])) { |
|
| 169 | - $url = '/_nodes/' . $this->encode($params['metric']); |
|
| 170 | - $method = 'GET'; |
|
| 171 | - } else { |
|
| 172 | - $url = '/_nodes'; |
|
| 173 | - $method = 'GET'; |
|
| 174 | - } |
|
| 175 | - $url = $this->addQueryString($url, $params, ['flat_settings', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 176 | - $headers = ['Accept' => 'application/json']; |
|
| 177 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 178 | - $request = $this->addOtelAttributes($params, ['node_id', 'metric'], $request, 'nodes.info'); |
|
| 179 | - return $this->client->sendRequest($request); |
|
| 180 | - } |
|
| 181 | - /** |
|
| 182 | - * Reloads secure settings. |
|
| 183 | - * |
|
| 184 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings |
|
| 185 | - * |
|
| 186 | - * @param array{ |
|
| 187 | - * node_id: list, // A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. |
|
| 188 | - * timeout: time, // Explicit operation timeout |
|
| 189 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 190 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 191 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 192 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 193 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 194 | - * body: array, // An object containing the password for the elasticsearch keystore |
|
| 195 | - * } $params |
|
| 196 | - * |
|
| 197 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 198 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 199 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 200 | - * |
|
| 201 | - * @return Elasticsearch|Promise |
|
| 202 | - */ |
|
| 203 | - public function reloadSecureSettings(array $params = []) |
|
| 204 | - { |
|
| 205 | - if (isset($params['node_id'])) { |
|
| 206 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/reload_secure_settings'; |
|
| 207 | - $method = 'POST'; |
|
| 208 | - } else { |
|
| 209 | - $url = '/_nodes/reload_secure_settings'; |
|
| 210 | - $method = 'POST'; |
|
| 211 | - } |
|
| 212 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 213 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 214 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 215 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.reload_secure_settings'); |
|
| 216 | - return $this->client->sendRequest($request); |
|
| 217 | - } |
|
| 218 | - /** |
|
| 219 | - * Returns statistical information about nodes in the cluster. |
|
| 220 | - * |
|
| 221 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html |
|
| 222 | - * |
|
| 223 | - * @param array{ |
|
| 224 | - * node_id: list, // 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 |
|
| 225 | - * metric: list, // Limit the information returned to the specified metrics |
|
| 226 | - * index_metric: list, // Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. |
|
| 227 | - * completion_fields: list, // A comma-separated list of fields for the `completion` index metric (supports wildcards) |
|
| 228 | - * fielddata_fields: list, // A comma-separated list of fields for the `fielddata` index metric (supports wildcards) |
|
| 229 | - * fields: list, // A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) |
|
| 230 | - * groups: boolean, // A comma-separated list of search groups for `search` index metric |
|
| 231 | - * level: enum, // Return indices stats aggregated at index, node or shard level |
|
| 232 | - * types: list, // A comma-separated list of document types for the `indexing` index metric |
|
| 233 | - * timeout: time, // Explicit operation timeout |
|
| 234 | - * include_segment_file_sizes: boolean, // Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) |
|
| 235 | - * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
| 236 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 237 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 238 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 239 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 240 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 241 | - * } $params |
|
| 242 | - * |
|
| 243 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 244 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 245 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 246 | - * |
|
| 247 | - * @return Elasticsearch|Promise |
|
| 248 | - */ |
|
| 249 | - public function stats(array $params = []) |
|
| 250 | - { |
|
| 251 | - if (isset($params['metric']) && isset($params['index_metric']) && isset($params['node_id'])) { |
|
| 252 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats/' . $this->encode($params['metric']) . '/' . $this->encode($params['index_metric']); |
|
| 253 | - $method = 'GET'; |
|
| 254 | - } elseif (isset($params['metric']) && isset($params['node_id'])) { |
|
| 255 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats/' . $this->encode($params['metric']); |
|
| 256 | - $method = 'GET'; |
|
| 257 | - } elseif (isset($params['metric']) && isset($params['index_metric'])) { |
|
| 258 | - $url = '/_nodes/stats/' . $this->encode($params['metric']) . '/' . $this->encode($params['index_metric']); |
|
| 259 | - $method = 'GET'; |
|
| 260 | - } elseif (isset($params['node_id'])) { |
|
| 261 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats'; |
|
| 262 | - $method = 'GET'; |
|
| 263 | - } elseif (isset($params['metric'])) { |
|
| 264 | - $url = '/_nodes/stats/' . $this->encode($params['metric']); |
|
| 265 | - $method = 'GET'; |
|
| 266 | - } else { |
|
| 267 | - $url = '/_nodes/stats'; |
|
| 268 | - $method = 'GET'; |
|
| 269 | - } |
|
| 270 | - $url = $this->addQueryString($url, $params, ['completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'timeout', 'include_segment_file_sizes', 'include_unloaded_segments', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 271 | - $headers = ['Accept' => 'application/json']; |
|
| 272 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 273 | - $request = $this->addOtelAttributes($params, ['node_id', 'metric', 'index_metric'], $request, 'nodes.stats'); |
|
| 274 | - return $this->client->sendRequest($request); |
|
| 275 | - } |
|
| 276 | - /** |
|
| 277 | - * Returns low-level information about REST actions usage on nodes. |
|
| 278 | - * |
|
| 279 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html |
|
| 280 | - * |
|
| 281 | - * @param array{ |
|
| 282 | - * node_id: list, // 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 |
|
| 283 | - * metric: list, // Limit the information returned to the specified metrics |
|
| 284 | - * timeout: time, // Explicit operation timeout |
|
| 285 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 286 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 287 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 288 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 289 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 290 | - * } $params |
|
| 291 | - * |
|
| 292 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 293 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 294 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 295 | - * |
|
| 296 | - * @return Elasticsearch|Promise |
|
| 297 | - */ |
|
| 298 | - public function usage(array $params = []) |
|
| 299 | - { |
|
| 300 | - if (isset($params['metric']) && isset($params['node_id'])) { |
|
| 301 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/usage/' . $this->encode($params['metric']); |
|
| 302 | - $method = 'GET'; |
|
| 303 | - } elseif (isset($params['node_id'])) { |
|
| 304 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/usage'; |
|
| 305 | - $method = 'GET'; |
|
| 306 | - } elseif (isset($params['metric'])) { |
|
| 307 | - $url = '/_nodes/usage/' . $this->encode($params['metric']); |
|
| 308 | - $method = 'GET'; |
|
| 309 | - } else { |
|
| 310 | - $url = '/_nodes/usage'; |
|
| 311 | - $method = 'GET'; |
|
| 312 | - } |
|
| 313 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 314 | - $headers = ['Accept' => 'application/json']; |
|
| 315 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 316 | - $request = $this->addOtelAttributes($params, ['node_id', 'metric'], $request, 'nodes.usage'); |
|
| 317 | - return $this->client->sendRequest($request); |
|
| 318 | - } |
|
| 28 | + /** |
|
| 29 | + * Removes the archived repositories metering information present in the cluster. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html |
|
| 32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | + * |
|
| 34 | + * @param array{ |
|
| 35 | + * node_id: list, // (REQUIRED) Comma-separated list of node IDs or names used to limit returned information. |
|
| 36 | + * max_archive_version: long, // (REQUIRED) Specifies the maximum archive_version to be cleared from the archive. |
|
| 37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 42 | + * } $params |
|
| 43 | + * |
|
| 44 | + * @throws MissingParameterException if a required parameter is missing |
|
| 45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 48 | + * |
|
| 49 | + * @return Elasticsearch|Promise |
|
| 50 | + */ |
|
| 51 | + public function clearRepositoriesMeteringArchive(array $params = []) |
|
| 52 | + { |
|
| 53 | + $this->checkRequiredParameters(['node_id', 'max_archive_version'], $params); |
|
| 54 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/_repositories_metering/' . $this->encode($params['max_archive_version']); |
|
| 55 | + $method = 'DELETE'; |
|
| 56 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 57 | + $headers = ['Accept' => 'application/json']; |
|
| 58 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 59 | + $request = $this->addOtelAttributes($params, ['node_id', 'max_archive_version'], $request, 'nodes.clear_repositories_metering_archive'); |
|
| 60 | + return $this->client->sendRequest($request); |
|
| 61 | + } |
|
| 62 | + /** |
|
| 63 | + * Returns cluster repositories metering information. |
|
| 64 | + * |
|
| 65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html |
|
| 66 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 67 | + * |
|
| 68 | + * @param array{ |
|
| 69 | + * node_id: list, // (REQUIRED) A comma-separated list of node IDs or names to limit the returned information. |
|
| 70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | + * } $params |
|
| 76 | + * |
|
| 77 | + * @throws MissingParameterException if a required parameter is missing |
|
| 78 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 79 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 80 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 81 | + * |
|
| 82 | + * @return Elasticsearch|Promise |
|
| 83 | + */ |
|
| 84 | + public function getRepositoriesMeteringInfo(array $params = []) |
|
| 85 | + { |
|
| 86 | + $this->checkRequiredParameters(['node_id'], $params); |
|
| 87 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/_repositories_metering'; |
|
| 88 | + $method = 'GET'; |
|
| 89 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 90 | + $headers = ['Accept' => 'application/json']; |
|
| 91 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 92 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.get_repositories_metering_info'); |
|
| 93 | + return $this->client->sendRequest($request); |
|
| 94 | + } |
|
| 95 | + /** |
|
| 96 | + * Returns information about hot threads on each node in the cluster. |
|
| 97 | + * |
|
| 98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html |
|
| 99 | + * |
|
| 100 | + * @param array{ |
|
| 101 | + * node_id: list, // 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 |
|
| 102 | + * interval: time, // The interval for the second sampling of threads |
|
| 103 | + * snapshots: number, // Number of samples of thread stacktrace (default: 10) |
|
| 104 | + * threads: number, // Specify the number of threads to provide information for (default: 3) |
|
| 105 | + * ignore_idle_threads: boolean, // Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) |
|
| 106 | + * type: enum, // The type to sample (default: cpu) |
|
| 107 | + * sort: enum, // The sort order for 'cpu' type (default: total) |
|
| 108 | + * timeout: time, // Explicit operation timeout |
|
| 109 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 110 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 111 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 112 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 113 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 114 | + * } $params |
|
| 115 | + * |
|
| 116 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 117 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 118 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 119 | + * |
|
| 120 | + * @return Elasticsearch|Promise |
|
| 121 | + */ |
|
| 122 | + public function hotThreads(array $params = []) |
|
| 123 | + { |
|
| 124 | + if (isset($params['node_id'])) { |
|
| 125 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/hot_threads'; |
|
| 126 | + $method = 'GET'; |
|
| 127 | + } else { |
|
| 128 | + $url = '/_nodes/hot_threads'; |
|
| 129 | + $method = 'GET'; |
|
| 130 | + } |
|
| 131 | + $url = $this->addQueryString($url, $params, ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'sort', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 132 | + $headers = ['Accept' => 'text/plain']; |
|
| 133 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 134 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.hot_threads'); |
|
| 135 | + return $this->client->sendRequest($request); |
|
| 136 | + } |
|
| 137 | + /** |
|
| 138 | + * Returns information about nodes in the cluster. |
|
| 139 | + * |
|
| 140 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html |
|
| 141 | + * |
|
| 142 | + * @param array{ |
|
| 143 | + * node_id: list, // 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 |
|
| 144 | + * metric: list, // A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics. |
|
| 145 | + * flat_settings: boolean, // Return settings in flat format (default: false) |
|
| 146 | + * timeout: time, // Explicit operation timeout |
|
| 147 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 148 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 149 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 150 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 151 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 152 | + * } $params |
|
| 153 | + * |
|
| 154 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 155 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 156 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 157 | + * |
|
| 158 | + * @return Elasticsearch|Promise |
|
| 159 | + */ |
|
| 160 | + public function info(array $params = []) |
|
| 161 | + { |
|
| 162 | + if (isset($params['node_id']) && isset($params['metric'])) { |
|
| 163 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/' . $this->encode($params['metric']); |
|
| 164 | + $method = 'GET'; |
|
| 165 | + } elseif (isset($params['node_id'])) { |
|
| 166 | + $url = '/_nodes/' . $this->encode($params['node_id']); |
|
| 167 | + $method = 'GET'; |
|
| 168 | + } elseif (isset($params['metric'])) { |
|
| 169 | + $url = '/_nodes/' . $this->encode($params['metric']); |
|
| 170 | + $method = 'GET'; |
|
| 171 | + } else { |
|
| 172 | + $url = '/_nodes'; |
|
| 173 | + $method = 'GET'; |
|
| 174 | + } |
|
| 175 | + $url = $this->addQueryString($url, $params, ['flat_settings', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 176 | + $headers = ['Accept' => 'application/json']; |
|
| 177 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 178 | + $request = $this->addOtelAttributes($params, ['node_id', 'metric'], $request, 'nodes.info'); |
|
| 179 | + return $this->client->sendRequest($request); |
|
| 180 | + } |
|
| 181 | + /** |
|
| 182 | + * Reloads secure settings. |
|
| 183 | + * |
|
| 184 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings |
|
| 185 | + * |
|
| 186 | + * @param array{ |
|
| 187 | + * node_id: list, // A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. |
|
| 188 | + * timeout: time, // Explicit operation timeout |
|
| 189 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 190 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 191 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 192 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 193 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 194 | + * body: array, // An object containing the password for the elasticsearch keystore |
|
| 195 | + * } $params |
|
| 196 | + * |
|
| 197 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 198 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 199 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 200 | + * |
|
| 201 | + * @return Elasticsearch|Promise |
|
| 202 | + */ |
|
| 203 | + public function reloadSecureSettings(array $params = []) |
|
| 204 | + { |
|
| 205 | + if (isset($params['node_id'])) { |
|
| 206 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/reload_secure_settings'; |
|
| 207 | + $method = 'POST'; |
|
| 208 | + } else { |
|
| 209 | + $url = '/_nodes/reload_secure_settings'; |
|
| 210 | + $method = 'POST'; |
|
| 211 | + } |
|
| 212 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 213 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 214 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 215 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'nodes.reload_secure_settings'); |
|
| 216 | + return $this->client->sendRequest($request); |
|
| 217 | + } |
|
| 218 | + /** |
|
| 219 | + * Returns statistical information about nodes in the cluster. |
|
| 220 | + * |
|
| 221 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html |
|
| 222 | + * |
|
| 223 | + * @param array{ |
|
| 224 | + * node_id: list, // 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 |
|
| 225 | + * metric: list, // Limit the information returned to the specified metrics |
|
| 226 | + * index_metric: list, // Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. |
|
| 227 | + * completion_fields: list, // A comma-separated list of fields for the `completion` index metric (supports wildcards) |
|
| 228 | + * fielddata_fields: list, // A comma-separated list of fields for the `fielddata` index metric (supports wildcards) |
|
| 229 | + * fields: list, // A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) |
|
| 230 | + * groups: boolean, // A comma-separated list of search groups for `search` index metric |
|
| 231 | + * level: enum, // Return indices stats aggregated at index, node or shard level |
|
| 232 | + * types: list, // A comma-separated list of document types for the `indexing` index metric |
|
| 233 | + * timeout: time, // Explicit operation timeout |
|
| 234 | + * include_segment_file_sizes: boolean, // Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) |
|
| 235 | + * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
| 236 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 237 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 238 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 239 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 240 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 241 | + * } $params |
|
| 242 | + * |
|
| 243 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 244 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 245 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 246 | + * |
|
| 247 | + * @return Elasticsearch|Promise |
|
| 248 | + */ |
|
| 249 | + public function stats(array $params = []) |
|
| 250 | + { |
|
| 251 | + if (isset($params['metric']) && isset($params['index_metric']) && isset($params['node_id'])) { |
|
| 252 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats/' . $this->encode($params['metric']) . '/' . $this->encode($params['index_metric']); |
|
| 253 | + $method = 'GET'; |
|
| 254 | + } elseif (isset($params['metric']) && isset($params['node_id'])) { |
|
| 255 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats/' . $this->encode($params['metric']); |
|
| 256 | + $method = 'GET'; |
|
| 257 | + } elseif (isset($params['metric']) && isset($params['index_metric'])) { |
|
| 258 | + $url = '/_nodes/stats/' . $this->encode($params['metric']) . '/' . $this->encode($params['index_metric']); |
|
| 259 | + $method = 'GET'; |
|
| 260 | + } elseif (isset($params['node_id'])) { |
|
| 261 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/stats'; |
|
| 262 | + $method = 'GET'; |
|
| 263 | + } elseif (isset($params['metric'])) { |
|
| 264 | + $url = '/_nodes/stats/' . $this->encode($params['metric']); |
|
| 265 | + $method = 'GET'; |
|
| 266 | + } else { |
|
| 267 | + $url = '/_nodes/stats'; |
|
| 268 | + $method = 'GET'; |
|
| 269 | + } |
|
| 270 | + $url = $this->addQueryString($url, $params, ['completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'timeout', 'include_segment_file_sizes', 'include_unloaded_segments', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 271 | + $headers = ['Accept' => 'application/json']; |
|
| 272 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 273 | + $request = $this->addOtelAttributes($params, ['node_id', 'metric', 'index_metric'], $request, 'nodes.stats'); |
|
| 274 | + return $this->client->sendRequest($request); |
|
| 275 | + } |
|
| 276 | + /** |
|
| 277 | + * Returns low-level information about REST actions usage on nodes. |
|
| 278 | + * |
|
| 279 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html |
|
| 280 | + * |
|
| 281 | + * @param array{ |
|
| 282 | + * node_id: list, // 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 |
|
| 283 | + * metric: list, // Limit the information returned to the specified metrics |
|
| 284 | + * timeout: time, // Explicit operation timeout |
|
| 285 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 286 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 287 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 288 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 289 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 290 | + * } $params |
|
| 291 | + * |
|
| 292 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 293 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 294 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 295 | + * |
|
| 296 | + * @return Elasticsearch|Promise |
|
| 297 | + */ |
|
| 298 | + public function usage(array $params = []) |
|
| 299 | + { |
|
| 300 | + if (isset($params['metric']) && isset($params['node_id'])) { |
|
| 301 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/usage/' . $this->encode($params['metric']); |
|
| 302 | + $method = 'GET'; |
|
| 303 | + } elseif (isset($params['node_id'])) { |
|
| 304 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/usage'; |
|
| 305 | + $method = 'GET'; |
|
| 306 | + } elseif (isset($params['metric'])) { |
|
| 307 | + $url = '/_nodes/usage/' . $this->encode($params['metric']); |
|
| 308 | + $method = 'GET'; |
|
| 309 | + } else { |
|
| 310 | + $url = '/_nodes/usage'; |
|
| 311 | + $method = 'GET'; |
|
| 312 | + } |
|
| 313 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 314 | + $headers = ['Accept' => 'application/json']; |
|
| 315 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 316 | + $request = $this->addOtelAttributes($params, ['node_id', 'metric'], $request, 'nodes.usage'); |
|
| 317 | + return $this->client->sendRequest($request); |
|
| 318 | + } |
|
| 319 | 319 | } |
@@ -25,2598 +25,2598 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Ml extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Clear the cached results from a trained model deployment |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | - * } $params |
|
| 41 | - * |
|
| 42 | - * @throws MissingParameterException if a required parameter is missing |
|
| 43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | - * |
|
| 47 | - * @return Elasticsearch|Promise |
|
| 48 | - */ |
|
| 49 | - public function clearTrainedModelDeploymentCache(array $params = []) |
|
| 50 | - { |
|
| 51 | - $this->checkRequiredParameters(['model_id'], $params); |
|
| 52 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/cache/_clear'; |
|
| 53 | - $method = 'POST'; |
|
| 54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 55 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 57 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.clear_trained_model_deployment_cache'); |
|
| 58 | - return $this->client->sendRequest($request); |
|
| 59 | - } |
|
| 60 | - /** |
|
| 61 | - * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. |
|
| 62 | - * |
|
| 63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html |
|
| 64 | - * |
|
| 65 | - * @param array{ |
|
| 66 | - * job_id: string, // (REQUIRED) The name of the job to close |
|
| 67 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 68 | - * force: boolean, // True if the job should be forcefully closed |
|
| 69 | - * timeout: time, // Controls the time to wait until a job has closed. Default to 30 minutes |
|
| 70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | - * body: array, // The URL params optionally sent in the body |
|
| 76 | - * } $params |
|
| 77 | - * |
|
| 78 | - * @throws MissingParameterException if a required parameter is missing |
|
| 79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | - * |
|
| 83 | - * @return Elasticsearch|Promise |
|
| 84 | - */ |
|
| 85 | - public function closeJob(array $params = []) |
|
| 86 | - { |
|
| 87 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 88 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
| 89 | - $method = 'POST'; |
|
| 90 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 92 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 93 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.close_job'); |
|
| 94 | - return $this->client->sendRequest($request); |
|
| 95 | - } |
|
| 96 | - /** |
|
| 97 | - * Deletes a calendar. |
|
| 98 | - * |
|
| 99 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html |
|
| 100 | - * |
|
| 101 | - * @param array{ |
|
| 102 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to delete |
|
| 103 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 104 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 105 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 106 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 107 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 108 | - * } $params |
|
| 109 | - * |
|
| 110 | - * @throws MissingParameterException if a required parameter is missing |
|
| 111 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 112 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 113 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 114 | - * |
|
| 115 | - * @return Elasticsearch|Promise |
|
| 116 | - */ |
|
| 117 | - public function deleteCalendar(array $params = []) |
|
| 118 | - { |
|
| 119 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 120 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 121 | - $method = 'DELETE'; |
|
| 122 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 123 | - $headers = ['Accept' => 'application/json']; |
|
| 124 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 125 | - $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.delete_calendar'); |
|
| 126 | - return $this->client->sendRequest($request); |
|
| 127 | - } |
|
| 128 | - /** |
|
| 129 | - * Deletes scheduled events from a calendar. |
|
| 130 | - * |
|
| 131 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html |
|
| 132 | - * |
|
| 133 | - * @param array{ |
|
| 134 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 135 | - * event_id: string, // (REQUIRED) The ID of the event to remove from the calendar |
|
| 136 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 137 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 138 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 139 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 140 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 141 | - * } $params |
|
| 142 | - * |
|
| 143 | - * @throws MissingParameterException if a required parameter is missing |
|
| 144 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 145 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 146 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 147 | - * |
|
| 148 | - * @return Elasticsearch|Promise |
|
| 149 | - */ |
|
| 150 | - public function deleteCalendarEvent(array $params = []) |
|
| 151 | - { |
|
| 152 | - $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
|
| 153 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
| 154 | - $method = 'DELETE'; |
|
| 155 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 156 | - $headers = ['Accept' => 'application/json']; |
|
| 157 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 158 | - $request = $this->addOtelAttributes($params, ['calendar_id', 'event_id'], $request, 'ml.delete_calendar_event'); |
|
| 159 | - return $this->client->sendRequest($request); |
|
| 160 | - } |
|
| 161 | - /** |
|
| 162 | - * Deletes anomaly detection jobs from a calendar. |
|
| 163 | - * |
|
| 164 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html |
|
| 165 | - * |
|
| 166 | - * @param array{ |
|
| 167 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 168 | - * job_id: string, // (REQUIRED) The ID of the job to remove from the calendar |
|
| 169 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 170 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 171 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 172 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 173 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 174 | - * } $params |
|
| 175 | - * |
|
| 176 | - * @throws MissingParameterException if a required parameter is missing |
|
| 177 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 178 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 179 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 180 | - * |
|
| 181 | - * @return Elasticsearch|Promise |
|
| 182 | - */ |
|
| 183 | - public function deleteCalendarJob(array $params = []) |
|
| 184 | - { |
|
| 185 | - $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
| 186 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 187 | - $method = 'DELETE'; |
|
| 188 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 189 | - $headers = ['Accept' => 'application/json']; |
|
| 190 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 191 | - $request = $this->addOtelAttributes($params, ['calendar_id', 'job_id'], $request, 'ml.delete_calendar_job'); |
|
| 192 | - return $this->client->sendRequest($request); |
|
| 193 | - } |
|
| 194 | - /** |
|
| 195 | - * Deletes an existing data frame analytics job. |
|
| 196 | - * |
|
| 197 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html |
|
| 198 | - * |
|
| 199 | - * @param array{ |
|
| 200 | - * id: string, // (REQUIRED) The ID of the data frame analytics to delete |
|
| 201 | - * force: boolean, // True if the job should be forcefully deleted |
|
| 202 | - * timeout: time, // Controls the time to wait until a job is deleted. Defaults to 1 minute |
|
| 203 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 204 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 205 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 206 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 207 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 208 | - * } $params |
|
| 209 | - * |
|
| 210 | - * @throws MissingParameterException if a required parameter is missing |
|
| 211 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 212 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 213 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 214 | - * |
|
| 215 | - * @return Elasticsearch|Promise |
|
| 216 | - */ |
|
| 217 | - public function deleteDataFrameAnalytics(array $params = []) |
|
| 218 | - { |
|
| 219 | - $this->checkRequiredParameters(['id'], $params); |
|
| 220 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 221 | - $method = 'DELETE'; |
|
| 222 | - $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 223 | - $headers = ['Accept' => 'application/json']; |
|
| 224 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 225 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.delete_data_frame_analytics'); |
|
| 226 | - return $this->client->sendRequest($request); |
|
| 227 | - } |
|
| 228 | - /** |
|
| 229 | - * Deletes an existing datafeed. |
|
| 230 | - * |
|
| 231 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html |
|
| 232 | - * |
|
| 233 | - * @param array{ |
|
| 234 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to delete |
|
| 235 | - * force: boolean, // True if the datafeed should be forcefully deleted |
|
| 236 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 237 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 238 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 239 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 240 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 241 | - * } $params |
|
| 242 | - * |
|
| 243 | - * @throws MissingParameterException if a required parameter is missing |
|
| 244 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 245 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 246 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 247 | - * |
|
| 248 | - * @return Elasticsearch|Promise |
|
| 249 | - */ |
|
| 250 | - public function deleteDatafeed(array $params = []) |
|
| 251 | - { |
|
| 252 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 253 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 254 | - $method = 'DELETE'; |
|
| 255 | - $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 256 | - $headers = ['Accept' => 'application/json']; |
|
| 257 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 258 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.delete_datafeed'); |
|
| 259 | - return $this->client->sendRequest($request); |
|
| 260 | - } |
|
| 261 | - /** |
|
| 262 | - * Deletes expired and unused machine learning data. |
|
| 263 | - * |
|
| 264 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html |
|
| 265 | - * |
|
| 266 | - * @param array{ |
|
| 267 | - * job_id: string, // The ID of the job(s) to perform expired data hygiene for |
|
| 268 | - * requests_per_second: number, // The desired requests per second for the deletion processes. |
|
| 269 | - * timeout: time, // How long can the underlying delete processes run until they are canceled |
|
| 270 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 271 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 272 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 273 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 274 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 275 | - * body: array, // deleting expired data parameters |
|
| 276 | - * } $params |
|
| 277 | - * |
|
| 278 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 279 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 280 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 281 | - * |
|
| 282 | - * @return Elasticsearch|Promise |
|
| 283 | - */ |
|
| 284 | - public function deleteExpiredData(array $params = []) |
|
| 285 | - { |
|
| 286 | - if (isset($params['job_id'])) { |
|
| 287 | - $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
| 288 | - $method = 'DELETE'; |
|
| 289 | - } else { |
|
| 290 | - $url = '/_ml/_delete_expired_data'; |
|
| 291 | - $method = 'DELETE'; |
|
| 292 | - } |
|
| 293 | - $url = $this->addQueryString($url, $params, ['requests_per_second', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 294 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 295 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 296 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.delete_expired_data'); |
|
| 297 | - return $this->client->sendRequest($request); |
|
| 298 | - } |
|
| 299 | - /** |
|
| 300 | - * Deletes a filter. |
|
| 301 | - * |
|
| 302 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html |
|
| 303 | - * |
|
| 304 | - * @param array{ |
|
| 305 | - * filter_id: string, // (REQUIRED) The ID of the filter to delete |
|
| 306 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 307 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 308 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 309 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 310 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 311 | - * } $params |
|
| 312 | - * |
|
| 313 | - * @throws MissingParameterException if a required parameter is missing |
|
| 314 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 315 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 316 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 317 | - * |
|
| 318 | - * @return Elasticsearch|Promise |
|
| 319 | - */ |
|
| 320 | - public function deleteFilter(array $params = []) |
|
| 321 | - { |
|
| 322 | - $this->checkRequiredParameters(['filter_id'], $params); |
|
| 323 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 324 | - $method = 'DELETE'; |
|
| 325 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 326 | - $headers = ['Accept' => 'application/json']; |
|
| 327 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 328 | - $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.delete_filter'); |
|
| 329 | - return $this->client->sendRequest($request); |
|
| 330 | - } |
|
| 331 | - /** |
|
| 332 | - * Deletes forecasts from a machine learning job. |
|
| 333 | - * |
|
| 334 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html |
|
| 335 | - * |
|
| 336 | - * @param array{ |
|
| 337 | - * job_id: string, // (REQUIRED) The ID of the job from which to delete forecasts |
|
| 338 | - * forecast_id: string, // The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` |
|
| 339 | - * allow_no_forecasts: boolean, // Whether to ignore if `_all` matches no forecasts |
|
| 340 | - * timeout: time, // Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds |
|
| 341 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 342 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 343 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 344 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 345 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 346 | - * } $params |
|
| 347 | - * |
|
| 348 | - * @throws MissingParameterException if a required parameter is missing |
|
| 349 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 350 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 351 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 352 | - * |
|
| 353 | - * @return Elasticsearch|Promise |
|
| 354 | - */ |
|
| 355 | - public function deleteForecast(array $params = []) |
|
| 356 | - { |
|
| 357 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 358 | - if (isset($params['forecast_id'])) { |
|
| 359 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
| 360 | - $method = 'DELETE'; |
|
| 361 | - } else { |
|
| 362 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 363 | - $method = 'DELETE'; |
|
| 364 | - } |
|
| 365 | - $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 366 | - $headers = ['Accept' => 'application/json']; |
|
| 367 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 368 | - $request = $this->addOtelAttributes($params, ['job_id', 'forecast_id'], $request, 'ml.delete_forecast'); |
|
| 369 | - return $this->client->sendRequest($request); |
|
| 370 | - } |
|
| 371 | - /** |
|
| 372 | - * Deletes an existing anomaly detection job. |
|
| 373 | - * |
|
| 374 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html |
|
| 375 | - * |
|
| 376 | - * @param array{ |
|
| 377 | - * job_id: string, // (REQUIRED) The ID of the job to delete |
|
| 378 | - * force: boolean, // True if the job should be forcefully deleted |
|
| 379 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 380 | - * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
| 381 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 382 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 383 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 384 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 385 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 386 | - * } $params |
|
| 387 | - * |
|
| 388 | - * @throws MissingParameterException if a required parameter is missing |
|
| 389 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 390 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 391 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 392 | - * |
|
| 393 | - * @return Elasticsearch|Promise |
|
| 394 | - */ |
|
| 395 | - public function deleteJob(array $params = []) |
|
| 396 | - { |
|
| 397 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 398 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 399 | - $method = 'DELETE'; |
|
| 400 | - $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 401 | - $headers = ['Accept' => 'application/json']; |
|
| 402 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 403 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.delete_job'); |
|
| 404 | - return $this->client->sendRequest($request); |
|
| 405 | - } |
|
| 406 | - /** |
|
| 407 | - * Deletes an existing model snapshot. |
|
| 408 | - * |
|
| 409 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html |
|
| 410 | - * |
|
| 411 | - * @param array{ |
|
| 412 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 413 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to delete |
|
| 414 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 415 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 416 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 417 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 418 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 419 | - * } $params |
|
| 420 | - * |
|
| 421 | - * @throws MissingParameterException if a required parameter is missing |
|
| 422 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 423 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 424 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 425 | - * |
|
| 426 | - * @return Elasticsearch|Promise |
|
| 427 | - */ |
|
| 428 | - public function deleteModelSnapshot(array $params = []) |
|
| 429 | - { |
|
| 430 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 431 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 432 | - $method = 'DELETE'; |
|
| 433 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 434 | - $headers = ['Accept' => 'application/json']; |
|
| 435 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 436 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.delete_model_snapshot'); |
|
| 437 | - return $this->client->sendRequest($request); |
|
| 438 | - } |
|
| 439 | - /** |
|
| 440 | - * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. |
|
| 441 | - * |
|
| 442 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html |
|
| 443 | - * |
|
| 444 | - * @param array{ |
|
| 445 | - * model_id: string, // (REQUIRED) The ID of the trained model to delete |
|
| 446 | - * timeout: time, // Controls the amount of time to wait for the model to be deleted. |
|
| 447 | - * force: boolean, // True if the model should be forcefully deleted |
|
| 448 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 449 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 450 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 451 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 452 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 453 | - * } $params |
|
| 454 | - * |
|
| 455 | - * @throws MissingParameterException if a required parameter is missing |
|
| 456 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 457 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 458 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 459 | - * |
|
| 460 | - * @return Elasticsearch|Promise |
|
| 461 | - */ |
|
| 462 | - public function deleteTrainedModel(array $params = []) |
|
| 463 | - { |
|
| 464 | - $this->checkRequiredParameters(['model_id'], $params); |
|
| 465 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 466 | - $method = 'DELETE'; |
|
| 467 | - $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 468 | - $headers = ['Accept' => 'application/json']; |
|
| 469 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 470 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.delete_trained_model'); |
|
| 471 | - return $this->client->sendRequest($request); |
|
| 472 | - } |
|
| 473 | - /** |
|
| 474 | - * Deletes a model alias that refers to the trained model |
|
| 475 | - * |
|
| 476 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html |
|
| 477 | - * |
|
| 478 | - * @param array{ |
|
| 479 | - * model_alias: string, // (REQUIRED) The trained model alias to delete |
|
| 480 | - * model_id: string, // (REQUIRED) The trained model where the model alias is assigned |
|
| 481 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 482 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 483 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 484 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 485 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 486 | - * } $params |
|
| 487 | - * |
|
| 488 | - * @throws MissingParameterException if a required parameter is missing |
|
| 489 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 490 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 491 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 492 | - * |
|
| 493 | - * @return Elasticsearch|Promise |
|
| 494 | - */ |
|
| 495 | - public function deleteTrainedModelAlias(array $params = []) |
|
| 496 | - { |
|
| 497 | - $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
| 498 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 499 | - $method = 'DELETE'; |
|
| 500 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 501 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 502 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 503 | - $request = $this->addOtelAttributes($params, ['model_alias', 'model_id'], $request, 'ml.delete_trained_model_alias'); |
|
| 504 | - return $this->client->sendRequest($request); |
|
| 505 | - } |
|
| 506 | - /** |
|
| 507 | - * Estimates the model memory |
|
| 508 | - * |
|
| 509 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html |
|
| 510 | - * |
|
| 511 | - * @param array{ |
|
| 512 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 513 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 514 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 515 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 516 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 517 | - * body: array, // (REQUIRED) The analysis config, plus cardinality estimates for fields it references |
|
| 518 | - * } $params |
|
| 519 | - * |
|
| 520 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 521 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 522 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 523 | - * |
|
| 524 | - * @return Elasticsearch|Promise |
|
| 525 | - */ |
|
| 526 | - public function estimateModelMemory(array $params = []) |
|
| 527 | - { |
|
| 528 | - $this->checkRequiredParameters(['body'], $params); |
|
| 529 | - $url = '/_ml/anomaly_detectors/_estimate_model_memory'; |
|
| 530 | - $method = 'POST'; |
|
| 531 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 532 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 533 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 534 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.estimate_model_memory'); |
|
| 535 | - return $this->client->sendRequest($request); |
|
| 536 | - } |
|
| 537 | - /** |
|
| 538 | - * Evaluates the data frame analytics for an annotated index. |
|
| 539 | - * |
|
| 540 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html |
|
| 541 | - * |
|
| 542 | - * @param array{ |
|
| 543 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 544 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 545 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 546 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 547 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 548 | - * body: array, // (REQUIRED) The evaluation definition |
|
| 549 | - * } $params |
|
| 550 | - * |
|
| 551 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 552 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 553 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 554 | - * |
|
| 555 | - * @return Elasticsearch|Promise |
|
| 556 | - */ |
|
| 557 | - public function evaluateDataFrame(array $params = []) |
|
| 558 | - { |
|
| 559 | - $this->checkRequiredParameters(['body'], $params); |
|
| 560 | - $url = '/_ml/data_frame/_evaluate'; |
|
| 561 | - $method = 'POST'; |
|
| 562 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 563 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 564 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 565 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.evaluate_data_frame'); |
|
| 566 | - return $this->client->sendRequest($request); |
|
| 567 | - } |
|
| 568 | - /** |
|
| 569 | - * Explains a data frame analytics config. |
|
| 570 | - * |
|
| 571 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html |
|
| 572 | - * |
|
| 573 | - * @param array{ |
|
| 574 | - * id: string, // The ID of the data frame analytics to explain |
|
| 575 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 576 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 577 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 578 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 579 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 580 | - * body: array, // The data frame analytics config to explain |
|
| 581 | - * } $params |
|
| 582 | - * |
|
| 583 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 584 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 585 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 586 | - * |
|
| 587 | - * @return Elasticsearch|Promise |
|
| 588 | - */ |
|
| 589 | - public function explainDataFrameAnalytics(array $params = []) |
|
| 590 | - { |
|
| 591 | - if (isset($params['id'])) { |
|
| 592 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
| 593 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 594 | - } else { |
|
| 595 | - $url = '/_ml/data_frame/analytics/_explain'; |
|
| 596 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 597 | - } |
|
| 598 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 599 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 600 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 601 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.explain_data_frame_analytics'); |
|
| 602 | - return $this->client->sendRequest($request); |
|
| 603 | - } |
|
| 604 | - /** |
|
| 605 | - * Forces any buffered data to be processed by the job. |
|
| 606 | - * |
|
| 607 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html |
|
| 608 | - * |
|
| 609 | - * @param array{ |
|
| 610 | - * job_id: string, // (REQUIRED) The name of the job to flush |
|
| 611 | - * calc_interim: boolean, // Calculates interim results for the most recent bucket or all buckets within the latency period |
|
| 612 | - * start: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
| 613 | - * end: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
| 614 | - * advance_time: string, // Advances time to the given value generating results and updating the model for the advanced interval |
|
| 615 | - * skip_time: string, // Skips time to the given value without generating results or updating the model for the skipped interval |
|
| 616 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 617 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 618 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 619 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 620 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 621 | - * body: array, // Flush parameters |
|
| 622 | - * } $params |
|
| 623 | - * |
|
| 624 | - * @throws MissingParameterException if a required parameter is missing |
|
| 625 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 626 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 627 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 628 | - * |
|
| 629 | - * @return Elasticsearch|Promise |
|
| 630 | - */ |
|
| 631 | - public function flushJob(array $params = []) |
|
| 632 | - { |
|
| 633 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 634 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
| 635 | - $method = 'POST'; |
|
| 636 | - $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 637 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 638 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 639 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.flush_job'); |
|
| 640 | - return $this->client->sendRequest($request); |
|
| 641 | - } |
|
| 642 | - /** |
|
| 643 | - * Predicts the future behavior of a time series by using its historical behavior. |
|
| 644 | - * |
|
| 645 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html |
|
| 646 | - * |
|
| 647 | - * @param array{ |
|
| 648 | - * job_id: string, // (REQUIRED) The ID of the job to forecast for |
|
| 649 | - * duration: time, // The duration of the forecast |
|
| 650 | - * expires_in: time, // The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. |
|
| 651 | - * max_model_memory: string, // The max memory able to be used by the forecast. Default is 20mb. |
|
| 652 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 653 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 654 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 655 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 656 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 657 | - * body: array, // Query parameters can be specified in the body |
|
| 658 | - * } $params |
|
| 659 | - * |
|
| 660 | - * @throws MissingParameterException if a required parameter is missing |
|
| 661 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 662 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 663 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 664 | - * |
|
| 665 | - * @return Elasticsearch|Promise |
|
| 666 | - */ |
|
| 667 | - public function forecast(array $params = []) |
|
| 668 | - { |
|
| 669 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 670 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 671 | - $method = 'POST'; |
|
| 672 | - $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 673 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 674 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 675 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.forecast'); |
|
| 676 | - return $this->client->sendRequest($request); |
|
| 677 | - } |
|
| 678 | - /** |
|
| 679 | - * Retrieves anomaly detection job results for one or more buckets. |
|
| 680 | - * |
|
| 681 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html |
|
| 682 | - * |
|
| 683 | - * @param array{ |
|
| 684 | - * job_id: string, // (REQUIRED) ID of the job to get bucket results from |
|
| 685 | - * timestamp: string, // The timestamp of the desired single bucket result |
|
| 686 | - * expand: boolean, // Include anomaly records |
|
| 687 | - * exclude_interim: boolean, // Exclude interim results |
|
| 688 | - * from: int, // skips a number of buckets |
|
| 689 | - * size: int, // specifies a max number of buckets to get |
|
| 690 | - * start: string, // Start time filter for buckets |
|
| 691 | - * end: string, // End time filter for buckets |
|
| 692 | - * anomaly_score: double, // Filter for the most anomalous buckets |
|
| 693 | - * sort: string, // Sort buckets by a particular field |
|
| 694 | - * desc: boolean, // Set the sort direction |
|
| 695 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 696 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 697 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 698 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 699 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 700 | - * body: array, // Bucket selection details if not provided in URI |
|
| 701 | - * } $params |
|
| 702 | - * |
|
| 703 | - * @throws MissingParameterException if a required parameter is missing |
|
| 704 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 705 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 706 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 707 | - * |
|
| 708 | - * @return Elasticsearch|Promise |
|
| 709 | - */ |
|
| 710 | - public function getBuckets(array $params = []) |
|
| 711 | - { |
|
| 712 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 713 | - if (isset($params['timestamp'])) { |
|
| 714 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
| 715 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 716 | - } else { |
|
| 717 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
| 718 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 719 | - } |
|
| 720 | - $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 721 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 722 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 723 | - $request = $this->addOtelAttributes($params, ['job_id', 'timestamp'], $request, 'ml.get_buckets'); |
|
| 724 | - return $this->client->sendRequest($request); |
|
| 725 | - } |
|
| 726 | - /** |
|
| 727 | - * Retrieves information about the scheduled events in calendars. |
|
| 728 | - * |
|
| 729 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html |
|
| 730 | - * |
|
| 731 | - * @param array{ |
|
| 732 | - * calendar_id: string, // (REQUIRED) The ID of the calendar containing the events |
|
| 733 | - * job_id: string, // Get events for the job. When this option is used calendar_id must be '_all' |
|
| 734 | - * start: string, // Get events after this time |
|
| 735 | - * end: date, // Get events before this time |
|
| 736 | - * from: int, // Skips a number of events |
|
| 737 | - * size: int, // Specifies a max number of events to get |
|
| 738 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 739 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 740 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 741 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 742 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 743 | - * } $params |
|
| 744 | - * |
|
| 745 | - * @throws MissingParameterException if a required parameter is missing |
|
| 746 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 747 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 748 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 749 | - * |
|
| 750 | - * @return Elasticsearch|Promise |
|
| 751 | - */ |
|
| 752 | - public function getCalendarEvents(array $params = []) |
|
| 753 | - { |
|
| 754 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 755 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 756 | - $method = 'GET'; |
|
| 757 | - $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 758 | - $headers = ['Accept' => 'application/json']; |
|
| 759 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 760 | - $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.get_calendar_events'); |
|
| 761 | - return $this->client->sendRequest($request); |
|
| 762 | - } |
|
| 763 | - /** |
|
| 764 | - * Retrieves configuration information for calendars. |
|
| 765 | - * |
|
| 766 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html |
|
| 767 | - * |
|
| 768 | - * @param array{ |
|
| 769 | - * calendar_id: string, // The ID of the calendar to fetch |
|
| 770 | - * from: int, // skips a number of calendars |
|
| 771 | - * size: int, // specifies a max number of calendars to get |
|
| 772 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 773 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 774 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 775 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 776 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 777 | - * body: array, // The from and size parameters optionally sent in the body |
|
| 778 | - * } $params |
|
| 779 | - * |
|
| 780 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 781 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 782 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 783 | - * |
|
| 784 | - * @return Elasticsearch|Promise |
|
| 785 | - */ |
|
| 786 | - public function getCalendars(array $params = []) |
|
| 787 | - { |
|
| 788 | - if (isset($params['calendar_id'])) { |
|
| 789 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 790 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 791 | - } else { |
|
| 792 | - $url = '/_ml/calendars'; |
|
| 793 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 794 | - } |
|
| 795 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 796 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 797 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 798 | - $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.get_calendars'); |
|
| 799 | - return $this->client->sendRequest($request); |
|
| 800 | - } |
|
| 801 | - /** |
|
| 802 | - * Retrieves anomaly detection job results for one or more categories. |
|
| 803 | - * |
|
| 804 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html |
|
| 805 | - * |
|
| 806 | - * @param array{ |
|
| 807 | - * job_id: string, // (REQUIRED) The name of the job |
|
| 808 | - * category_id: long, // The identifier of the category definition of interest |
|
| 809 | - * from: int, // skips a number of categories |
|
| 810 | - * size: int, // specifies a max number of categories to get |
|
| 811 | - * partition_field_value: string, // Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled. |
|
| 812 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 813 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 814 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 815 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 816 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 817 | - * body: array, // Category selection details if not provided in URI |
|
| 818 | - * } $params |
|
| 819 | - * |
|
| 820 | - * @throws MissingParameterException if a required parameter is missing |
|
| 821 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 822 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 823 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 824 | - * |
|
| 825 | - * @return Elasticsearch|Promise |
|
| 826 | - */ |
|
| 827 | - public function getCategories(array $params = []) |
|
| 828 | - { |
|
| 829 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 830 | - if (isset($params['category_id'])) { |
|
| 831 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
| 832 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 833 | - } else { |
|
| 834 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories'; |
|
| 835 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 836 | - } |
|
| 837 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 838 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 839 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 840 | - $request = $this->addOtelAttributes($params, ['job_id', 'category_id'], $request, 'ml.get_categories'); |
|
| 841 | - return $this->client->sendRequest($request); |
|
| 842 | - } |
|
| 843 | - /** |
|
| 844 | - * Retrieves configuration information for data frame analytics jobs. |
|
| 845 | - * |
|
| 846 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html |
|
| 847 | - * |
|
| 848 | - * @param array{ |
|
| 849 | - * id: string, // The ID of the data frame analytics to fetch |
|
| 850 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 851 | - * from: int, // skips a number of analytics |
|
| 852 | - * size: int, // specifies a max number of analytics to get |
|
| 853 | - * exclude_generated: boolean, // Omits fields that are illegal to set on data frame analytics PUT |
|
| 854 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 855 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 856 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 857 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 858 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 859 | - * } $params |
|
| 860 | - * |
|
| 861 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 862 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 863 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 864 | - * |
|
| 865 | - * @return Elasticsearch|Promise |
|
| 866 | - */ |
|
| 867 | - public function getDataFrameAnalytics(array $params = []) |
|
| 868 | - { |
|
| 869 | - if (isset($params['id'])) { |
|
| 870 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 871 | - $method = 'GET'; |
|
| 872 | - } else { |
|
| 873 | - $url = '/_ml/data_frame/analytics'; |
|
| 874 | - $method = 'GET'; |
|
| 875 | - } |
|
| 876 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 877 | - $headers = ['Accept' => 'application/json']; |
|
| 878 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 879 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.get_data_frame_analytics'); |
|
| 880 | - return $this->client->sendRequest($request); |
|
| 881 | - } |
|
| 882 | - /** |
|
| 883 | - * Retrieves usage information for data frame analytics jobs. |
|
| 884 | - * |
|
| 885 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html |
|
| 886 | - * |
|
| 887 | - * @param array{ |
|
| 888 | - * id: string, // The ID of the data frame analytics stats to fetch |
|
| 889 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 890 | - * from: int, // skips a number of analytics |
|
| 891 | - * size: int, // specifies a max number of analytics to get |
|
| 892 | - * verbose: boolean, // whether the stats response should be verbose |
|
| 893 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 894 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 895 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 896 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 897 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 898 | - * } $params |
|
| 899 | - * |
|
| 900 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 901 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 902 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 903 | - * |
|
| 904 | - * @return Elasticsearch|Promise |
|
| 905 | - */ |
|
| 906 | - public function getDataFrameAnalyticsStats(array $params = []) |
|
| 907 | - { |
|
| 908 | - if (isset($params['id'])) { |
|
| 909 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
| 910 | - $method = 'GET'; |
|
| 911 | - } else { |
|
| 912 | - $url = '/_ml/data_frame/analytics/_stats'; |
|
| 913 | - $method = 'GET'; |
|
| 914 | - } |
|
| 915 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 916 | - $headers = ['Accept' => 'application/json']; |
|
| 917 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 918 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.get_data_frame_analytics_stats'); |
|
| 919 | - return $this->client->sendRequest($request); |
|
| 920 | - } |
|
| 921 | - /** |
|
| 922 | - * Retrieves usage information for datafeeds. |
|
| 923 | - * |
|
| 924 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html |
|
| 925 | - * |
|
| 926 | - * @param array{ |
|
| 927 | - * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
| 928 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 929 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 930 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 931 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 932 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 933 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 934 | - * } $params |
|
| 935 | - * |
|
| 936 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 937 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 938 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 939 | - * |
|
| 940 | - * @return Elasticsearch|Promise |
|
| 941 | - */ |
|
| 942 | - public function getDatafeedStats(array $params = []) |
|
| 943 | - { |
|
| 944 | - if (isset($params['datafeed_id'])) { |
|
| 945 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
| 946 | - $method = 'GET'; |
|
| 947 | - } else { |
|
| 948 | - $url = '/_ml/datafeeds/_stats'; |
|
| 949 | - $method = 'GET'; |
|
| 950 | - } |
|
| 951 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 952 | - $headers = ['Accept' => 'application/json']; |
|
| 953 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 954 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.get_datafeed_stats'); |
|
| 955 | - return $this->client->sendRequest($request); |
|
| 956 | - } |
|
| 957 | - /** |
|
| 958 | - * Retrieves configuration information for datafeeds. |
|
| 959 | - * |
|
| 960 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html |
|
| 961 | - * |
|
| 962 | - * @param array{ |
|
| 963 | - * datafeed_id: string, // The ID of the datafeeds to fetch |
|
| 964 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 965 | - * exclude_generated: boolean, // Omits fields that are illegal to set on datafeed PUT |
|
| 966 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 967 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 968 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 969 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 970 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 971 | - * } $params |
|
| 972 | - * |
|
| 973 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 974 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 975 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 976 | - * |
|
| 977 | - * @return Elasticsearch|Promise |
|
| 978 | - */ |
|
| 979 | - public function getDatafeeds(array $params = []) |
|
| 980 | - { |
|
| 981 | - if (isset($params['datafeed_id'])) { |
|
| 982 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 983 | - $method = 'GET'; |
|
| 984 | - } else { |
|
| 985 | - $url = '/_ml/datafeeds'; |
|
| 986 | - $method = 'GET'; |
|
| 987 | - } |
|
| 988 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 989 | - $headers = ['Accept' => 'application/json']; |
|
| 990 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 991 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.get_datafeeds'); |
|
| 992 | - return $this->client->sendRequest($request); |
|
| 993 | - } |
|
| 994 | - /** |
|
| 995 | - * Retrieves filters. |
|
| 996 | - * |
|
| 997 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html |
|
| 998 | - * |
|
| 999 | - * @param array{ |
|
| 1000 | - * filter_id: string, // The ID of the filter to fetch |
|
| 1001 | - * from: int, // skips a number of filters |
|
| 1002 | - * size: int, // specifies a max number of filters to get |
|
| 1003 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1004 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1005 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1006 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1007 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1008 | - * } $params |
|
| 1009 | - * |
|
| 1010 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1011 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1012 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1013 | - * |
|
| 1014 | - * @return Elasticsearch|Promise |
|
| 1015 | - */ |
|
| 1016 | - public function getFilters(array $params = []) |
|
| 1017 | - { |
|
| 1018 | - if (isset($params['filter_id'])) { |
|
| 1019 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1020 | - $method = 'GET'; |
|
| 1021 | - } else { |
|
| 1022 | - $url = '/_ml/filters'; |
|
| 1023 | - $method = 'GET'; |
|
| 1024 | - } |
|
| 1025 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1026 | - $headers = ['Accept' => 'application/json']; |
|
| 1027 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1028 | - $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.get_filters'); |
|
| 1029 | - return $this->client->sendRequest($request); |
|
| 1030 | - } |
|
| 1031 | - /** |
|
| 1032 | - * Retrieves anomaly detection job results for one or more influencers. |
|
| 1033 | - * |
|
| 1034 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html |
|
| 1035 | - * |
|
| 1036 | - * @param array{ |
|
| 1037 | - * job_id: string, // (REQUIRED) Identifier for the anomaly detection job |
|
| 1038 | - * exclude_interim: boolean, // Exclude interim results |
|
| 1039 | - * from: int, // skips a number of influencers |
|
| 1040 | - * size: int, // specifies a max number of influencers to get |
|
| 1041 | - * start: string, // start timestamp for the requested influencers |
|
| 1042 | - * end: string, // end timestamp for the requested influencers |
|
| 1043 | - * influencer_score: double, // influencer score threshold for the requested influencers |
|
| 1044 | - * sort: string, // sort field for the requested influencers |
|
| 1045 | - * desc: boolean, // whether the results should be sorted in decending order |
|
| 1046 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1047 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1048 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1049 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1050 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1051 | - * body: array, // Influencer selection criteria |
|
| 1052 | - * } $params |
|
| 1053 | - * |
|
| 1054 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1055 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1056 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1057 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1058 | - * |
|
| 1059 | - * @return Elasticsearch|Promise |
|
| 1060 | - */ |
|
| 1061 | - public function getInfluencers(array $params = []) |
|
| 1062 | - { |
|
| 1063 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 1064 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
| 1065 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1066 | - $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1067 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1068 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1069 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_influencers'); |
|
| 1070 | - return $this->client->sendRequest($request); |
|
| 1071 | - } |
|
| 1072 | - /** |
|
| 1073 | - * Retrieves usage information for anomaly detection jobs. |
|
| 1074 | - * |
|
| 1075 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html |
|
| 1076 | - * |
|
| 1077 | - * @param array{ |
|
| 1078 | - * job_id: string, // The ID of the jobs stats to fetch |
|
| 1079 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1080 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1081 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1082 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1083 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1084 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1085 | - * } $params |
|
| 1086 | - * |
|
| 1087 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1088 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1089 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1090 | - * |
|
| 1091 | - * @return Elasticsearch|Promise |
|
| 1092 | - */ |
|
| 1093 | - public function getJobStats(array $params = []) |
|
| 1094 | - { |
|
| 1095 | - if (isset($params['job_id'])) { |
|
| 1096 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
| 1097 | - $method = 'GET'; |
|
| 1098 | - } else { |
|
| 1099 | - $url = '/_ml/anomaly_detectors/_stats'; |
|
| 1100 | - $method = 'GET'; |
|
| 1101 | - } |
|
| 1102 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1103 | - $headers = ['Accept' => 'application/json']; |
|
| 1104 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1105 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_job_stats'); |
|
| 1106 | - return $this->client->sendRequest($request); |
|
| 1107 | - } |
|
| 1108 | - /** |
|
| 1109 | - * Retrieves configuration information for anomaly detection jobs. |
|
| 1110 | - * |
|
| 1111 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html |
|
| 1112 | - * |
|
| 1113 | - * @param array{ |
|
| 1114 | - * job_id: string, // The ID of the jobs to fetch |
|
| 1115 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1116 | - * exclude_generated: boolean, // Omits fields that are illegal to set on job PUT |
|
| 1117 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1118 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1119 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1120 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1121 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1122 | - * } $params |
|
| 1123 | - * |
|
| 1124 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1125 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1126 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1127 | - * |
|
| 1128 | - * @return Elasticsearch|Promise |
|
| 1129 | - */ |
|
| 1130 | - public function getJobs(array $params = []) |
|
| 1131 | - { |
|
| 1132 | - if (isset($params['job_id'])) { |
|
| 1133 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1134 | - $method = 'GET'; |
|
| 1135 | - } else { |
|
| 1136 | - $url = '/_ml/anomaly_detectors'; |
|
| 1137 | - $method = 'GET'; |
|
| 1138 | - } |
|
| 1139 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1140 | - $headers = ['Accept' => 'application/json']; |
|
| 1141 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1142 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_jobs'); |
|
| 1143 | - return $this->client->sendRequest($request); |
|
| 1144 | - } |
|
| 1145 | - /** |
|
| 1146 | - * Returns information on how ML is using memory. |
|
| 1147 | - * |
|
| 1148 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html |
|
| 1149 | - * |
|
| 1150 | - * @param array{ |
|
| 1151 | - * node_id: string, // Specifies the node or nodes to retrieve stats for. |
|
| 1152 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 1153 | - * timeout: time, // Explicit operation timeout |
|
| 1154 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1155 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1156 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1157 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1158 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1159 | - * } $params |
|
| 1160 | - * |
|
| 1161 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1162 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1163 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1164 | - * |
|
| 1165 | - * @return Elasticsearch|Promise |
|
| 1166 | - */ |
|
| 1167 | - public function getMemoryStats(array $params = []) |
|
| 1168 | - { |
|
| 1169 | - if (isset($params['node_id'])) { |
|
| 1170 | - $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
| 1171 | - $method = 'GET'; |
|
| 1172 | - } else { |
|
| 1173 | - $url = '/_ml/memory/_stats'; |
|
| 1174 | - $method = 'GET'; |
|
| 1175 | - } |
|
| 1176 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1177 | - $headers = ['Accept' => 'application/json']; |
|
| 1178 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1179 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'ml.get_memory_stats'); |
|
| 1180 | - return $this->client->sendRequest($request); |
|
| 1181 | - } |
|
| 1182 | - /** |
|
| 1183 | - * Gets stats for anomaly detection job model snapshot upgrades that are in progress. |
|
| 1184 | - * |
|
| 1185 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html |
|
| 1186 | - * |
|
| 1187 | - * @param array{ |
|
| 1188 | - * job_id: string, // (REQUIRED) The ID of the job. May be a wildcard, comma separated list or `_all`. |
|
| 1189 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot. May be a wildcard, comma separated list or `_all`. |
|
| 1190 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) |
|
| 1191 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1192 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1193 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1194 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1195 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1196 | - * } $params |
|
| 1197 | - * |
|
| 1198 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1199 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1200 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1201 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1202 | - * |
|
| 1203 | - * @return Elasticsearch|Promise |
|
| 1204 | - */ |
|
| 1205 | - public function getModelSnapshotUpgradeStats(array $params = []) |
|
| 1206 | - { |
|
| 1207 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 1208 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
| 1209 | - $method = 'GET'; |
|
| 1210 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1211 | - $headers = ['Accept' => 'application/json']; |
|
| 1212 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1213 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.get_model_snapshot_upgrade_stats'); |
|
| 1214 | - return $this->client->sendRequest($request); |
|
| 1215 | - } |
|
| 1216 | - /** |
|
| 1217 | - * Retrieves information about model snapshots. |
|
| 1218 | - * |
|
| 1219 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html |
|
| 1220 | - * |
|
| 1221 | - * @param array{ |
|
| 1222 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 1223 | - * snapshot_id: string, // The ID of the snapshot to fetch |
|
| 1224 | - * from: int, // Skips a number of documents |
|
| 1225 | - * size: int, // The default number of documents returned in queries as a string. |
|
| 1226 | - * start: date, // The filter 'start' query parameter |
|
| 1227 | - * end: date, // The filter 'end' query parameter |
|
| 1228 | - * sort: string, // Name of the field to sort on |
|
| 1229 | - * desc: boolean, // True if the results should be sorted in descending order |
|
| 1230 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1231 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1232 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1233 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1234 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1235 | - * body: array, // Model snapshot selection criteria |
|
| 1236 | - * } $params |
|
| 1237 | - * |
|
| 1238 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1239 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1240 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1241 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1242 | - * |
|
| 1243 | - * @return Elasticsearch|Promise |
|
| 1244 | - */ |
|
| 1245 | - public function getModelSnapshots(array $params = []) |
|
| 1246 | - { |
|
| 1247 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 1248 | - if (isset($params['snapshot_id'])) { |
|
| 1249 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 1250 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1251 | - } else { |
|
| 1252 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
| 1253 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1254 | - } |
|
| 1255 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1256 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1257 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1258 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.get_model_snapshots'); |
|
| 1259 | - return $this->client->sendRequest($request); |
|
| 1260 | - } |
|
| 1261 | - /** |
|
| 1262 | - * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. |
|
| 1263 | - * |
|
| 1264 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html |
|
| 1265 | - * |
|
| 1266 | - * @param array{ |
|
| 1267 | - * job_id: string, // (REQUIRED) The job IDs for which to calculate overall bucket results |
|
| 1268 | - * top_n: int, // The number of top job bucket scores to be used in the overall_score calculation |
|
| 1269 | - * bucket_span: string, // The span of the overall buckets. Defaults to the longest job bucket_span |
|
| 1270 | - * overall_score: double, // Returns overall buckets with overall scores higher than this value |
|
| 1271 | - * exclude_interim: boolean, // If true overall buckets that include interim buckets will be excluded |
|
| 1272 | - * start: string, // Returns overall buckets with timestamps after this time |
|
| 1273 | - * end: string, // Returns overall buckets with timestamps earlier than this time |
|
| 1274 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1275 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1276 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1277 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1278 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1279 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1280 | - * body: array, // Overall bucket selection details if not provided in URI |
|
| 1281 | - * } $params |
|
| 1282 | - * |
|
| 1283 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1284 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1285 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1286 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1287 | - * |
|
| 1288 | - * @return Elasticsearch|Promise |
|
| 1289 | - */ |
|
| 1290 | - public function getOverallBuckets(array $params = []) |
|
| 1291 | - { |
|
| 1292 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 1293 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
| 1294 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1295 | - $url = $this->addQueryString($url, $params, ['top_n', 'bucket_span', 'overall_score', 'exclude_interim', 'start', 'end', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1296 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1297 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1298 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_overall_buckets'); |
|
| 1299 | - return $this->client->sendRequest($request); |
|
| 1300 | - } |
|
| 1301 | - /** |
|
| 1302 | - * Retrieves anomaly records for an anomaly detection job. |
|
| 1303 | - * |
|
| 1304 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html |
|
| 1305 | - * |
|
| 1306 | - * @param array{ |
|
| 1307 | - * job_id: string, // (REQUIRED) The ID of the job |
|
| 1308 | - * exclude_interim: boolean, // Exclude interim results |
|
| 1309 | - * from: int, // skips a number of records |
|
| 1310 | - * size: int, // specifies a max number of records to get |
|
| 1311 | - * start: string, // Start time filter for records |
|
| 1312 | - * end: string, // End time filter for records |
|
| 1313 | - * record_score: double, // Returns records with anomaly scores greater or equal than this value |
|
| 1314 | - * sort: string, // Sort records by a particular field |
|
| 1315 | - * desc: boolean, // Set the sort direction |
|
| 1316 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1317 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1318 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1319 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1320 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1321 | - * body: array, // Record selection criteria |
|
| 1322 | - * } $params |
|
| 1323 | - * |
|
| 1324 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1325 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1326 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1327 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1328 | - * |
|
| 1329 | - * @return Elasticsearch|Promise |
|
| 1330 | - */ |
|
| 1331 | - public function getRecords(array $params = []) |
|
| 1332 | - { |
|
| 1333 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 1334 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
| 1335 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1336 | - $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1337 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1338 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1339 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_records'); |
|
| 1340 | - return $this->client->sendRequest($request); |
|
| 1341 | - } |
|
| 1342 | - /** |
|
| 1343 | - * Retrieves configuration information for a trained inference model. |
|
| 1344 | - * |
|
| 1345 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html |
|
| 1346 | - * |
|
| 1347 | - * @param array{ |
|
| 1348 | - * model_id: string, // The ID of the trained models to fetch |
|
| 1349 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) |
|
| 1350 | - * include: string, // A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. |
|
| 1351 | - * include_model_definition: boolean, // Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. |
|
| 1352 | - * decompress_definition: boolean, // Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. |
|
| 1353 | - * from: int, // skips a number of trained models |
|
| 1354 | - * size: int, // specifies a max number of trained models to get |
|
| 1355 | - * tags: list, // A comma-separated list of tags that the model must have. |
|
| 1356 | - * exclude_generated: boolean, // Omits fields that are illegal to set on model PUT |
|
| 1357 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1358 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1359 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1360 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1361 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1362 | - * } $params |
|
| 1363 | - * |
|
| 1364 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1365 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1366 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1367 | - * |
|
| 1368 | - * @return Elasticsearch|Promise |
|
| 1369 | - */ |
|
| 1370 | - public function getTrainedModels(array $params = []) |
|
| 1371 | - { |
|
| 1372 | - if (isset($params['model_id'])) { |
|
| 1373 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1374 | - $method = 'GET'; |
|
| 1375 | - } else { |
|
| 1376 | - $url = '/_ml/trained_models'; |
|
| 1377 | - $method = 'GET'; |
|
| 1378 | - } |
|
| 1379 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'include', 'include_model_definition', 'decompress_definition', 'from', 'size', 'tags', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1380 | - $headers = ['Accept' => 'application/json']; |
|
| 1381 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1382 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.get_trained_models'); |
|
| 1383 | - return $this->client->sendRequest($request); |
|
| 1384 | - } |
|
| 1385 | - /** |
|
| 1386 | - * Retrieves usage information for trained inference models. |
|
| 1387 | - * |
|
| 1388 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html |
|
| 1389 | - * |
|
| 1390 | - * @param array{ |
|
| 1391 | - * model_id: string, // The ID of the trained models stats to fetch |
|
| 1392 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) |
|
| 1393 | - * from: int, // skips a number of trained models |
|
| 1394 | - * size: int, // specifies a max number of trained models to get |
|
| 1395 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1396 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1397 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1398 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1399 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1400 | - * } $params |
|
| 1401 | - * |
|
| 1402 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1403 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1404 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1405 | - * |
|
| 1406 | - * @return Elasticsearch|Promise |
|
| 1407 | - */ |
|
| 1408 | - public function getTrainedModelsStats(array $params = []) |
|
| 1409 | - { |
|
| 1410 | - if (isset($params['model_id'])) { |
|
| 1411 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
| 1412 | - $method = 'GET'; |
|
| 1413 | - } else { |
|
| 1414 | - $url = '/_ml/trained_models/_stats'; |
|
| 1415 | - $method = 'GET'; |
|
| 1416 | - } |
|
| 1417 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1418 | - $headers = ['Accept' => 'application/json']; |
|
| 1419 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1420 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.get_trained_models_stats'); |
|
| 1421 | - return $this->client->sendRequest($request); |
|
| 1422 | - } |
|
| 1423 | - /** |
|
| 1424 | - * Evaluate a trained model. |
|
| 1425 | - * |
|
| 1426 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html |
|
| 1427 | - * |
|
| 1428 | - * @param array{ |
|
| 1429 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 1430 | - * timeout: time, // Controls the amount of time to wait for inference results. |
|
| 1431 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1432 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1433 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1434 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1435 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1436 | - * body: array, // (REQUIRED) The docs to apply inference on and inference configuration overrides |
|
| 1437 | - * } $params |
|
| 1438 | - * |
|
| 1439 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1440 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1441 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1442 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1443 | - * |
|
| 1444 | - * @return Elasticsearch|Promise |
|
| 1445 | - */ |
|
| 1446 | - public function inferTrainedModel(array $params = []) |
|
| 1447 | - { |
|
| 1448 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1449 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
| 1450 | - $method = 'POST'; |
|
| 1451 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1452 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1453 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1454 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.infer_trained_model'); |
|
| 1455 | - return $this->client->sendRequest($request); |
|
| 1456 | - } |
|
| 1457 | - /** |
|
| 1458 | - * Returns defaults and limits used by machine learning. |
|
| 1459 | - * |
|
| 1460 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html |
|
| 1461 | - * |
|
| 1462 | - * @param array{ |
|
| 1463 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1464 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1465 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1466 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1467 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1468 | - * } $params |
|
| 1469 | - * |
|
| 1470 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1471 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1472 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1473 | - * |
|
| 1474 | - * @return Elasticsearch|Promise |
|
| 1475 | - */ |
|
| 1476 | - public function info(array $params = []) |
|
| 1477 | - { |
|
| 1478 | - $url = '/_ml/info'; |
|
| 1479 | - $method = 'GET'; |
|
| 1480 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1481 | - $headers = ['Accept' => 'application/json']; |
|
| 1482 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1483 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.info'); |
|
| 1484 | - return $this->client->sendRequest($request); |
|
| 1485 | - } |
|
| 1486 | - /** |
|
| 1487 | - * Opens one or more anomaly detection jobs. |
|
| 1488 | - * |
|
| 1489 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html |
|
| 1490 | - * |
|
| 1491 | - * @param array{ |
|
| 1492 | - * job_id: string, // (REQUIRED) The ID of the job to open |
|
| 1493 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1494 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1495 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1496 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1497 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1498 | - * body: array, // Query parameters can be specified in the body |
|
| 1499 | - * } $params |
|
| 1500 | - * |
|
| 1501 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1502 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1503 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1504 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1505 | - * |
|
| 1506 | - * @return Elasticsearch|Promise |
|
| 1507 | - */ |
|
| 1508 | - public function openJob(array $params = []) |
|
| 1509 | - { |
|
| 1510 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 1511 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
| 1512 | - $method = 'POST'; |
|
| 1513 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1514 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1515 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1516 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.open_job'); |
|
| 1517 | - return $this->client->sendRequest($request); |
|
| 1518 | - } |
|
| 1519 | - /** |
|
| 1520 | - * Posts scheduled events in a calendar. |
|
| 1521 | - * |
|
| 1522 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html |
|
| 1523 | - * |
|
| 1524 | - * @param array{ |
|
| 1525 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 1526 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1527 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1528 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1529 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1530 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1531 | - * body: array, // (REQUIRED) A list of events |
|
| 1532 | - * } $params |
|
| 1533 | - * |
|
| 1534 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1535 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1536 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1537 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1538 | - * |
|
| 1539 | - * @return Elasticsearch|Promise |
|
| 1540 | - */ |
|
| 1541 | - public function postCalendarEvents(array $params = []) |
|
| 1542 | - { |
|
| 1543 | - $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
|
| 1544 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 1545 | - $method = 'POST'; |
|
| 1546 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1547 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1548 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1549 | - $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.post_calendar_events'); |
|
| 1550 | - return $this->client->sendRequest($request); |
|
| 1551 | - } |
|
| 1552 | - /** |
|
| 1553 | - * Sends data to an anomaly detection job for analysis. |
|
| 1554 | - * |
|
| 1555 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html |
|
| 1556 | - * |
|
| 1557 | - * @param array{ |
|
| 1558 | - * job_id: string, // (REQUIRED) The name of the job receiving the data |
|
| 1559 | - * reset_start: string, // Optional parameter to specify the start of the bucket resetting range |
|
| 1560 | - * reset_end: string, // Optional parameter to specify the end of the bucket resetting range |
|
| 1561 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1562 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1563 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1564 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1565 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1566 | - * body: array, // (REQUIRED) The data to process |
|
| 1567 | - * } $params |
|
| 1568 | - * |
|
| 1569 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1570 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1571 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1572 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1573 | - * |
|
| 1574 | - * @return Elasticsearch|Promise |
|
| 1575 | - */ |
|
| 1576 | - public function postData(array $params = []) |
|
| 1577 | - { |
|
| 1578 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 1579 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
| 1580 | - $method = 'POST'; |
|
| 1581 | - $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1582 | - $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
|
| 1583 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1584 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.post_data'); |
|
| 1585 | - return $this->client->sendRequest($request); |
|
| 1586 | - } |
|
| 1587 | - /** |
|
| 1588 | - * Previews that will be analyzed given a data frame analytics config. |
|
| 1589 | - * |
|
| 1590 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html |
|
| 1591 | - * |
|
| 1592 | - * @param array{ |
|
| 1593 | - * id: string, // The ID of the data frame analytics to preview |
|
| 1594 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1595 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1596 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1597 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1598 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1599 | - * body: array, // The data frame analytics config to preview |
|
| 1600 | - * } $params |
|
| 1601 | - * |
|
| 1602 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1603 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1604 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1605 | - * |
|
| 1606 | - * @return Elasticsearch|Promise |
|
| 1607 | - */ |
|
| 1608 | - public function previewDataFrameAnalytics(array $params = []) |
|
| 1609 | - { |
|
| 1610 | - if (isset($params['id'])) { |
|
| 1611 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
| 1612 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1613 | - } else { |
|
| 1614 | - $url = '/_ml/data_frame/analytics/_preview'; |
|
| 1615 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1616 | - } |
|
| 1617 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1618 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1619 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1620 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.preview_data_frame_analytics'); |
|
| 1621 | - return $this->client->sendRequest($request); |
|
| 1622 | - } |
|
| 1623 | - /** |
|
| 1624 | - * Previews a datafeed. |
|
| 1625 | - * |
|
| 1626 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html |
|
| 1627 | - * |
|
| 1628 | - * @param array{ |
|
| 1629 | - * datafeed_id: string, // The ID of the datafeed to preview |
|
| 1630 | - * start: string, // The start time from where the datafeed preview should begin |
|
| 1631 | - * end: string, // The end time when the datafeed preview should stop |
|
| 1632 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1633 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1634 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1635 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1636 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1637 | - * body: array, // The datafeed config and job config with which to execute the preview |
|
| 1638 | - * } $params |
|
| 1639 | - * |
|
| 1640 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1641 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1642 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1643 | - * |
|
| 1644 | - * @return Elasticsearch|Promise |
|
| 1645 | - */ |
|
| 1646 | - public function previewDatafeed(array $params = []) |
|
| 1647 | - { |
|
| 1648 | - if (isset($params['datafeed_id'])) { |
|
| 1649 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
| 1650 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1651 | - } else { |
|
| 1652 | - $url = '/_ml/datafeeds/_preview'; |
|
| 1653 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1654 | - } |
|
| 1655 | - $url = $this->addQueryString($url, $params, ['start', 'end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1656 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1657 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1658 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.preview_datafeed'); |
|
| 1659 | - return $this->client->sendRequest($request); |
|
| 1660 | - } |
|
| 1661 | - /** |
|
| 1662 | - * Instantiates a calendar. |
|
| 1663 | - * |
|
| 1664 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html |
|
| 1665 | - * |
|
| 1666 | - * @param array{ |
|
| 1667 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to create |
|
| 1668 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1669 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1670 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1671 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1672 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1673 | - * body: array, // The calendar details |
|
| 1674 | - * } $params |
|
| 1675 | - * |
|
| 1676 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1677 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1678 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1679 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1680 | - * |
|
| 1681 | - * @return Elasticsearch|Promise |
|
| 1682 | - */ |
|
| 1683 | - public function putCalendar(array $params = []) |
|
| 1684 | - { |
|
| 1685 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 1686 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 1687 | - $method = 'PUT'; |
|
| 1688 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1689 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1690 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1691 | - $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.put_calendar'); |
|
| 1692 | - return $this->client->sendRequest($request); |
|
| 1693 | - } |
|
| 1694 | - /** |
|
| 1695 | - * Adds an anomaly detection job to a calendar. |
|
| 1696 | - * |
|
| 1697 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html |
|
| 1698 | - * |
|
| 1699 | - * @param array{ |
|
| 1700 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 1701 | - * job_id: string, // (REQUIRED) The ID of the job to add to the calendar |
|
| 1702 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1703 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1704 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1705 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1706 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1707 | - * } $params |
|
| 1708 | - * |
|
| 1709 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1710 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1711 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1712 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1713 | - * |
|
| 1714 | - * @return Elasticsearch|Promise |
|
| 1715 | - */ |
|
| 1716 | - public function putCalendarJob(array $params = []) |
|
| 1717 | - { |
|
| 1718 | - $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
| 1719 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 1720 | - $method = 'PUT'; |
|
| 1721 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1722 | - $headers = ['Accept' => 'application/json']; |
|
| 1723 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1724 | - $request = $this->addOtelAttributes($params, ['calendar_id', 'job_id'], $request, 'ml.put_calendar_job'); |
|
| 1725 | - return $this->client->sendRequest($request); |
|
| 1726 | - } |
|
| 1727 | - /** |
|
| 1728 | - * Instantiates a data frame analytics job. |
|
| 1729 | - * |
|
| 1730 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html |
|
| 1731 | - * |
|
| 1732 | - * @param array{ |
|
| 1733 | - * id: string, // (REQUIRED) The ID of the data frame analytics to create |
|
| 1734 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1735 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1736 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1737 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1738 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1739 | - * body: array, // (REQUIRED) The data frame analytics configuration |
|
| 1740 | - * } $params |
|
| 1741 | - * |
|
| 1742 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1743 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1744 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1745 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1746 | - * |
|
| 1747 | - * @return Elasticsearch|Promise |
|
| 1748 | - */ |
|
| 1749 | - public function putDataFrameAnalytics(array $params = []) |
|
| 1750 | - { |
|
| 1751 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 1752 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 1753 | - $method = 'PUT'; |
|
| 1754 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1755 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1756 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1757 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.put_data_frame_analytics'); |
|
| 1758 | - return $this->client->sendRequest($request); |
|
| 1759 | - } |
|
| 1760 | - /** |
|
| 1761 | - * Instantiates a datafeed. |
|
| 1762 | - * |
|
| 1763 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html |
|
| 1764 | - * |
|
| 1765 | - * @param array{ |
|
| 1766 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to create |
|
| 1767 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
| 1768 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
| 1769 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
| 1770 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
| 1771 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1772 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1773 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1774 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1775 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1776 | - * body: array, // (REQUIRED) The datafeed config |
|
| 1777 | - * } $params |
|
| 1778 | - * |
|
| 1779 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1780 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1781 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1782 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1783 | - * |
|
| 1784 | - * @return Elasticsearch|Promise |
|
| 1785 | - */ |
|
| 1786 | - public function putDatafeed(array $params = []) |
|
| 1787 | - { |
|
| 1788 | - $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
| 1789 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 1790 | - $method = 'PUT'; |
|
| 1791 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1792 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1793 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1794 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.put_datafeed'); |
|
| 1795 | - return $this->client->sendRequest($request); |
|
| 1796 | - } |
|
| 1797 | - /** |
|
| 1798 | - * Instantiates a filter. |
|
| 1799 | - * |
|
| 1800 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html |
|
| 1801 | - * |
|
| 1802 | - * @param array{ |
|
| 1803 | - * filter_id: string, // (REQUIRED) The ID of the filter to create |
|
| 1804 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1805 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1806 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1807 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1808 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1809 | - * body: array, // (REQUIRED) The filter details |
|
| 1810 | - * } $params |
|
| 1811 | - * |
|
| 1812 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1813 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1814 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1815 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1816 | - * |
|
| 1817 | - * @return Elasticsearch|Promise |
|
| 1818 | - */ |
|
| 1819 | - public function putFilter(array $params = []) |
|
| 1820 | - { |
|
| 1821 | - $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
| 1822 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1823 | - $method = 'PUT'; |
|
| 1824 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1825 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1826 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1827 | - $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.put_filter'); |
|
| 1828 | - return $this->client->sendRequest($request); |
|
| 1829 | - } |
|
| 1830 | - /** |
|
| 1831 | - * Instantiates an anomaly detection job. |
|
| 1832 | - * |
|
| 1833 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html |
|
| 1834 | - * |
|
| 1835 | - * @param array{ |
|
| 1836 | - * job_id: string, // (REQUIRED) The ID of the job to create |
|
| 1837 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. |
|
| 1838 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. |
|
| 1839 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. |
|
| 1840 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. |
|
| 1841 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1842 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1843 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1844 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1845 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1846 | - * body: array, // (REQUIRED) The job |
|
| 1847 | - * } $params |
|
| 1848 | - * |
|
| 1849 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1850 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1851 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1852 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1853 | - * |
|
| 1854 | - * @return Elasticsearch|Promise |
|
| 1855 | - */ |
|
| 1856 | - public function putJob(array $params = []) |
|
| 1857 | - { |
|
| 1858 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 1859 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1860 | - $method = 'PUT'; |
|
| 1861 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1862 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1863 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1864 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.put_job'); |
|
| 1865 | - return $this->client->sendRequest($request); |
|
| 1866 | - } |
|
| 1867 | - /** |
|
| 1868 | - * Creates an inference trained model. |
|
| 1869 | - * |
|
| 1870 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html |
|
| 1871 | - * |
|
| 1872 | - * @param array{ |
|
| 1873 | - * model_id: string, // (REQUIRED) The ID of the trained models to store |
|
| 1874 | - * defer_definition_decompression: boolean, // If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. |
|
| 1875 | - * wait_for_completion: boolean, // Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false |
|
| 1876 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1877 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1878 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1879 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1880 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1881 | - * body: array, // (REQUIRED) The trained model configuration |
|
| 1882 | - * } $params |
|
| 1883 | - * |
|
| 1884 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1885 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1886 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1887 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1888 | - * |
|
| 1889 | - * @return Elasticsearch|Promise |
|
| 1890 | - */ |
|
| 1891 | - public function putTrainedModel(array $params = []) |
|
| 1892 | - { |
|
| 1893 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1894 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1895 | - $method = 'PUT'; |
|
| 1896 | - $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1897 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1898 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1899 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.put_trained_model'); |
|
| 1900 | - return $this->client->sendRequest($request); |
|
| 1901 | - } |
|
| 1902 | - /** |
|
| 1903 | - * Creates a new model alias (or reassigns an existing one) to refer to the trained model |
|
| 1904 | - * |
|
| 1905 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html |
|
| 1906 | - * |
|
| 1907 | - * @param array{ |
|
| 1908 | - * model_alias: string, // (REQUIRED) The trained model alias to update |
|
| 1909 | - * model_id: string, // (REQUIRED) The trained model where the model alias should be assigned |
|
| 1910 | - * reassign: boolean, // If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. |
|
| 1911 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1912 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1913 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1914 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1915 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1916 | - * } $params |
|
| 1917 | - * |
|
| 1918 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1919 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1920 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1921 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1922 | - * |
|
| 1923 | - * @return Elasticsearch|Promise |
|
| 1924 | - */ |
|
| 1925 | - public function putTrainedModelAlias(array $params = []) |
|
| 1926 | - { |
|
| 1927 | - $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
| 1928 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 1929 | - $method = 'PUT'; |
|
| 1930 | - $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1931 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1932 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1933 | - $request = $this->addOtelAttributes($params, ['model_alias', 'model_id'], $request, 'ml.put_trained_model_alias'); |
|
| 1934 | - return $this->client->sendRequest($request); |
|
| 1935 | - } |
|
| 1936 | - /** |
|
| 1937 | - * Creates part of a trained model definition |
|
| 1938 | - * |
|
| 1939 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html |
|
| 1940 | - * |
|
| 1941 | - * @param array{ |
|
| 1942 | - * model_id: string, // (REQUIRED) The ID of the trained model for this definition part |
|
| 1943 | - * part: int, // (REQUIRED) The part number |
|
| 1944 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1945 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1946 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1947 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1948 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1949 | - * body: array, // (REQUIRED) The trained model definition part |
|
| 1950 | - * } $params |
|
| 1951 | - * |
|
| 1952 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1953 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1954 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1955 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1956 | - * |
|
| 1957 | - * @return Elasticsearch|Promise |
|
| 1958 | - */ |
|
| 1959 | - public function putTrainedModelDefinitionPart(array $params = []) |
|
| 1960 | - { |
|
| 1961 | - $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
|
| 1962 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
| 1963 | - $method = 'PUT'; |
|
| 1964 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1965 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1966 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1967 | - $request = $this->addOtelAttributes($params, ['model_id', 'part'], $request, 'ml.put_trained_model_definition_part'); |
|
| 1968 | - return $this->client->sendRequest($request); |
|
| 1969 | - } |
|
| 1970 | - /** |
|
| 1971 | - * Creates a trained model vocabulary |
|
| 1972 | - * |
|
| 1973 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html |
|
| 1974 | - * |
|
| 1975 | - * @param array{ |
|
| 1976 | - * model_id: string, // (REQUIRED) The ID of the trained model for this vocabulary |
|
| 1977 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1978 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1979 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1980 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1981 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1982 | - * body: array, // (REQUIRED) The trained model vocabulary |
|
| 1983 | - * } $params |
|
| 1984 | - * |
|
| 1985 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1986 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1987 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1988 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1989 | - * |
|
| 1990 | - * @return Elasticsearch|Promise |
|
| 1991 | - */ |
|
| 1992 | - public function putTrainedModelVocabulary(array $params = []) |
|
| 1993 | - { |
|
| 1994 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1995 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
| 1996 | - $method = 'PUT'; |
|
| 1997 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1998 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1999 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2000 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.put_trained_model_vocabulary'); |
|
| 2001 | - return $this->client->sendRequest($request); |
|
| 2002 | - } |
|
| 2003 | - /** |
|
| 2004 | - * Resets an existing anomaly detection job. |
|
| 2005 | - * |
|
| 2006 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html |
|
| 2007 | - * |
|
| 2008 | - * @param array{ |
|
| 2009 | - * job_id: string, // (REQUIRED) The ID of the job to reset |
|
| 2010 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 2011 | - * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
| 2012 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2013 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2014 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2015 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2016 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2017 | - * } $params |
|
| 2018 | - * |
|
| 2019 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2020 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2021 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2022 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2023 | - * |
|
| 2024 | - * @return Elasticsearch|Promise |
|
| 2025 | - */ |
|
| 2026 | - public function resetJob(array $params = []) |
|
| 2027 | - { |
|
| 2028 | - $this->checkRequiredParameters(['job_id'], $params); |
|
| 2029 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
| 2030 | - $method = 'POST'; |
|
| 2031 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2032 | - $headers = ['Accept' => 'application/json']; |
|
| 2033 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2034 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.reset_job'); |
|
| 2035 | - return $this->client->sendRequest($request); |
|
| 2036 | - } |
|
| 2037 | - /** |
|
| 2038 | - * Reverts to a specific snapshot. |
|
| 2039 | - * |
|
| 2040 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html |
|
| 2041 | - * |
|
| 2042 | - * @param array{ |
|
| 2043 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 2044 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to revert to |
|
| 2045 | - * delete_intervening_results: boolean, // Should we reset the results back to the time of the snapshot? |
|
| 2046 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2047 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2048 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2049 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2050 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2051 | - * body: array, // Reversion options |
|
| 2052 | - * } $params |
|
| 2053 | - * |
|
| 2054 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2055 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2056 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2057 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2058 | - * |
|
| 2059 | - * @return Elasticsearch|Promise |
|
| 2060 | - */ |
|
| 2061 | - public function revertModelSnapshot(array $params = []) |
|
| 2062 | - { |
|
| 2063 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 2064 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
| 2065 | - $method = 'POST'; |
|
| 2066 | - $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2067 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2068 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2069 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.revert_model_snapshot'); |
|
| 2070 | - return $this->client->sendRequest($request); |
|
| 2071 | - } |
|
| 2072 | - /** |
|
| 2073 | - * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. |
|
| 2074 | - * |
|
| 2075 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html |
|
| 2076 | - * |
|
| 2077 | - * @param array{ |
|
| 2078 | - * enabled: boolean, // Whether to enable upgrade_mode ML setting or not. Defaults to false. |
|
| 2079 | - * timeout: time, // Controls the time to wait before action times out. Defaults to 30 seconds |
|
| 2080 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2081 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2082 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2083 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2084 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2085 | - * } $params |
|
| 2086 | - * |
|
| 2087 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2088 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2089 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2090 | - * |
|
| 2091 | - * @return Elasticsearch|Promise |
|
| 2092 | - */ |
|
| 2093 | - public function setUpgradeMode(array $params = []) |
|
| 2094 | - { |
|
| 2095 | - $url = '/_ml/set_upgrade_mode'; |
|
| 2096 | - $method = 'POST'; |
|
| 2097 | - $url = $this->addQueryString($url, $params, ['enabled', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2098 | - $headers = ['Accept' => 'application/json']; |
|
| 2099 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2100 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.set_upgrade_mode'); |
|
| 2101 | - return $this->client->sendRequest($request); |
|
| 2102 | - } |
|
| 2103 | - /** |
|
| 2104 | - * Starts a data frame analytics job. |
|
| 2105 | - * |
|
| 2106 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html |
|
| 2107 | - * |
|
| 2108 | - * @param array{ |
|
| 2109 | - * id: string, // (REQUIRED) The ID of the data frame analytics to start |
|
| 2110 | - * timeout: time, // Controls the time to wait until the task has started. Defaults to 20 seconds |
|
| 2111 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2112 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2113 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2114 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2115 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2116 | - * body: array, // The start data frame analytics parameters |
|
| 2117 | - * } $params |
|
| 2118 | - * |
|
| 2119 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2120 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2121 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2122 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2123 | - * |
|
| 2124 | - * @return Elasticsearch|Promise |
|
| 2125 | - */ |
|
| 2126 | - public function startDataFrameAnalytics(array $params = []) |
|
| 2127 | - { |
|
| 2128 | - $this->checkRequiredParameters(['id'], $params); |
|
| 2129 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
| 2130 | - $method = 'POST'; |
|
| 2131 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2132 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2133 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2134 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.start_data_frame_analytics'); |
|
| 2135 | - return $this->client->sendRequest($request); |
|
| 2136 | - } |
|
| 2137 | - /** |
|
| 2138 | - * Starts one or more datafeeds. |
|
| 2139 | - * |
|
| 2140 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html |
|
| 2141 | - * |
|
| 2142 | - * @param array{ |
|
| 2143 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to start |
|
| 2144 | - * start: string, // The start time from where the datafeed should begin |
|
| 2145 | - * end: string, // The end time when the datafeed should stop. When not set, the datafeed continues in real time |
|
| 2146 | - * timeout: time, // Controls the time to wait until a datafeed has started. Default to 20 seconds |
|
| 2147 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2148 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2149 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2150 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2151 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2152 | - * body: array, // The start datafeed parameters |
|
| 2153 | - * } $params |
|
| 2154 | - * |
|
| 2155 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2156 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2157 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2158 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2159 | - * |
|
| 2160 | - * @return Elasticsearch|Promise |
|
| 2161 | - */ |
|
| 2162 | - public function startDatafeed(array $params = []) |
|
| 2163 | - { |
|
| 2164 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 2165 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
| 2166 | - $method = 'POST'; |
|
| 2167 | - $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2168 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2169 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2170 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.start_datafeed'); |
|
| 2171 | - return $this->client->sendRequest($request); |
|
| 2172 | - } |
|
| 2173 | - /** |
|
| 2174 | - * Start a trained model deployment. |
|
| 2175 | - * |
|
| 2176 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html |
|
| 2177 | - * |
|
| 2178 | - * @param array{ |
|
| 2179 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2180 | - * cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb. |
|
| 2181 | - * deployment_id: string, // The Id of the new deployment. Defaults to the model_id if not set. |
|
| 2182 | - * number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes. |
|
| 2183 | - * threads_per_allocation: int, // The number of threads used by each model allocation during inference. |
|
| 2184 | - * priority: string, // The deployment priority. |
|
| 2185 | - * queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time. |
|
| 2186 | - * timeout: time, // Controls the amount of time to wait for the model to deploy. |
|
| 2187 | - * wait_for: string, // The allocation status for which to wait |
|
| 2188 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2189 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2190 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2191 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2192 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2193 | - * } $params |
|
| 2194 | - * |
|
| 2195 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2196 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2197 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2198 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2199 | - * |
|
| 2200 | - * @return Elasticsearch|Promise |
|
| 2201 | - */ |
|
| 2202 | - public function startTrainedModelDeployment(array $params = []) |
|
| 2203 | - { |
|
| 2204 | - $this->checkRequiredParameters(['model_id'], $params); |
|
| 2205 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
| 2206 | - $method = 'POST'; |
|
| 2207 | - $url = $this->addQueryString($url, $params, ['cache_size', 'deployment_id', 'number_of_allocations', 'threads_per_allocation', 'priority', 'queue_capacity', 'timeout', 'wait_for', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2208 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2209 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2210 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.start_trained_model_deployment'); |
|
| 2211 | - return $this->client->sendRequest($request); |
|
| 2212 | - } |
|
| 2213 | - /** |
|
| 2214 | - * Stops one or more data frame analytics jobs. |
|
| 2215 | - * |
|
| 2216 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html |
|
| 2217 | - * |
|
| 2218 | - * @param array{ |
|
| 2219 | - * id: string, // (REQUIRED) The ID of the data frame analytics to stop |
|
| 2220 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 2221 | - * force: boolean, // True if the data frame analytics should be forcefully stopped |
|
| 2222 | - * timeout: time, // Controls the time to wait until the task has stopped. Defaults to 20 seconds |
|
| 2223 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2224 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2225 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2226 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2227 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2228 | - * body: array, // The stop data frame analytics parameters |
|
| 2229 | - * } $params |
|
| 2230 | - * |
|
| 2231 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2232 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2233 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2234 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2235 | - * |
|
| 2236 | - * @return Elasticsearch|Promise |
|
| 2237 | - */ |
|
| 2238 | - public function stopDataFrameAnalytics(array $params = []) |
|
| 2239 | - { |
|
| 2240 | - $this->checkRequiredParameters(['id'], $params); |
|
| 2241 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
| 2242 | - $method = 'POST'; |
|
| 2243 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2244 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2245 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2246 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.stop_data_frame_analytics'); |
|
| 2247 | - return $this->client->sendRequest($request); |
|
| 2248 | - } |
|
| 2249 | - /** |
|
| 2250 | - * Stops one or more datafeeds. |
|
| 2251 | - * |
|
| 2252 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html |
|
| 2253 | - * |
|
| 2254 | - * @param array{ |
|
| 2255 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to stop |
|
| 2256 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 2257 | - * allow_no_datafeeds: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 2258 | - * force: boolean, // True if the datafeed should be forcefully stopped. |
|
| 2259 | - * timeout: time, // Controls the time to wait until a datafeed has stopped. Default to 20 seconds |
|
| 2260 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2261 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2262 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2263 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2264 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2265 | - * body: array, // The URL params optionally sent in the body |
|
| 2266 | - * } $params |
|
| 2267 | - * |
|
| 2268 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2269 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2270 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2271 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2272 | - * |
|
| 2273 | - * @return Elasticsearch|Promise |
|
| 2274 | - */ |
|
| 2275 | - public function stopDatafeed(array $params = []) |
|
| 2276 | - { |
|
| 2277 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 2278 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
| 2279 | - $method = 'POST'; |
|
| 2280 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2281 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2282 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2283 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.stop_datafeed'); |
|
| 2284 | - return $this->client->sendRequest($request); |
|
| 2285 | - } |
|
| 2286 | - /** |
|
| 2287 | - * Stop a trained model deployment. |
|
| 2288 | - * |
|
| 2289 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html |
|
| 2290 | - * |
|
| 2291 | - * @param array{ |
|
| 2292 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2293 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no deployments. (This includes `_all` string or when no deployments have been specified) |
|
| 2294 | - * force: boolean, // True if the deployment should be forcefully stopped |
|
| 2295 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2296 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2297 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2298 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2299 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2300 | - * body: array, // The stop deployment parameters |
|
| 2301 | - * } $params |
|
| 2302 | - * |
|
| 2303 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2304 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2305 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2306 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2307 | - * |
|
| 2308 | - * @return Elasticsearch|Promise |
|
| 2309 | - */ |
|
| 2310 | - public function stopTrainedModelDeployment(array $params = []) |
|
| 2311 | - { |
|
| 2312 | - $this->checkRequiredParameters(['model_id'], $params); |
|
| 2313 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
| 2314 | - $method = 'POST'; |
|
| 2315 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2316 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2317 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2318 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.stop_trained_model_deployment'); |
|
| 2319 | - return $this->client->sendRequest($request); |
|
| 2320 | - } |
|
| 2321 | - /** |
|
| 2322 | - * Updates certain properties of a data frame analytics job. |
|
| 2323 | - * |
|
| 2324 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html |
|
| 2325 | - * |
|
| 2326 | - * @param array{ |
|
| 2327 | - * id: string, // (REQUIRED) The ID of the data frame analytics to update |
|
| 2328 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2329 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2330 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2331 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2332 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2333 | - * body: array, // (REQUIRED) The data frame analytics settings to update |
|
| 2334 | - * } $params |
|
| 2335 | - * |
|
| 2336 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2337 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2338 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2339 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2340 | - * |
|
| 2341 | - * @return Elasticsearch|Promise |
|
| 2342 | - */ |
|
| 2343 | - public function updateDataFrameAnalytics(array $params = []) |
|
| 2344 | - { |
|
| 2345 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 2346 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
| 2347 | - $method = 'POST'; |
|
| 2348 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2349 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2350 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2351 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.update_data_frame_analytics'); |
|
| 2352 | - return $this->client->sendRequest($request); |
|
| 2353 | - } |
|
| 2354 | - /** |
|
| 2355 | - * Updates certain properties of a datafeed. |
|
| 2356 | - * |
|
| 2357 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html |
|
| 2358 | - * |
|
| 2359 | - * @param array{ |
|
| 2360 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to update |
|
| 2361 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
| 2362 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
| 2363 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
| 2364 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
| 2365 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2366 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2367 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2368 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2369 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2370 | - * body: array, // (REQUIRED) The datafeed update settings |
|
| 2371 | - * } $params |
|
| 2372 | - * |
|
| 2373 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2374 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2375 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2376 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2377 | - * |
|
| 2378 | - * @return Elasticsearch|Promise |
|
| 2379 | - */ |
|
| 2380 | - public function updateDatafeed(array $params = []) |
|
| 2381 | - { |
|
| 2382 | - $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
| 2383 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
| 2384 | - $method = 'POST'; |
|
| 2385 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2386 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2387 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2388 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.update_datafeed'); |
|
| 2389 | - return $this->client->sendRequest($request); |
|
| 2390 | - } |
|
| 2391 | - /** |
|
| 2392 | - * Updates the description of a filter, adds items, or removes items. |
|
| 2393 | - * |
|
| 2394 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html |
|
| 2395 | - * |
|
| 2396 | - * @param array{ |
|
| 2397 | - * filter_id: string, // (REQUIRED) The ID of the filter to update |
|
| 2398 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2399 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2400 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2401 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2402 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2403 | - * body: array, // (REQUIRED) The filter update |
|
| 2404 | - * } $params |
|
| 2405 | - * |
|
| 2406 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2407 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2408 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2409 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2410 | - * |
|
| 2411 | - * @return Elasticsearch|Promise |
|
| 2412 | - */ |
|
| 2413 | - public function updateFilter(array $params = []) |
|
| 2414 | - { |
|
| 2415 | - $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
| 2416 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
| 2417 | - $method = 'POST'; |
|
| 2418 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2419 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2420 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2421 | - $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.update_filter'); |
|
| 2422 | - return $this->client->sendRequest($request); |
|
| 2423 | - } |
|
| 2424 | - /** |
|
| 2425 | - * Updates certain properties of an anomaly detection job. |
|
| 2426 | - * |
|
| 2427 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html |
|
| 2428 | - * |
|
| 2429 | - * @param array{ |
|
| 2430 | - * job_id: string, // (REQUIRED) The ID of the job to create |
|
| 2431 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2432 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2433 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2434 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2435 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2436 | - * body: array, // (REQUIRED) The job update settings |
|
| 2437 | - * } $params |
|
| 2438 | - * |
|
| 2439 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2440 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2441 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2442 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2443 | - * |
|
| 2444 | - * @return Elasticsearch|Promise |
|
| 2445 | - */ |
|
| 2446 | - public function updateJob(array $params = []) |
|
| 2447 | - { |
|
| 2448 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 2449 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
| 2450 | - $method = 'POST'; |
|
| 2451 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2452 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2453 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2454 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.update_job'); |
|
| 2455 | - return $this->client->sendRequest($request); |
|
| 2456 | - } |
|
| 2457 | - /** |
|
| 2458 | - * Updates certain properties of a snapshot. |
|
| 2459 | - * |
|
| 2460 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html |
|
| 2461 | - * |
|
| 2462 | - * @param array{ |
|
| 2463 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 2464 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to update |
|
| 2465 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2466 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2467 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2468 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2469 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2470 | - * body: array, // (REQUIRED) The model snapshot properties to update |
|
| 2471 | - * } $params |
|
| 2472 | - * |
|
| 2473 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2474 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2475 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2476 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2477 | - * |
|
| 2478 | - * @return Elasticsearch|Promise |
|
| 2479 | - */ |
|
| 2480 | - public function updateModelSnapshot(array $params = []) |
|
| 2481 | - { |
|
| 2482 | - $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
|
| 2483 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
| 2484 | - $method = 'POST'; |
|
| 2485 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2486 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2487 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2488 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.update_model_snapshot'); |
|
| 2489 | - return $this->client->sendRequest($request); |
|
| 2490 | - } |
|
| 2491 | - /** |
|
| 2492 | - * Updates certain properties of trained model deployment. |
|
| 2493 | - * |
|
| 2494 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html |
|
| 2495 | - * |
|
| 2496 | - * @param array{ |
|
| 2497 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2498 | - * number_of_allocations: int, // Update the model deployment to this number of allocations. |
|
| 2499 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2500 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2501 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2502 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2503 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2504 | - * body: array, // The updated trained model deployment settings |
|
| 2505 | - * } $params |
|
| 2506 | - * |
|
| 2507 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2508 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2509 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2510 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2511 | - * |
|
| 2512 | - * @return Elasticsearch|Promise |
|
| 2513 | - */ |
|
| 2514 | - public function updateTrainedModelDeployment(array $params = []) |
|
| 2515 | - { |
|
| 2516 | - $this->checkRequiredParameters(['model_id'], $params); |
|
| 2517 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
| 2518 | - $method = 'POST'; |
|
| 2519 | - $url = $this->addQueryString($url, $params, ['number_of_allocations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2520 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2521 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2522 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.update_trained_model_deployment'); |
|
| 2523 | - return $this->client->sendRequest($request); |
|
| 2524 | - } |
|
| 2525 | - /** |
|
| 2526 | - * Upgrades a given job snapshot to the current major version. |
|
| 2527 | - * |
|
| 2528 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html |
|
| 2529 | - * |
|
| 2530 | - * @param array{ |
|
| 2531 | - * job_id: string, // (REQUIRED) The ID of the job |
|
| 2532 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot |
|
| 2533 | - * timeout: time, // How long should the API wait for the job to be opened and the old snapshot to be loaded. |
|
| 2534 | - * wait_for_completion: boolean, // Should the request wait until the task is complete before responding to the caller. Default is false. |
|
| 2535 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2536 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2537 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2538 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2539 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2540 | - * } $params |
|
| 2541 | - * |
|
| 2542 | - * @throws MissingParameterException if a required parameter is missing |
|
| 2543 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2544 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2545 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2546 | - * |
|
| 2547 | - * @return Elasticsearch|Promise |
|
| 2548 | - */ |
|
| 2549 | - public function upgradeJobSnapshot(array $params = []) |
|
| 2550 | - { |
|
| 2551 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 2552 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
| 2553 | - $method = 'POST'; |
|
| 2554 | - $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2555 | - $headers = ['Accept' => 'application/json']; |
|
| 2556 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2557 | - $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.upgrade_job_snapshot'); |
|
| 2558 | - return $this->client->sendRequest($request); |
|
| 2559 | - } |
|
| 2560 | - /** |
|
| 2561 | - * Validates an anomaly detection job. |
|
| 2562 | - * |
|
| 2563 | - * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
| 2564 | - * |
|
| 2565 | - * @param array{ |
|
| 2566 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2567 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2568 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2569 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2570 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2571 | - * body: array, // (REQUIRED) The job config |
|
| 2572 | - * } $params |
|
| 2573 | - * |
|
| 2574 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2575 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2576 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2577 | - * |
|
| 2578 | - * @return Elasticsearch|Promise |
|
| 2579 | - */ |
|
| 2580 | - public function validate(array $params = []) |
|
| 2581 | - { |
|
| 2582 | - $this->checkRequiredParameters(['body'], $params); |
|
| 2583 | - $url = '/_ml/anomaly_detectors/_validate'; |
|
| 2584 | - $method = 'POST'; |
|
| 2585 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2586 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2587 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2588 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.validate'); |
|
| 2589 | - return $this->client->sendRequest($request); |
|
| 2590 | - } |
|
| 2591 | - /** |
|
| 2592 | - * Validates an anomaly detection detector. |
|
| 2593 | - * |
|
| 2594 | - * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
| 2595 | - * |
|
| 2596 | - * @param array{ |
|
| 2597 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2598 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2599 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2600 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2601 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2602 | - * body: array, // (REQUIRED) The detector |
|
| 2603 | - * } $params |
|
| 2604 | - * |
|
| 2605 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2606 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 2607 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 2608 | - * |
|
| 2609 | - * @return Elasticsearch|Promise |
|
| 2610 | - */ |
|
| 2611 | - public function validateDetector(array $params = []) |
|
| 2612 | - { |
|
| 2613 | - $this->checkRequiredParameters(['body'], $params); |
|
| 2614 | - $url = '/_ml/anomaly_detectors/_validate/detector'; |
|
| 2615 | - $method = 'POST'; |
|
| 2616 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2617 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2618 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2619 | - $request = $this->addOtelAttributes($params, [], $request, 'ml.validate_detector'); |
|
| 2620 | - return $this->client->sendRequest($request); |
|
| 2621 | - } |
|
| 28 | + /** |
|
| 29 | + * Clear the cached results from a trained model deployment |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | + * } $params |
|
| 41 | + * |
|
| 42 | + * @throws MissingParameterException if a required parameter is missing |
|
| 43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | + * |
|
| 47 | + * @return Elasticsearch|Promise |
|
| 48 | + */ |
|
| 49 | + public function clearTrainedModelDeploymentCache(array $params = []) |
|
| 50 | + { |
|
| 51 | + $this->checkRequiredParameters(['model_id'], $params); |
|
| 52 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/cache/_clear'; |
|
| 53 | + $method = 'POST'; |
|
| 54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 55 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 57 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.clear_trained_model_deployment_cache'); |
|
| 58 | + return $this->client->sendRequest($request); |
|
| 59 | + } |
|
| 60 | + /** |
|
| 61 | + * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. |
|
| 62 | + * |
|
| 63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html |
|
| 64 | + * |
|
| 65 | + * @param array{ |
|
| 66 | + * job_id: string, // (REQUIRED) The name of the job to close |
|
| 67 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 68 | + * force: boolean, // True if the job should be forcefully closed |
|
| 69 | + * timeout: time, // Controls the time to wait until a job has closed. Default to 30 minutes |
|
| 70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 75 | + * body: array, // The URL params optionally sent in the body |
|
| 76 | + * } $params |
|
| 77 | + * |
|
| 78 | + * @throws MissingParameterException if a required parameter is missing |
|
| 79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | + * |
|
| 83 | + * @return Elasticsearch|Promise |
|
| 84 | + */ |
|
| 85 | + public function closeJob(array $params = []) |
|
| 86 | + { |
|
| 87 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 88 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
| 89 | + $method = 'POST'; |
|
| 90 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 92 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 93 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.close_job'); |
|
| 94 | + return $this->client->sendRequest($request); |
|
| 95 | + } |
|
| 96 | + /** |
|
| 97 | + * Deletes a calendar. |
|
| 98 | + * |
|
| 99 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html |
|
| 100 | + * |
|
| 101 | + * @param array{ |
|
| 102 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to delete |
|
| 103 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 104 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 105 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 106 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 107 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 108 | + * } $params |
|
| 109 | + * |
|
| 110 | + * @throws MissingParameterException if a required parameter is missing |
|
| 111 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 112 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 113 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 114 | + * |
|
| 115 | + * @return Elasticsearch|Promise |
|
| 116 | + */ |
|
| 117 | + public function deleteCalendar(array $params = []) |
|
| 118 | + { |
|
| 119 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 120 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 121 | + $method = 'DELETE'; |
|
| 122 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 123 | + $headers = ['Accept' => 'application/json']; |
|
| 124 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 125 | + $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.delete_calendar'); |
|
| 126 | + return $this->client->sendRequest($request); |
|
| 127 | + } |
|
| 128 | + /** |
|
| 129 | + * Deletes scheduled events from a calendar. |
|
| 130 | + * |
|
| 131 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html |
|
| 132 | + * |
|
| 133 | + * @param array{ |
|
| 134 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 135 | + * event_id: string, // (REQUIRED) The ID of the event to remove from the calendar |
|
| 136 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 137 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 138 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 139 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 140 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 141 | + * } $params |
|
| 142 | + * |
|
| 143 | + * @throws MissingParameterException if a required parameter is missing |
|
| 144 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 145 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 146 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 147 | + * |
|
| 148 | + * @return Elasticsearch|Promise |
|
| 149 | + */ |
|
| 150 | + public function deleteCalendarEvent(array $params = []) |
|
| 151 | + { |
|
| 152 | + $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
|
| 153 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
| 154 | + $method = 'DELETE'; |
|
| 155 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 156 | + $headers = ['Accept' => 'application/json']; |
|
| 157 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 158 | + $request = $this->addOtelAttributes($params, ['calendar_id', 'event_id'], $request, 'ml.delete_calendar_event'); |
|
| 159 | + return $this->client->sendRequest($request); |
|
| 160 | + } |
|
| 161 | + /** |
|
| 162 | + * Deletes anomaly detection jobs from a calendar. |
|
| 163 | + * |
|
| 164 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html |
|
| 165 | + * |
|
| 166 | + * @param array{ |
|
| 167 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 168 | + * job_id: string, // (REQUIRED) The ID of the job to remove from the calendar |
|
| 169 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 170 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 171 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 172 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 173 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 174 | + * } $params |
|
| 175 | + * |
|
| 176 | + * @throws MissingParameterException if a required parameter is missing |
|
| 177 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 178 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 179 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 180 | + * |
|
| 181 | + * @return Elasticsearch|Promise |
|
| 182 | + */ |
|
| 183 | + public function deleteCalendarJob(array $params = []) |
|
| 184 | + { |
|
| 185 | + $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
| 186 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 187 | + $method = 'DELETE'; |
|
| 188 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 189 | + $headers = ['Accept' => 'application/json']; |
|
| 190 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 191 | + $request = $this->addOtelAttributes($params, ['calendar_id', 'job_id'], $request, 'ml.delete_calendar_job'); |
|
| 192 | + return $this->client->sendRequest($request); |
|
| 193 | + } |
|
| 194 | + /** |
|
| 195 | + * Deletes an existing data frame analytics job. |
|
| 196 | + * |
|
| 197 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html |
|
| 198 | + * |
|
| 199 | + * @param array{ |
|
| 200 | + * id: string, // (REQUIRED) The ID of the data frame analytics to delete |
|
| 201 | + * force: boolean, // True if the job should be forcefully deleted |
|
| 202 | + * timeout: time, // Controls the time to wait until a job is deleted. Defaults to 1 minute |
|
| 203 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 204 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 205 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 206 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 207 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 208 | + * } $params |
|
| 209 | + * |
|
| 210 | + * @throws MissingParameterException if a required parameter is missing |
|
| 211 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 212 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 213 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 214 | + * |
|
| 215 | + * @return Elasticsearch|Promise |
|
| 216 | + */ |
|
| 217 | + public function deleteDataFrameAnalytics(array $params = []) |
|
| 218 | + { |
|
| 219 | + $this->checkRequiredParameters(['id'], $params); |
|
| 220 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 221 | + $method = 'DELETE'; |
|
| 222 | + $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 223 | + $headers = ['Accept' => 'application/json']; |
|
| 224 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 225 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.delete_data_frame_analytics'); |
|
| 226 | + return $this->client->sendRequest($request); |
|
| 227 | + } |
|
| 228 | + /** |
|
| 229 | + * Deletes an existing datafeed. |
|
| 230 | + * |
|
| 231 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html |
|
| 232 | + * |
|
| 233 | + * @param array{ |
|
| 234 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to delete |
|
| 235 | + * force: boolean, // True if the datafeed should be forcefully deleted |
|
| 236 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 237 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 238 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 239 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 240 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 241 | + * } $params |
|
| 242 | + * |
|
| 243 | + * @throws MissingParameterException if a required parameter is missing |
|
| 244 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 245 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 246 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 247 | + * |
|
| 248 | + * @return Elasticsearch|Promise |
|
| 249 | + */ |
|
| 250 | + public function deleteDatafeed(array $params = []) |
|
| 251 | + { |
|
| 252 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 253 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 254 | + $method = 'DELETE'; |
|
| 255 | + $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 256 | + $headers = ['Accept' => 'application/json']; |
|
| 257 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 258 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.delete_datafeed'); |
|
| 259 | + return $this->client->sendRequest($request); |
|
| 260 | + } |
|
| 261 | + /** |
|
| 262 | + * Deletes expired and unused machine learning data. |
|
| 263 | + * |
|
| 264 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html |
|
| 265 | + * |
|
| 266 | + * @param array{ |
|
| 267 | + * job_id: string, // The ID of the job(s) to perform expired data hygiene for |
|
| 268 | + * requests_per_second: number, // The desired requests per second for the deletion processes. |
|
| 269 | + * timeout: time, // How long can the underlying delete processes run until they are canceled |
|
| 270 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 271 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 272 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 273 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 274 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 275 | + * body: array, // deleting expired data parameters |
|
| 276 | + * } $params |
|
| 277 | + * |
|
| 278 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 279 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 280 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 281 | + * |
|
| 282 | + * @return Elasticsearch|Promise |
|
| 283 | + */ |
|
| 284 | + public function deleteExpiredData(array $params = []) |
|
| 285 | + { |
|
| 286 | + if (isset($params['job_id'])) { |
|
| 287 | + $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
| 288 | + $method = 'DELETE'; |
|
| 289 | + } else { |
|
| 290 | + $url = '/_ml/_delete_expired_data'; |
|
| 291 | + $method = 'DELETE'; |
|
| 292 | + } |
|
| 293 | + $url = $this->addQueryString($url, $params, ['requests_per_second', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 294 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 295 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 296 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.delete_expired_data'); |
|
| 297 | + return $this->client->sendRequest($request); |
|
| 298 | + } |
|
| 299 | + /** |
|
| 300 | + * Deletes a filter. |
|
| 301 | + * |
|
| 302 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html |
|
| 303 | + * |
|
| 304 | + * @param array{ |
|
| 305 | + * filter_id: string, // (REQUIRED) The ID of the filter to delete |
|
| 306 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 307 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 308 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 309 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 310 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 311 | + * } $params |
|
| 312 | + * |
|
| 313 | + * @throws MissingParameterException if a required parameter is missing |
|
| 314 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 315 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 316 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 317 | + * |
|
| 318 | + * @return Elasticsearch|Promise |
|
| 319 | + */ |
|
| 320 | + public function deleteFilter(array $params = []) |
|
| 321 | + { |
|
| 322 | + $this->checkRequiredParameters(['filter_id'], $params); |
|
| 323 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 324 | + $method = 'DELETE'; |
|
| 325 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 326 | + $headers = ['Accept' => 'application/json']; |
|
| 327 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 328 | + $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.delete_filter'); |
|
| 329 | + return $this->client->sendRequest($request); |
|
| 330 | + } |
|
| 331 | + /** |
|
| 332 | + * Deletes forecasts from a machine learning job. |
|
| 333 | + * |
|
| 334 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html |
|
| 335 | + * |
|
| 336 | + * @param array{ |
|
| 337 | + * job_id: string, // (REQUIRED) The ID of the job from which to delete forecasts |
|
| 338 | + * forecast_id: string, // The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` |
|
| 339 | + * allow_no_forecasts: boolean, // Whether to ignore if `_all` matches no forecasts |
|
| 340 | + * timeout: time, // Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds |
|
| 341 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 342 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 343 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 344 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 345 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 346 | + * } $params |
|
| 347 | + * |
|
| 348 | + * @throws MissingParameterException if a required parameter is missing |
|
| 349 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 350 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 351 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 352 | + * |
|
| 353 | + * @return Elasticsearch|Promise |
|
| 354 | + */ |
|
| 355 | + public function deleteForecast(array $params = []) |
|
| 356 | + { |
|
| 357 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 358 | + if (isset($params['forecast_id'])) { |
|
| 359 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
| 360 | + $method = 'DELETE'; |
|
| 361 | + } else { |
|
| 362 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 363 | + $method = 'DELETE'; |
|
| 364 | + } |
|
| 365 | + $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 366 | + $headers = ['Accept' => 'application/json']; |
|
| 367 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 368 | + $request = $this->addOtelAttributes($params, ['job_id', 'forecast_id'], $request, 'ml.delete_forecast'); |
|
| 369 | + return $this->client->sendRequest($request); |
|
| 370 | + } |
|
| 371 | + /** |
|
| 372 | + * Deletes an existing anomaly detection job. |
|
| 373 | + * |
|
| 374 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html |
|
| 375 | + * |
|
| 376 | + * @param array{ |
|
| 377 | + * job_id: string, // (REQUIRED) The ID of the job to delete |
|
| 378 | + * force: boolean, // True if the job should be forcefully deleted |
|
| 379 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 380 | + * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
| 381 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 382 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 383 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 384 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 385 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 386 | + * } $params |
|
| 387 | + * |
|
| 388 | + * @throws MissingParameterException if a required parameter is missing |
|
| 389 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 390 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 391 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 392 | + * |
|
| 393 | + * @return Elasticsearch|Promise |
|
| 394 | + */ |
|
| 395 | + public function deleteJob(array $params = []) |
|
| 396 | + { |
|
| 397 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 398 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 399 | + $method = 'DELETE'; |
|
| 400 | + $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 401 | + $headers = ['Accept' => 'application/json']; |
|
| 402 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 403 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.delete_job'); |
|
| 404 | + return $this->client->sendRequest($request); |
|
| 405 | + } |
|
| 406 | + /** |
|
| 407 | + * Deletes an existing model snapshot. |
|
| 408 | + * |
|
| 409 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html |
|
| 410 | + * |
|
| 411 | + * @param array{ |
|
| 412 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 413 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to delete |
|
| 414 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 415 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 416 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 417 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 418 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 419 | + * } $params |
|
| 420 | + * |
|
| 421 | + * @throws MissingParameterException if a required parameter is missing |
|
| 422 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 423 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 424 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 425 | + * |
|
| 426 | + * @return Elasticsearch|Promise |
|
| 427 | + */ |
|
| 428 | + public function deleteModelSnapshot(array $params = []) |
|
| 429 | + { |
|
| 430 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 431 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 432 | + $method = 'DELETE'; |
|
| 433 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 434 | + $headers = ['Accept' => 'application/json']; |
|
| 435 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 436 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.delete_model_snapshot'); |
|
| 437 | + return $this->client->sendRequest($request); |
|
| 438 | + } |
|
| 439 | + /** |
|
| 440 | + * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. |
|
| 441 | + * |
|
| 442 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html |
|
| 443 | + * |
|
| 444 | + * @param array{ |
|
| 445 | + * model_id: string, // (REQUIRED) The ID of the trained model to delete |
|
| 446 | + * timeout: time, // Controls the amount of time to wait for the model to be deleted. |
|
| 447 | + * force: boolean, // True if the model should be forcefully deleted |
|
| 448 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 449 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 450 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 451 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 452 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 453 | + * } $params |
|
| 454 | + * |
|
| 455 | + * @throws MissingParameterException if a required parameter is missing |
|
| 456 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 457 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 458 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 459 | + * |
|
| 460 | + * @return Elasticsearch|Promise |
|
| 461 | + */ |
|
| 462 | + public function deleteTrainedModel(array $params = []) |
|
| 463 | + { |
|
| 464 | + $this->checkRequiredParameters(['model_id'], $params); |
|
| 465 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 466 | + $method = 'DELETE'; |
|
| 467 | + $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 468 | + $headers = ['Accept' => 'application/json']; |
|
| 469 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 470 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.delete_trained_model'); |
|
| 471 | + return $this->client->sendRequest($request); |
|
| 472 | + } |
|
| 473 | + /** |
|
| 474 | + * Deletes a model alias that refers to the trained model |
|
| 475 | + * |
|
| 476 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html |
|
| 477 | + * |
|
| 478 | + * @param array{ |
|
| 479 | + * model_alias: string, // (REQUIRED) The trained model alias to delete |
|
| 480 | + * model_id: string, // (REQUIRED) The trained model where the model alias is assigned |
|
| 481 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 482 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 483 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 484 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 485 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 486 | + * } $params |
|
| 487 | + * |
|
| 488 | + * @throws MissingParameterException if a required parameter is missing |
|
| 489 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 490 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 491 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 492 | + * |
|
| 493 | + * @return Elasticsearch|Promise |
|
| 494 | + */ |
|
| 495 | + public function deleteTrainedModelAlias(array $params = []) |
|
| 496 | + { |
|
| 497 | + $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
| 498 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 499 | + $method = 'DELETE'; |
|
| 500 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 501 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 502 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 503 | + $request = $this->addOtelAttributes($params, ['model_alias', 'model_id'], $request, 'ml.delete_trained_model_alias'); |
|
| 504 | + return $this->client->sendRequest($request); |
|
| 505 | + } |
|
| 506 | + /** |
|
| 507 | + * Estimates the model memory |
|
| 508 | + * |
|
| 509 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html |
|
| 510 | + * |
|
| 511 | + * @param array{ |
|
| 512 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 513 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 514 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 515 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 516 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 517 | + * body: array, // (REQUIRED) The analysis config, plus cardinality estimates for fields it references |
|
| 518 | + * } $params |
|
| 519 | + * |
|
| 520 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 521 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 522 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 523 | + * |
|
| 524 | + * @return Elasticsearch|Promise |
|
| 525 | + */ |
|
| 526 | + public function estimateModelMemory(array $params = []) |
|
| 527 | + { |
|
| 528 | + $this->checkRequiredParameters(['body'], $params); |
|
| 529 | + $url = '/_ml/anomaly_detectors/_estimate_model_memory'; |
|
| 530 | + $method = 'POST'; |
|
| 531 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 532 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 533 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 534 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.estimate_model_memory'); |
|
| 535 | + return $this->client->sendRequest($request); |
|
| 536 | + } |
|
| 537 | + /** |
|
| 538 | + * Evaluates the data frame analytics for an annotated index. |
|
| 539 | + * |
|
| 540 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html |
|
| 541 | + * |
|
| 542 | + * @param array{ |
|
| 543 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 544 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 545 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 546 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 547 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 548 | + * body: array, // (REQUIRED) The evaluation definition |
|
| 549 | + * } $params |
|
| 550 | + * |
|
| 551 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 552 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 553 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 554 | + * |
|
| 555 | + * @return Elasticsearch|Promise |
|
| 556 | + */ |
|
| 557 | + public function evaluateDataFrame(array $params = []) |
|
| 558 | + { |
|
| 559 | + $this->checkRequiredParameters(['body'], $params); |
|
| 560 | + $url = '/_ml/data_frame/_evaluate'; |
|
| 561 | + $method = 'POST'; |
|
| 562 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 563 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 564 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 565 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.evaluate_data_frame'); |
|
| 566 | + return $this->client->sendRequest($request); |
|
| 567 | + } |
|
| 568 | + /** |
|
| 569 | + * Explains a data frame analytics config. |
|
| 570 | + * |
|
| 571 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html |
|
| 572 | + * |
|
| 573 | + * @param array{ |
|
| 574 | + * id: string, // The ID of the data frame analytics to explain |
|
| 575 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 576 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 577 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 578 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 579 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 580 | + * body: array, // The data frame analytics config to explain |
|
| 581 | + * } $params |
|
| 582 | + * |
|
| 583 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 584 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 585 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 586 | + * |
|
| 587 | + * @return Elasticsearch|Promise |
|
| 588 | + */ |
|
| 589 | + public function explainDataFrameAnalytics(array $params = []) |
|
| 590 | + { |
|
| 591 | + if (isset($params['id'])) { |
|
| 592 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
| 593 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 594 | + } else { |
|
| 595 | + $url = '/_ml/data_frame/analytics/_explain'; |
|
| 596 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 597 | + } |
|
| 598 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 599 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 600 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 601 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.explain_data_frame_analytics'); |
|
| 602 | + return $this->client->sendRequest($request); |
|
| 603 | + } |
|
| 604 | + /** |
|
| 605 | + * Forces any buffered data to be processed by the job. |
|
| 606 | + * |
|
| 607 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html |
|
| 608 | + * |
|
| 609 | + * @param array{ |
|
| 610 | + * job_id: string, // (REQUIRED) The name of the job to flush |
|
| 611 | + * calc_interim: boolean, // Calculates interim results for the most recent bucket or all buckets within the latency period |
|
| 612 | + * start: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
| 613 | + * end: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
| 614 | + * advance_time: string, // Advances time to the given value generating results and updating the model for the advanced interval |
|
| 615 | + * skip_time: string, // Skips time to the given value without generating results or updating the model for the skipped interval |
|
| 616 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 617 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 618 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 619 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 620 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 621 | + * body: array, // Flush parameters |
|
| 622 | + * } $params |
|
| 623 | + * |
|
| 624 | + * @throws MissingParameterException if a required parameter is missing |
|
| 625 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 626 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 627 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 628 | + * |
|
| 629 | + * @return Elasticsearch|Promise |
|
| 630 | + */ |
|
| 631 | + public function flushJob(array $params = []) |
|
| 632 | + { |
|
| 633 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 634 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
| 635 | + $method = 'POST'; |
|
| 636 | + $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 637 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 638 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 639 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.flush_job'); |
|
| 640 | + return $this->client->sendRequest($request); |
|
| 641 | + } |
|
| 642 | + /** |
|
| 643 | + * Predicts the future behavior of a time series by using its historical behavior. |
|
| 644 | + * |
|
| 645 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html |
|
| 646 | + * |
|
| 647 | + * @param array{ |
|
| 648 | + * job_id: string, // (REQUIRED) The ID of the job to forecast for |
|
| 649 | + * duration: time, // The duration of the forecast |
|
| 650 | + * expires_in: time, // The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. |
|
| 651 | + * max_model_memory: string, // The max memory able to be used by the forecast. Default is 20mb. |
|
| 652 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 653 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 654 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 655 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 656 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 657 | + * body: array, // Query parameters can be specified in the body |
|
| 658 | + * } $params |
|
| 659 | + * |
|
| 660 | + * @throws MissingParameterException if a required parameter is missing |
|
| 661 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 662 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 663 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 664 | + * |
|
| 665 | + * @return Elasticsearch|Promise |
|
| 666 | + */ |
|
| 667 | + public function forecast(array $params = []) |
|
| 668 | + { |
|
| 669 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 670 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 671 | + $method = 'POST'; |
|
| 672 | + $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 673 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 674 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 675 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.forecast'); |
|
| 676 | + return $this->client->sendRequest($request); |
|
| 677 | + } |
|
| 678 | + /** |
|
| 679 | + * Retrieves anomaly detection job results for one or more buckets. |
|
| 680 | + * |
|
| 681 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html |
|
| 682 | + * |
|
| 683 | + * @param array{ |
|
| 684 | + * job_id: string, // (REQUIRED) ID of the job to get bucket results from |
|
| 685 | + * timestamp: string, // The timestamp of the desired single bucket result |
|
| 686 | + * expand: boolean, // Include anomaly records |
|
| 687 | + * exclude_interim: boolean, // Exclude interim results |
|
| 688 | + * from: int, // skips a number of buckets |
|
| 689 | + * size: int, // specifies a max number of buckets to get |
|
| 690 | + * start: string, // Start time filter for buckets |
|
| 691 | + * end: string, // End time filter for buckets |
|
| 692 | + * anomaly_score: double, // Filter for the most anomalous buckets |
|
| 693 | + * sort: string, // Sort buckets by a particular field |
|
| 694 | + * desc: boolean, // Set the sort direction |
|
| 695 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 696 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 697 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 698 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 699 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 700 | + * body: array, // Bucket selection details if not provided in URI |
|
| 701 | + * } $params |
|
| 702 | + * |
|
| 703 | + * @throws MissingParameterException if a required parameter is missing |
|
| 704 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 705 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 706 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 707 | + * |
|
| 708 | + * @return Elasticsearch|Promise |
|
| 709 | + */ |
|
| 710 | + public function getBuckets(array $params = []) |
|
| 711 | + { |
|
| 712 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 713 | + if (isset($params['timestamp'])) { |
|
| 714 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
| 715 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 716 | + } else { |
|
| 717 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
| 718 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 719 | + } |
|
| 720 | + $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 721 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 722 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 723 | + $request = $this->addOtelAttributes($params, ['job_id', 'timestamp'], $request, 'ml.get_buckets'); |
|
| 724 | + return $this->client->sendRequest($request); |
|
| 725 | + } |
|
| 726 | + /** |
|
| 727 | + * Retrieves information about the scheduled events in calendars. |
|
| 728 | + * |
|
| 729 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html |
|
| 730 | + * |
|
| 731 | + * @param array{ |
|
| 732 | + * calendar_id: string, // (REQUIRED) The ID of the calendar containing the events |
|
| 733 | + * job_id: string, // Get events for the job. When this option is used calendar_id must be '_all' |
|
| 734 | + * start: string, // Get events after this time |
|
| 735 | + * end: date, // Get events before this time |
|
| 736 | + * from: int, // Skips a number of events |
|
| 737 | + * size: int, // Specifies a max number of events to get |
|
| 738 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 739 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 740 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 741 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 742 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 743 | + * } $params |
|
| 744 | + * |
|
| 745 | + * @throws MissingParameterException if a required parameter is missing |
|
| 746 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 747 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 748 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 749 | + * |
|
| 750 | + * @return Elasticsearch|Promise |
|
| 751 | + */ |
|
| 752 | + public function getCalendarEvents(array $params = []) |
|
| 753 | + { |
|
| 754 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 755 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 756 | + $method = 'GET'; |
|
| 757 | + $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 758 | + $headers = ['Accept' => 'application/json']; |
|
| 759 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 760 | + $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.get_calendar_events'); |
|
| 761 | + return $this->client->sendRequest($request); |
|
| 762 | + } |
|
| 763 | + /** |
|
| 764 | + * Retrieves configuration information for calendars. |
|
| 765 | + * |
|
| 766 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html |
|
| 767 | + * |
|
| 768 | + * @param array{ |
|
| 769 | + * calendar_id: string, // The ID of the calendar to fetch |
|
| 770 | + * from: int, // skips a number of calendars |
|
| 771 | + * size: int, // specifies a max number of calendars to get |
|
| 772 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 773 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 774 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 775 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 776 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 777 | + * body: array, // The from and size parameters optionally sent in the body |
|
| 778 | + * } $params |
|
| 779 | + * |
|
| 780 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 781 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 782 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 783 | + * |
|
| 784 | + * @return Elasticsearch|Promise |
|
| 785 | + */ |
|
| 786 | + public function getCalendars(array $params = []) |
|
| 787 | + { |
|
| 788 | + if (isset($params['calendar_id'])) { |
|
| 789 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 790 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 791 | + } else { |
|
| 792 | + $url = '/_ml/calendars'; |
|
| 793 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 794 | + } |
|
| 795 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 796 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 797 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 798 | + $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.get_calendars'); |
|
| 799 | + return $this->client->sendRequest($request); |
|
| 800 | + } |
|
| 801 | + /** |
|
| 802 | + * Retrieves anomaly detection job results for one or more categories. |
|
| 803 | + * |
|
| 804 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html |
|
| 805 | + * |
|
| 806 | + * @param array{ |
|
| 807 | + * job_id: string, // (REQUIRED) The name of the job |
|
| 808 | + * category_id: long, // The identifier of the category definition of interest |
|
| 809 | + * from: int, // skips a number of categories |
|
| 810 | + * size: int, // specifies a max number of categories to get |
|
| 811 | + * partition_field_value: string, // Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled. |
|
| 812 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 813 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 814 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 815 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 816 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 817 | + * body: array, // Category selection details if not provided in URI |
|
| 818 | + * } $params |
|
| 819 | + * |
|
| 820 | + * @throws MissingParameterException if a required parameter is missing |
|
| 821 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 822 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 823 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 824 | + * |
|
| 825 | + * @return Elasticsearch|Promise |
|
| 826 | + */ |
|
| 827 | + public function getCategories(array $params = []) |
|
| 828 | + { |
|
| 829 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 830 | + if (isset($params['category_id'])) { |
|
| 831 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
| 832 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 833 | + } else { |
|
| 834 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories'; |
|
| 835 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 836 | + } |
|
| 837 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 838 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 839 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 840 | + $request = $this->addOtelAttributes($params, ['job_id', 'category_id'], $request, 'ml.get_categories'); |
|
| 841 | + return $this->client->sendRequest($request); |
|
| 842 | + } |
|
| 843 | + /** |
|
| 844 | + * Retrieves configuration information for data frame analytics jobs. |
|
| 845 | + * |
|
| 846 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html |
|
| 847 | + * |
|
| 848 | + * @param array{ |
|
| 849 | + * id: string, // The ID of the data frame analytics to fetch |
|
| 850 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 851 | + * from: int, // skips a number of analytics |
|
| 852 | + * size: int, // specifies a max number of analytics to get |
|
| 853 | + * exclude_generated: boolean, // Omits fields that are illegal to set on data frame analytics PUT |
|
| 854 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 855 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 856 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 857 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 858 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 859 | + * } $params |
|
| 860 | + * |
|
| 861 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 862 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 863 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 864 | + * |
|
| 865 | + * @return Elasticsearch|Promise |
|
| 866 | + */ |
|
| 867 | + public function getDataFrameAnalytics(array $params = []) |
|
| 868 | + { |
|
| 869 | + if (isset($params['id'])) { |
|
| 870 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 871 | + $method = 'GET'; |
|
| 872 | + } else { |
|
| 873 | + $url = '/_ml/data_frame/analytics'; |
|
| 874 | + $method = 'GET'; |
|
| 875 | + } |
|
| 876 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 877 | + $headers = ['Accept' => 'application/json']; |
|
| 878 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 879 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.get_data_frame_analytics'); |
|
| 880 | + return $this->client->sendRequest($request); |
|
| 881 | + } |
|
| 882 | + /** |
|
| 883 | + * Retrieves usage information for data frame analytics jobs. |
|
| 884 | + * |
|
| 885 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html |
|
| 886 | + * |
|
| 887 | + * @param array{ |
|
| 888 | + * id: string, // The ID of the data frame analytics stats to fetch |
|
| 889 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 890 | + * from: int, // skips a number of analytics |
|
| 891 | + * size: int, // specifies a max number of analytics to get |
|
| 892 | + * verbose: boolean, // whether the stats response should be verbose |
|
| 893 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 894 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 895 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 896 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 897 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 898 | + * } $params |
|
| 899 | + * |
|
| 900 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 901 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 902 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 903 | + * |
|
| 904 | + * @return Elasticsearch|Promise |
|
| 905 | + */ |
|
| 906 | + public function getDataFrameAnalyticsStats(array $params = []) |
|
| 907 | + { |
|
| 908 | + if (isset($params['id'])) { |
|
| 909 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
| 910 | + $method = 'GET'; |
|
| 911 | + } else { |
|
| 912 | + $url = '/_ml/data_frame/analytics/_stats'; |
|
| 913 | + $method = 'GET'; |
|
| 914 | + } |
|
| 915 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 916 | + $headers = ['Accept' => 'application/json']; |
|
| 917 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 918 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.get_data_frame_analytics_stats'); |
|
| 919 | + return $this->client->sendRequest($request); |
|
| 920 | + } |
|
| 921 | + /** |
|
| 922 | + * Retrieves usage information for datafeeds. |
|
| 923 | + * |
|
| 924 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html |
|
| 925 | + * |
|
| 926 | + * @param array{ |
|
| 927 | + * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
| 928 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 929 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 930 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 931 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 932 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 933 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 934 | + * } $params |
|
| 935 | + * |
|
| 936 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 937 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 938 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 939 | + * |
|
| 940 | + * @return Elasticsearch|Promise |
|
| 941 | + */ |
|
| 942 | + public function getDatafeedStats(array $params = []) |
|
| 943 | + { |
|
| 944 | + if (isset($params['datafeed_id'])) { |
|
| 945 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
| 946 | + $method = 'GET'; |
|
| 947 | + } else { |
|
| 948 | + $url = '/_ml/datafeeds/_stats'; |
|
| 949 | + $method = 'GET'; |
|
| 950 | + } |
|
| 951 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 952 | + $headers = ['Accept' => 'application/json']; |
|
| 953 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 954 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.get_datafeed_stats'); |
|
| 955 | + return $this->client->sendRequest($request); |
|
| 956 | + } |
|
| 957 | + /** |
|
| 958 | + * Retrieves configuration information for datafeeds. |
|
| 959 | + * |
|
| 960 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html |
|
| 961 | + * |
|
| 962 | + * @param array{ |
|
| 963 | + * datafeed_id: string, // The ID of the datafeeds to fetch |
|
| 964 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 965 | + * exclude_generated: boolean, // Omits fields that are illegal to set on datafeed PUT |
|
| 966 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 967 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 968 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 969 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 970 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 971 | + * } $params |
|
| 972 | + * |
|
| 973 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 974 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 975 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 976 | + * |
|
| 977 | + * @return Elasticsearch|Promise |
|
| 978 | + */ |
|
| 979 | + public function getDatafeeds(array $params = []) |
|
| 980 | + { |
|
| 981 | + if (isset($params['datafeed_id'])) { |
|
| 982 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 983 | + $method = 'GET'; |
|
| 984 | + } else { |
|
| 985 | + $url = '/_ml/datafeeds'; |
|
| 986 | + $method = 'GET'; |
|
| 987 | + } |
|
| 988 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 989 | + $headers = ['Accept' => 'application/json']; |
|
| 990 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 991 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.get_datafeeds'); |
|
| 992 | + return $this->client->sendRequest($request); |
|
| 993 | + } |
|
| 994 | + /** |
|
| 995 | + * Retrieves filters. |
|
| 996 | + * |
|
| 997 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html |
|
| 998 | + * |
|
| 999 | + * @param array{ |
|
| 1000 | + * filter_id: string, // The ID of the filter to fetch |
|
| 1001 | + * from: int, // skips a number of filters |
|
| 1002 | + * size: int, // specifies a max number of filters to get |
|
| 1003 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1004 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1005 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1006 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1007 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1008 | + * } $params |
|
| 1009 | + * |
|
| 1010 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1011 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1012 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1013 | + * |
|
| 1014 | + * @return Elasticsearch|Promise |
|
| 1015 | + */ |
|
| 1016 | + public function getFilters(array $params = []) |
|
| 1017 | + { |
|
| 1018 | + if (isset($params['filter_id'])) { |
|
| 1019 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1020 | + $method = 'GET'; |
|
| 1021 | + } else { |
|
| 1022 | + $url = '/_ml/filters'; |
|
| 1023 | + $method = 'GET'; |
|
| 1024 | + } |
|
| 1025 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1026 | + $headers = ['Accept' => 'application/json']; |
|
| 1027 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1028 | + $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.get_filters'); |
|
| 1029 | + return $this->client->sendRequest($request); |
|
| 1030 | + } |
|
| 1031 | + /** |
|
| 1032 | + * Retrieves anomaly detection job results for one or more influencers. |
|
| 1033 | + * |
|
| 1034 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html |
|
| 1035 | + * |
|
| 1036 | + * @param array{ |
|
| 1037 | + * job_id: string, // (REQUIRED) Identifier for the anomaly detection job |
|
| 1038 | + * exclude_interim: boolean, // Exclude interim results |
|
| 1039 | + * from: int, // skips a number of influencers |
|
| 1040 | + * size: int, // specifies a max number of influencers to get |
|
| 1041 | + * start: string, // start timestamp for the requested influencers |
|
| 1042 | + * end: string, // end timestamp for the requested influencers |
|
| 1043 | + * influencer_score: double, // influencer score threshold for the requested influencers |
|
| 1044 | + * sort: string, // sort field for the requested influencers |
|
| 1045 | + * desc: boolean, // whether the results should be sorted in decending order |
|
| 1046 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1047 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1048 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1049 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1050 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1051 | + * body: array, // Influencer selection criteria |
|
| 1052 | + * } $params |
|
| 1053 | + * |
|
| 1054 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1055 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1056 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1057 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1058 | + * |
|
| 1059 | + * @return Elasticsearch|Promise |
|
| 1060 | + */ |
|
| 1061 | + public function getInfluencers(array $params = []) |
|
| 1062 | + { |
|
| 1063 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 1064 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
| 1065 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1066 | + $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1067 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1068 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1069 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_influencers'); |
|
| 1070 | + return $this->client->sendRequest($request); |
|
| 1071 | + } |
|
| 1072 | + /** |
|
| 1073 | + * Retrieves usage information for anomaly detection jobs. |
|
| 1074 | + * |
|
| 1075 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html |
|
| 1076 | + * |
|
| 1077 | + * @param array{ |
|
| 1078 | + * job_id: string, // The ID of the jobs stats to fetch |
|
| 1079 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1080 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1081 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1082 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1083 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1084 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1085 | + * } $params |
|
| 1086 | + * |
|
| 1087 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1088 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1089 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1090 | + * |
|
| 1091 | + * @return Elasticsearch|Promise |
|
| 1092 | + */ |
|
| 1093 | + public function getJobStats(array $params = []) |
|
| 1094 | + { |
|
| 1095 | + if (isset($params['job_id'])) { |
|
| 1096 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
| 1097 | + $method = 'GET'; |
|
| 1098 | + } else { |
|
| 1099 | + $url = '/_ml/anomaly_detectors/_stats'; |
|
| 1100 | + $method = 'GET'; |
|
| 1101 | + } |
|
| 1102 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1103 | + $headers = ['Accept' => 'application/json']; |
|
| 1104 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1105 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_job_stats'); |
|
| 1106 | + return $this->client->sendRequest($request); |
|
| 1107 | + } |
|
| 1108 | + /** |
|
| 1109 | + * Retrieves configuration information for anomaly detection jobs. |
|
| 1110 | + * |
|
| 1111 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html |
|
| 1112 | + * |
|
| 1113 | + * @param array{ |
|
| 1114 | + * job_id: string, // The ID of the jobs to fetch |
|
| 1115 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1116 | + * exclude_generated: boolean, // Omits fields that are illegal to set on job PUT |
|
| 1117 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1118 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1119 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1120 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1121 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1122 | + * } $params |
|
| 1123 | + * |
|
| 1124 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1125 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1126 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1127 | + * |
|
| 1128 | + * @return Elasticsearch|Promise |
|
| 1129 | + */ |
|
| 1130 | + public function getJobs(array $params = []) |
|
| 1131 | + { |
|
| 1132 | + if (isset($params['job_id'])) { |
|
| 1133 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1134 | + $method = 'GET'; |
|
| 1135 | + } else { |
|
| 1136 | + $url = '/_ml/anomaly_detectors'; |
|
| 1137 | + $method = 'GET'; |
|
| 1138 | + } |
|
| 1139 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1140 | + $headers = ['Accept' => 'application/json']; |
|
| 1141 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1142 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_jobs'); |
|
| 1143 | + return $this->client->sendRequest($request); |
|
| 1144 | + } |
|
| 1145 | + /** |
|
| 1146 | + * Returns information on how ML is using memory. |
|
| 1147 | + * |
|
| 1148 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html |
|
| 1149 | + * |
|
| 1150 | + * @param array{ |
|
| 1151 | + * node_id: string, // Specifies the node or nodes to retrieve stats for. |
|
| 1152 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 1153 | + * timeout: time, // Explicit operation timeout |
|
| 1154 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1155 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1156 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1157 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1158 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1159 | + * } $params |
|
| 1160 | + * |
|
| 1161 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1162 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1163 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1164 | + * |
|
| 1165 | + * @return Elasticsearch|Promise |
|
| 1166 | + */ |
|
| 1167 | + public function getMemoryStats(array $params = []) |
|
| 1168 | + { |
|
| 1169 | + if (isset($params['node_id'])) { |
|
| 1170 | + $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
| 1171 | + $method = 'GET'; |
|
| 1172 | + } else { |
|
| 1173 | + $url = '/_ml/memory/_stats'; |
|
| 1174 | + $method = 'GET'; |
|
| 1175 | + } |
|
| 1176 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1177 | + $headers = ['Accept' => 'application/json']; |
|
| 1178 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1179 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'ml.get_memory_stats'); |
|
| 1180 | + return $this->client->sendRequest($request); |
|
| 1181 | + } |
|
| 1182 | + /** |
|
| 1183 | + * Gets stats for anomaly detection job model snapshot upgrades that are in progress. |
|
| 1184 | + * |
|
| 1185 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html |
|
| 1186 | + * |
|
| 1187 | + * @param array{ |
|
| 1188 | + * job_id: string, // (REQUIRED) The ID of the job. May be a wildcard, comma separated list or `_all`. |
|
| 1189 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot. May be a wildcard, comma separated list or `_all`. |
|
| 1190 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) |
|
| 1191 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1192 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1193 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1194 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1195 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1196 | + * } $params |
|
| 1197 | + * |
|
| 1198 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1199 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1200 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1201 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1202 | + * |
|
| 1203 | + * @return Elasticsearch|Promise |
|
| 1204 | + */ |
|
| 1205 | + public function getModelSnapshotUpgradeStats(array $params = []) |
|
| 1206 | + { |
|
| 1207 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 1208 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
| 1209 | + $method = 'GET'; |
|
| 1210 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1211 | + $headers = ['Accept' => 'application/json']; |
|
| 1212 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1213 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.get_model_snapshot_upgrade_stats'); |
|
| 1214 | + return $this->client->sendRequest($request); |
|
| 1215 | + } |
|
| 1216 | + /** |
|
| 1217 | + * Retrieves information about model snapshots. |
|
| 1218 | + * |
|
| 1219 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html |
|
| 1220 | + * |
|
| 1221 | + * @param array{ |
|
| 1222 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 1223 | + * snapshot_id: string, // The ID of the snapshot to fetch |
|
| 1224 | + * from: int, // Skips a number of documents |
|
| 1225 | + * size: int, // The default number of documents returned in queries as a string. |
|
| 1226 | + * start: date, // The filter 'start' query parameter |
|
| 1227 | + * end: date, // The filter 'end' query parameter |
|
| 1228 | + * sort: string, // Name of the field to sort on |
|
| 1229 | + * desc: boolean, // True if the results should be sorted in descending order |
|
| 1230 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1231 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1232 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1233 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1234 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1235 | + * body: array, // Model snapshot selection criteria |
|
| 1236 | + * } $params |
|
| 1237 | + * |
|
| 1238 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1239 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1240 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1241 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1242 | + * |
|
| 1243 | + * @return Elasticsearch|Promise |
|
| 1244 | + */ |
|
| 1245 | + public function getModelSnapshots(array $params = []) |
|
| 1246 | + { |
|
| 1247 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 1248 | + if (isset($params['snapshot_id'])) { |
|
| 1249 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 1250 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1251 | + } else { |
|
| 1252 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
| 1253 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1254 | + } |
|
| 1255 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1256 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1257 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1258 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.get_model_snapshots'); |
|
| 1259 | + return $this->client->sendRequest($request); |
|
| 1260 | + } |
|
| 1261 | + /** |
|
| 1262 | + * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. |
|
| 1263 | + * |
|
| 1264 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html |
|
| 1265 | + * |
|
| 1266 | + * @param array{ |
|
| 1267 | + * job_id: string, // (REQUIRED) The job IDs for which to calculate overall bucket results |
|
| 1268 | + * top_n: int, // The number of top job bucket scores to be used in the overall_score calculation |
|
| 1269 | + * bucket_span: string, // The span of the overall buckets. Defaults to the longest job bucket_span |
|
| 1270 | + * overall_score: double, // Returns overall buckets with overall scores higher than this value |
|
| 1271 | + * exclude_interim: boolean, // If true overall buckets that include interim buckets will be excluded |
|
| 1272 | + * start: string, // Returns overall buckets with timestamps after this time |
|
| 1273 | + * end: string, // Returns overall buckets with timestamps earlier than this time |
|
| 1274 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |
|
| 1275 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1276 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1277 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1278 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1279 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1280 | + * body: array, // Overall bucket selection details if not provided in URI |
|
| 1281 | + * } $params |
|
| 1282 | + * |
|
| 1283 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1284 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1285 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1286 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1287 | + * |
|
| 1288 | + * @return Elasticsearch|Promise |
|
| 1289 | + */ |
|
| 1290 | + public function getOverallBuckets(array $params = []) |
|
| 1291 | + { |
|
| 1292 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 1293 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
| 1294 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1295 | + $url = $this->addQueryString($url, $params, ['top_n', 'bucket_span', 'overall_score', 'exclude_interim', 'start', 'end', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1296 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1297 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1298 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_overall_buckets'); |
|
| 1299 | + return $this->client->sendRequest($request); |
|
| 1300 | + } |
|
| 1301 | + /** |
|
| 1302 | + * Retrieves anomaly records for an anomaly detection job. |
|
| 1303 | + * |
|
| 1304 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html |
|
| 1305 | + * |
|
| 1306 | + * @param array{ |
|
| 1307 | + * job_id: string, // (REQUIRED) The ID of the job |
|
| 1308 | + * exclude_interim: boolean, // Exclude interim results |
|
| 1309 | + * from: int, // skips a number of records |
|
| 1310 | + * size: int, // specifies a max number of records to get |
|
| 1311 | + * start: string, // Start time filter for records |
|
| 1312 | + * end: string, // End time filter for records |
|
| 1313 | + * record_score: double, // Returns records with anomaly scores greater or equal than this value |
|
| 1314 | + * sort: string, // Sort records by a particular field |
|
| 1315 | + * desc: boolean, // Set the sort direction |
|
| 1316 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1317 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1318 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1319 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1320 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1321 | + * body: array, // Record selection criteria |
|
| 1322 | + * } $params |
|
| 1323 | + * |
|
| 1324 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1325 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1326 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1327 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1328 | + * |
|
| 1329 | + * @return Elasticsearch|Promise |
|
| 1330 | + */ |
|
| 1331 | + public function getRecords(array $params = []) |
|
| 1332 | + { |
|
| 1333 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 1334 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
| 1335 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1336 | + $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1337 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1338 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1339 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.get_records'); |
|
| 1340 | + return $this->client->sendRequest($request); |
|
| 1341 | + } |
|
| 1342 | + /** |
|
| 1343 | + * Retrieves configuration information for a trained inference model. |
|
| 1344 | + * |
|
| 1345 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html |
|
| 1346 | + * |
|
| 1347 | + * @param array{ |
|
| 1348 | + * model_id: string, // The ID of the trained models to fetch |
|
| 1349 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) |
|
| 1350 | + * include: string, // A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. |
|
| 1351 | + * include_model_definition: boolean, // Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. |
|
| 1352 | + * decompress_definition: boolean, // Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. |
|
| 1353 | + * from: int, // skips a number of trained models |
|
| 1354 | + * size: int, // specifies a max number of trained models to get |
|
| 1355 | + * tags: list, // A comma-separated list of tags that the model must have. |
|
| 1356 | + * exclude_generated: boolean, // Omits fields that are illegal to set on model PUT |
|
| 1357 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1358 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1359 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1360 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1361 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1362 | + * } $params |
|
| 1363 | + * |
|
| 1364 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1365 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1366 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1367 | + * |
|
| 1368 | + * @return Elasticsearch|Promise |
|
| 1369 | + */ |
|
| 1370 | + public function getTrainedModels(array $params = []) |
|
| 1371 | + { |
|
| 1372 | + if (isset($params['model_id'])) { |
|
| 1373 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1374 | + $method = 'GET'; |
|
| 1375 | + } else { |
|
| 1376 | + $url = '/_ml/trained_models'; |
|
| 1377 | + $method = 'GET'; |
|
| 1378 | + } |
|
| 1379 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'include', 'include_model_definition', 'decompress_definition', 'from', 'size', 'tags', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1380 | + $headers = ['Accept' => 'application/json']; |
|
| 1381 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1382 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.get_trained_models'); |
|
| 1383 | + return $this->client->sendRequest($request); |
|
| 1384 | + } |
|
| 1385 | + /** |
|
| 1386 | + * Retrieves usage information for trained inference models. |
|
| 1387 | + * |
|
| 1388 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html |
|
| 1389 | + * |
|
| 1390 | + * @param array{ |
|
| 1391 | + * model_id: string, // The ID of the trained models stats to fetch |
|
| 1392 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) |
|
| 1393 | + * from: int, // skips a number of trained models |
|
| 1394 | + * size: int, // specifies a max number of trained models to get |
|
| 1395 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1396 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1397 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1398 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1399 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1400 | + * } $params |
|
| 1401 | + * |
|
| 1402 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1403 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1404 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1405 | + * |
|
| 1406 | + * @return Elasticsearch|Promise |
|
| 1407 | + */ |
|
| 1408 | + public function getTrainedModelsStats(array $params = []) |
|
| 1409 | + { |
|
| 1410 | + if (isset($params['model_id'])) { |
|
| 1411 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
| 1412 | + $method = 'GET'; |
|
| 1413 | + } else { |
|
| 1414 | + $url = '/_ml/trained_models/_stats'; |
|
| 1415 | + $method = 'GET'; |
|
| 1416 | + } |
|
| 1417 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1418 | + $headers = ['Accept' => 'application/json']; |
|
| 1419 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1420 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.get_trained_models_stats'); |
|
| 1421 | + return $this->client->sendRequest($request); |
|
| 1422 | + } |
|
| 1423 | + /** |
|
| 1424 | + * Evaluate a trained model. |
|
| 1425 | + * |
|
| 1426 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html |
|
| 1427 | + * |
|
| 1428 | + * @param array{ |
|
| 1429 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 1430 | + * timeout: time, // Controls the amount of time to wait for inference results. |
|
| 1431 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1432 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1433 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1434 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1435 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1436 | + * body: array, // (REQUIRED) The docs to apply inference on and inference configuration overrides |
|
| 1437 | + * } $params |
|
| 1438 | + * |
|
| 1439 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1440 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1441 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1442 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1443 | + * |
|
| 1444 | + * @return Elasticsearch|Promise |
|
| 1445 | + */ |
|
| 1446 | + public function inferTrainedModel(array $params = []) |
|
| 1447 | + { |
|
| 1448 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1449 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
| 1450 | + $method = 'POST'; |
|
| 1451 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1452 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1453 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1454 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.infer_trained_model'); |
|
| 1455 | + return $this->client->sendRequest($request); |
|
| 1456 | + } |
|
| 1457 | + /** |
|
| 1458 | + * Returns defaults and limits used by machine learning. |
|
| 1459 | + * |
|
| 1460 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html |
|
| 1461 | + * |
|
| 1462 | + * @param array{ |
|
| 1463 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1464 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1465 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1466 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1467 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1468 | + * } $params |
|
| 1469 | + * |
|
| 1470 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1471 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1472 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1473 | + * |
|
| 1474 | + * @return Elasticsearch|Promise |
|
| 1475 | + */ |
|
| 1476 | + public function info(array $params = []) |
|
| 1477 | + { |
|
| 1478 | + $url = '/_ml/info'; |
|
| 1479 | + $method = 'GET'; |
|
| 1480 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1481 | + $headers = ['Accept' => 'application/json']; |
|
| 1482 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1483 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.info'); |
|
| 1484 | + return $this->client->sendRequest($request); |
|
| 1485 | + } |
|
| 1486 | + /** |
|
| 1487 | + * Opens one or more anomaly detection jobs. |
|
| 1488 | + * |
|
| 1489 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html |
|
| 1490 | + * |
|
| 1491 | + * @param array{ |
|
| 1492 | + * job_id: string, // (REQUIRED) The ID of the job to open |
|
| 1493 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1494 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1495 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1496 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1497 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1498 | + * body: array, // Query parameters can be specified in the body |
|
| 1499 | + * } $params |
|
| 1500 | + * |
|
| 1501 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1502 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1503 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1504 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1505 | + * |
|
| 1506 | + * @return Elasticsearch|Promise |
|
| 1507 | + */ |
|
| 1508 | + public function openJob(array $params = []) |
|
| 1509 | + { |
|
| 1510 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 1511 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
| 1512 | + $method = 'POST'; |
|
| 1513 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1514 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1515 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1516 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.open_job'); |
|
| 1517 | + return $this->client->sendRequest($request); |
|
| 1518 | + } |
|
| 1519 | + /** |
|
| 1520 | + * Posts scheduled events in a calendar. |
|
| 1521 | + * |
|
| 1522 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html |
|
| 1523 | + * |
|
| 1524 | + * @param array{ |
|
| 1525 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 1526 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1527 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1528 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1529 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1530 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1531 | + * body: array, // (REQUIRED) A list of events |
|
| 1532 | + * } $params |
|
| 1533 | + * |
|
| 1534 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1535 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1536 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1537 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1538 | + * |
|
| 1539 | + * @return Elasticsearch|Promise |
|
| 1540 | + */ |
|
| 1541 | + public function postCalendarEvents(array $params = []) |
|
| 1542 | + { |
|
| 1543 | + $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
|
| 1544 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 1545 | + $method = 'POST'; |
|
| 1546 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1547 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1548 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1549 | + $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.post_calendar_events'); |
|
| 1550 | + return $this->client->sendRequest($request); |
|
| 1551 | + } |
|
| 1552 | + /** |
|
| 1553 | + * Sends data to an anomaly detection job for analysis. |
|
| 1554 | + * |
|
| 1555 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html |
|
| 1556 | + * |
|
| 1557 | + * @param array{ |
|
| 1558 | + * job_id: string, // (REQUIRED) The name of the job receiving the data |
|
| 1559 | + * reset_start: string, // Optional parameter to specify the start of the bucket resetting range |
|
| 1560 | + * reset_end: string, // Optional parameter to specify the end of the bucket resetting range |
|
| 1561 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1562 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1563 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1564 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1565 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1566 | + * body: array, // (REQUIRED) The data to process |
|
| 1567 | + * } $params |
|
| 1568 | + * |
|
| 1569 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1570 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1571 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1572 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1573 | + * |
|
| 1574 | + * @return Elasticsearch|Promise |
|
| 1575 | + */ |
|
| 1576 | + public function postData(array $params = []) |
|
| 1577 | + { |
|
| 1578 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 1579 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
| 1580 | + $method = 'POST'; |
|
| 1581 | + $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1582 | + $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
|
| 1583 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1584 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.post_data'); |
|
| 1585 | + return $this->client->sendRequest($request); |
|
| 1586 | + } |
|
| 1587 | + /** |
|
| 1588 | + * Previews that will be analyzed given a data frame analytics config. |
|
| 1589 | + * |
|
| 1590 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html |
|
| 1591 | + * |
|
| 1592 | + * @param array{ |
|
| 1593 | + * id: string, // The ID of the data frame analytics to preview |
|
| 1594 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1595 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1596 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1597 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1598 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1599 | + * body: array, // The data frame analytics config to preview |
|
| 1600 | + * } $params |
|
| 1601 | + * |
|
| 1602 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1603 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1604 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1605 | + * |
|
| 1606 | + * @return Elasticsearch|Promise |
|
| 1607 | + */ |
|
| 1608 | + public function previewDataFrameAnalytics(array $params = []) |
|
| 1609 | + { |
|
| 1610 | + if (isset($params['id'])) { |
|
| 1611 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
| 1612 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1613 | + } else { |
|
| 1614 | + $url = '/_ml/data_frame/analytics/_preview'; |
|
| 1615 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1616 | + } |
|
| 1617 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1618 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1619 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1620 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.preview_data_frame_analytics'); |
|
| 1621 | + return $this->client->sendRequest($request); |
|
| 1622 | + } |
|
| 1623 | + /** |
|
| 1624 | + * Previews a datafeed. |
|
| 1625 | + * |
|
| 1626 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html |
|
| 1627 | + * |
|
| 1628 | + * @param array{ |
|
| 1629 | + * datafeed_id: string, // The ID of the datafeed to preview |
|
| 1630 | + * start: string, // The start time from where the datafeed preview should begin |
|
| 1631 | + * end: string, // The end time when the datafeed preview should stop |
|
| 1632 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1633 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1634 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1635 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1636 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1637 | + * body: array, // The datafeed config and job config with which to execute the preview |
|
| 1638 | + * } $params |
|
| 1639 | + * |
|
| 1640 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1641 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1642 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1643 | + * |
|
| 1644 | + * @return Elasticsearch|Promise |
|
| 1645 | + */ |
|
| 1646 | + public function previewDatafeed(array $params = []) |
|
| 1647 | + { |
|
| 1648 | + if (isset($params['datafeed_id'])) { |
|
| 1649 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
| 1650 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1651 | + } else { |
|
| 1652 | + $url = '/_ml/datafeeds/_preview'; |
|
| 1653 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1654 | + } |
|
| 1655 | + $url = $this->addQueryString($url, $params, ['start', 'end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1656 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1657 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1658 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.preview_datafeed'); |
|
| 1659 | + return $this->client->sendRequest($request); |
|
| 1660 | + } |
|
| 1661 | + /** |
|
| 1662 | + * Instantiates a calendar. |
|
| 1663 | + * |
|
| 1664 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html |
|
| 1665 | + * |
|
| 1666 | + * @param array{ |
|
| 1667 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to create |
|
| 1668 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1669 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1670 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1671 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1672 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1673 | + * body: array, // The calendar details |
|
| 1674 | + * } $params |
|
| 1675 | + * |
|
| 1676 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1677 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1678 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1679 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1680 | + * |
|
| 1681 | + * @return Elasticsearch|Promise |
|
| 1682 | + */ |
|
| 1683 | + public function putCalendar(array $params = []) |
|
| 1684 | + { |
|
| 1685 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
| 1686 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 1687 | + $method = 'PUT'; |
|
| 1688 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1689 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1690 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1691 | + $request = $this->addOtelAttributes($params, ['calendar_id'], $request, 'ml.put_calendar'); |
|
| 1692 | + return $this->client->sendRequest($request); |
|
| 1693 | + } |
|
| 1694 | + /** |
|
| 1695 | + * Adds an anomaly detection job to a calendar. |
|
| 1696 | + * |
|
| 1697 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html |
|
| 1698 | + * |
|
| 1699 | + * @param array{ |
|
| 1700 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
| 1701 | + * job_id: string, // (REQUIRED) The ID of the job to add to the calendar |
|
| 1702 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1703 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1704 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1705 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1706 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1707 | + * } $params |
|
| 1708 | + * |
|
| 1709 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1710 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1711 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1712 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1713 | + * |
|
| 1714 | + * @return Elasticsearch|Promise |
|
| 1715 | + */ |
|
| 1716 | + public function putCalendarJob(array $params = []) |
|
| 1717 | + { |
|
| 1718 | + $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
| 1719 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 1720 | + $method = 'PUT'; |
|
| 1721 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1722 | + $headers = ['Accept' => 'application/json']; |
|
| 1723 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1724 | + $request = $this->addOtelAttributes($params, ['calendar_id', 'job_id'], $request, 'ml.put_calendar_job'); |
|
| 1725 | + return $this->client->sendRequest($request); |
|
| 1726 | + } |
|
| 1727 | + /** |
|
| 1728 | + * Instantiates a data frame analytics job. |
|
| 1729 | + * |
|
| 1730 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html |
|
| 1731 | + * |
|
| 1732 | + * @param array{ |
|
| 1733 | + * id: string, // (REQUIRED) The ID of the data frame analytics to create |
|
| 1734 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1735 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1736 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1737 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1738 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1739 | + * body: array, // (REQUIRED) The data frame analytics configuration |
|
| 1740 | + * } $params |
|
| 1741 | + * |
|
| 1742 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1743 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1744 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1745 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1746 | + * |
|
| 1747 | + * @return Elasticsearch|Promise |
|
| 1748 | + */ |
|
| 1749 | + public function putDataFrameAnalytics(array $params = []) |
|
| 1750 | + { |
|
| 1751 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 1752 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 1753 | + $method = 'PUT'; |
|
| 1754 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1755 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1756 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1757 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.put_data_frame_analytics'); |
|
| 1758 | + return $this->client->sendRequest($request); |
|
| 1759 | + } |
|
| 1760 | + /** |
|
| 1761 | + * Instantiates a datafeed. |
|
| 1762 | + * |
|
| 1763 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html |
|
| 1764 | + * |
|
| 1765 | + * @param array{ |
|
| 1766 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to create |
|
| 1767 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
| 1768 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
| 1769 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
| 1770 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
| 1771 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1772 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1773 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1774 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1775 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1776 | + * body: array, // (REQUIRED) The datafeed config |
|
| 1777 | + * } $params |
|
| 1778 | + * |
|
| 1779 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1780 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1781 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1782 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1783 | + * |
|
| 1784 | + * @return Elasticsearch|Promise |
|
| 1785 | + */ |
|
| 1786 | + public function putDatafeed(array $params = []) |
|
| 1787 | + { |
|
| 1788 | + $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
| 1789 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 1790 | + $method = 'PUT'; |
|
| 1791 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1792 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1793 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1794 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.put_datafeed'); |
|
| 1795 | + return $this->client->sendRequest($request); |
|
| 1796 | + } |
|
| 1797 | + /** |
|
| 1798 | + * Instantiates a filter. |
|
| 1799 | + * |
|
| 1800 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html |
|
| 1801 | + * |
|
| 1802 | + * @param array{ |
|
| 1803 | + * filter_id: string, // (REQUIRED) The ID of the filter to create |
|
| 1804 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1805 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1806 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1807 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1808 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1809 | + * body: array, // (REQUIRED) The filter details |
|
| 1810 | + * } $params |
|
| 1811 | + * |
|
| 1812 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1813 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1814 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1815 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1816 | + * |
|
| 1817 | + * @return Elasticsearch|Promise |
|
| 1818 | + */ |
|
| 1819 | + public function putFilter(array $params = []) |
|
| 1820 | + { |
|
| 1821 | + $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
| 1822 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1823 | + $method = 'PUT'; |
|
| 1824 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1825 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1826 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1827 | + $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.put_filter'); |
|
| 1828 | + return $this->client->sendRequest($request); |
|
| 1829 | + } |
|
| 1830 | + /** |
|
| 1831 | + * Instantiates an anomaly detection job. |
|
| 1832 | + * |
|
| 1833 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html |
|
| 1834 | + * |
|
| 1835 | + * @param array{ |
|
| 1836 | + * job_id: string, // (REQUIRED) The ID of the job to create |
|
| 1837 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. |
|
| 1838 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. |
|
| 1839 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. |
|
| 1840 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. |
|
| 1841 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1842 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1843 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1844 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1845 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1846 | + * body: array, // (REQUIRED) The job |
|
| 1847 | + * } $params |
|
| 1848 | + * |
|
| 1849 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1850 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1851 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1852 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1853 | + * |
|
| 1854 | + * @return Elasticsearch|Promise |
|
| 1855 | + */ |
|
| 1856 | + public function putJob(array $params = []) |
|
| 1857 | + { |
|
| 1858 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 1859 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1860 | + $method = 'PUT'; |
|
| 1861 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1862 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1863 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1864 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.put_job'); |
|
| 1865 | + return $this->client->sendRequest($request); |
|
| 1866 | + } |
|
| 1867 | + /** |
|
| 1868 | + * Creates an inference trained model. |
|
| 1869 | + * |
|
| 1870 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html |
|
| 1871 | + * |
|
| 1872 | + * @param array{ |
|
| 1873 | + * model_id: string, // (REQUIRED) The ID of the trained models to store |
|
| 1874 | + * defer_definition_decompression: boolean, // If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. |
|
| 1875 | + * wait_for_completion: boolean, // Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false |
|
| 1876 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1877 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1878 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1879 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1880 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1881 | + * body: array, // (REQUIRED) The trained model configuration |
|
| 1882 | + * } $params |
|
| 1883 | + * |
|
| 1884 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1885 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1886 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1887 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1888 | + * |
|
| 1889 | + * @return Elasticsearch|Promise |
|
| 1890 | + */ |
|
| 1891 | + public function putTrainedModel(array $params = []) |
|
| 1892 | + { |
|
| 1893 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1894 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1895 | + $method = 'PUT'; |
|
| 1896 | + $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1897 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1898 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1899 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.put_trained_model'); |
|
| 1900 | + return $this->client->sendRequest($request); |
|
| 1901 | + } |
|
| 1902 | + /** |
|
| 1903 | + * Creates a new model alias (or reassigns an existing one) to refer to the trained model |
|
| 1904 | + * |
|
| 1905 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html |
|
| 1906 | + * |
|
| 1907 | + * @param array{ |
|
| 1908 | + * model_alias: string, // (REQUIRED) The trained model alias to update |
|
| 1909 | + * model_id: string, // (REQUIRED) The trained model where the model alias should be assigned |
|
| 1910 | + * reassign: boolean, // If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. |
|
| 1911 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1912 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1913 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1914 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1915 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1916 | + * } $params |
|
| 1917 | + * |
|
| 1918 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1919 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1920 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1921 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1922 | + * |
|
| 1923 | + * @return Elasticsearch|Promise |
|
| 1924 | + */ |
|
| 1925 | + public function putTrainedModelAlias(array $params = []) |
|
| 1926 | + { |
|
| 1927 | + $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
| 1928 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 1929 | + $method = 'PUT'; |
|
| 1930 | + $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1931 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1932 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1933 | + $request = $this->addOtelAttributes($params, ['model_alias', 'model_id'], $request, 'ml.put_trained_model_alias'); |
|
| 1934 | + return $this->client->sendRequest($request); |
|
| 1935 | + } |
|
| 1936 | + /** |
|
| 1937 | + * Creates part of a trained model definition |
|
| 1938 | + * |
|
| 1939 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html |
|
| 1940 | + * |
|
| 1941 | + * @param array{ |
|
| 1942 | + * model_id: string, // (REQUIRED) The ID of the trained model for this definition part |
|
| 1943 | + * part: int, // (REQUIRED) The part number |
|
| 1944 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1945 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1946 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1947 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1948 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1949 | + * body: array, // (REQUIRED) The trained model definition part |
|
| 1950 | + * } $params |
|
| 1951 | + * |
|
| 1952 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1953 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1954 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1955 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1956 | + * |
|
| 1957 | + * @return Elasticsearch|Promise |
|
| 1958 | + */ |
|
| 1959 | + public function putTrainedModelDefinitionPart(array $params = []) |
|
| 1960 | + { |
|
| 1961 | + $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
|
| 1962 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
| 1963 | + $method = 'PUT'; |
|
| 1964 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1965 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1966 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 1967 | + $request = $this->addOtelAttributes($params, ['model_id', 'part'], $request, 'ml.put_trained_model_definition_part'); |
|
| 1968 | + return $this->client->sendRequest($request); |
|
| 1969 | + } |
|
| 1970 | + /** |
|
| 1971 | + * Creates a trained model vocabulary |
|
| 1972 | + * |
|
| 1973 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html |
|
| 1974 | + * |
|
| 1975 | + * @param array{ |
|
| 1976 | + * model_id: string, // (REQUIRED) The ID of the trained model for this vocabulary |
|
| 1977 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1978 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1979 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1980 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1981 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1982 | + * body: array, // (REQUIRED) The trained model vocabulary |
|
| 1983 | + * } $params |
|
| 1984 | + * |
|
| 1985 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1986 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1987 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1988 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1989 | + * |
|
| 1990 | + * @return Elasticsearch|Promise |
|
| 1991 | + */ |
|
| 1992 | + public function putTrainedModelVocabulary(array $params = []) |
|
| 1993 | + { |
|
| 1994 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
| 1995 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
| 1996 | + $method = 'PUT'; |
|
| 1997 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1998 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1999 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2000 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.put_trained_model_vocabulary'); |
|
| 2001 | + return $this->client->sendRequest($request); |
|
| 2002 | + } |
|
| 2003 | + /** |
|
| 2004 | + * Resets an existing anomaly detection job. |
|
| 2005 | + * |
|
| 2006 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html |
|
| 2007 | + * |
|
| 2008 | + * @param array{ |
|
| 2009 | + * job_id: string, // (REQUIRED) The ID of the job to reset |
|
| 2010 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 2011 | + * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
| 2012 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2013 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2014 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2015 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2016 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2017 | + * } $params |
|
| 2018 | + * |
|
| 2019 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2020 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2021 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2022 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2023 | + * |
|
| 2024 | + * @return Elasticsearch|Promise |
|
| 2025 | + */ |
|
| 2026 | + public function resetJob(array $params = []) |
|
| 2027 | + { |
|
| 2028 | + $this->checkRequiredParameters(['job_id'], $params); |
|
| 2029 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
| 2030 | + $method = 'POST'; |
|
| 2031 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2032 | + $headers = ['Accept' => 'application/json']; |
|
| 2033 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2034 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.reset_job'); |
|
| 2035 | + return $this->client->sendRequest($request); |
|
| 2036 | + } |
|
| 2037 | + /** |
|
| 2038 | + * Reverts to a specific snapshot. |
|
| 2039 | + * |
|
| 2040 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html |
|
| 2041 | + * |
|
| 2042 | + * @param array{ |
|
| 2043 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 2044 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to revert to |
|
| 2045 | + * delete_intervening_results: boolean, // Should we reset the results back to the time of the snapshot? |
|
| 2046 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2047 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2048 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2049 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2050 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2051 | + * body: array, // Reversion options |
|
| 2052 | + * } $params |
|
| 2053 | + * |
|
| 2054 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2055 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2056 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2057 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2058 | + * |
|
| 2059 | + * @return Elasticsearch|Promise |
|
| 2060 | + */ |
|
| 2061 | + public function revertModelSnapshot(array $params = []) |
|
| 2062 | + { |
|
| 2063 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 2064 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
| 2065 | + $method = 'POST'; |
|
| 2066 | + $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2067 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2068 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2069 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.revert_model_snapshot'); |
|
| 2070 | + return $this->client->sendRequest($request); |
|
| 2071 | + } |
|
| 2072 | + /** |
|
| 2073 | + * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. |
|
| 2074 | + * |
|
| 2075 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html |
|
| 2076 | + * |
|
| 2077 | + * @param array{ |
|
| 2078 | + * enabled: boolean, // Whether to enable upgrade_mode ML setting or not. Defaults to false. |
|
| 2079 | + * timeout: time, // Controls the time to wait before action times out. Defaults to 30 seconds |
|
| 2080 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2081 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2082 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2083 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2084 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2085 | + * } $params |
|
| 2086 | + * |
|
| 2087 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2088 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2089 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2090 | + * |
|
| 2091 | + * @return Elasticsearch|Promise |
|
| 2092 | + */ |
|
| 2093 | + public function setUpgradeMode(array $params = []) |
|
| 2094 | + { |
|
| 2095 | + $url = '/_ml/set_upgrade_mode'; |
|
| 2096 | + $method = 'POST'; |
|
| 2097 | + $url = $this->addQueryString($url, $params, ['enabled', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2098 | + $headers = ['Accept' => 'application/json']; |
|
| 2099 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2100 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.set_upgrade_mode'); |
|
| 2101 | + return $this->client->sendRequest($request); |
|
| 2102 | + } |
|
| 2103 | + /** |
|
| 2104 | + * Starts a data frame analytics job. |
|
| 2105 | + * |
|
| 2106 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html |
|
| 2107 | + * |
|
| 2108 | + * @param array{ |
|
| 2109 | + * id: string, // (REQUIRED) The ID of the data frame analytics to start |
|
| 2110 | + * timeout: time, // Controls the time to wait until the task has started. Defaults to 20 seconds |
|
| 2111 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2112 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2113 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2114 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2115 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2116 | + * body: array, // The start data frame analytics parameters |
|
| 2117 | + * } $params |
|
| 2118 | + * |
|
| 2119 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2120 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2121 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2122 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2123 | + * |
|
| 2124 | + * @return Elasticsearch|Promise |
|
| 2125 | + */ |
|
| 2126 | + public function startDataFrameAnalytics(array $params = []) |
|
| 2127 | + { |
|
| 2128 | + $this->checkRequiredParameters(['id'], $params); |
|
| 2129 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
| 2130 | + $method = 'POST'; |
|
| 2131 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2132 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2133 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2134 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.start_data_frame_analytics'); |
|
| 2135 | + return $this->client->sendRequest($request); |
|
| 2136 | + } |
|
| 2137 | + /** |
|
| 2138 | + * Starts one or more datafeeds. |
|
| 2139 | + * |
|
| 2140 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html |
|
| 2141 | + * |
|
| 2142 | + * @param array{ |
|
| 2143 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to start |
|
| 2144 | + * start: string, // The start time from where the datafeed should begin |
|
| 2145 | + * end: string, // The end time when the datafeed should stop. When not set, the datafeed continues in real time |
|
| 2146 | + * timeout: time, // Controls the time to wait until a datafeed has started. Default to 20 seconds |
|
| 2147 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2148 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2149 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2150 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2151 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2152 | + * body: array, // The start datafeed parameters |
|
| 2153 | + * } $params |
|
| 2154 | + * |
|
| 2155 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2156 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2157 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2158 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2159 | + * |
|
| 2160 | + * @return Elasticsearch|Promise |
|
| 2161 | + */ |
|
| 2162 | + public function startDatafeed(array $params = []) |
|
| 2163 | + { |
|
| 2164 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 2165 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
| 2166 | + $method = 'POST'; |
|
| 2167 | + $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2168 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2169 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2170 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.start_datafeed'); |
|
| 2171 | + return $this->client->sendRequest($request); |
|
| 2172 | + } |
|
| 2173 | + /** |
|
| 2174 | + * Start a trained model deployment. |
|
| 2175 | + * |
|
| 2176 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html |
|
| 2177 | + * |
|
| 2178 | + * @param array{ |
|
| 2179 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2180 | + * cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb. |
|
| 2181 | + * deployment_id: string, // The Id of the new deployment. Defaults to the model_id if not set. |
|
| 2182 | + * number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes. |
|
| 2183 | + * threads_per_allocation: int, // The number of threads used by each model allocation during inference. |
|
| 2184 | + * priority: string, // The deployment priority. |
|
| 2185 | + * queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time. |
|
| 2186 | + * timeout: time, // Controls the amount of time to wait for the model to deploy. |
|
| 2187 | + * wait_for: string, // The allocation status for which to wait |
|
| 2188 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2189 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2190 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2191 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2192 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2193 | + * } $params |
|
| 2194 | + * |
|
| 2195 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2196 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2197 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2198 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2199 | + * |
|
| 2200 | + * @return Elasticsearch|Promise |
|
| 2201 | + */ |
|
| 2202 | + public function startTrainedModelDeployment(array $params = []) |
|
| 2203 | + { |
|
| 2204 | + $this->checkRequiredParameters(['model_id'], $params); |
|
| 2205 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
| 2206 | + $method = 'POST'; |
|
| 2207 | + $url = $this->addQueryString($url, $params, ['cache_size', 'deployment_id', 'number_of_allocations', 'threads_per_allocation', 'priority', 'queue_capacity', 'timeout', 'wait_for', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2208 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2209 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2210 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.start_trained_model_deployment'); |
|
| 2211 | + return $this->client->sendRequest($request); |
|
| 2212 | + } |
|
| 2213 | + /** |
|
| 2214 | + * Stops one or more data frame analytics jobs. |
|
| 2215 | + * |
|
| 2216 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html |
|
| 2217 | + * |
|
| 2218 | + * @param array{ |
|
| 2219 | + * id: string, // (REQUIRED) The ID of the data frame analytics to stop |
|
| 2220 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) |
|
| 2221 | + * force: boolean, // True if the data frame analytics should be forcefully stopped |
|
| 2222 | + * timeout: time, // Controls the time to wait until the task has stopped. Defaults to 20 seconds |
|
| 2223 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2224 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2225 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2226 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2227 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2228 | + * body: array, // The stop data frame analytics parameters |
|
| 2229 | + * } $params |
|
| 2230 | + * |
|
| 2231 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2232 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2233 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2234 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2235 | + * |
|
| 2236 | + * @return Elasticsearch|Promise |
|
| 2237 | + */ |
|
| 2238 | + public function stopDataFrameAnalytics(array $params = []) |
|
| 2239 | + { |
|
| 2240 | + $this->checkRequiredParameters(['id'], $params); |
|
| 2241 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
| 2242 | + $method = 'POST'; |
|
| 2243 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2244 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2245 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2246 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.stop_data_frame_analytics'); |
|
| 2247 | + return $this->client->sendRequest($request); |
|
| 2248 | + } |
|
| 2249 | + /** |
|
| 2250 | + * Stops one or more datafeeds. |
|
| 2251 | + * |
|
| 2252 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html |
|
| 2253 | + * |
|
| 2254 | + * @param array{ |
|
| 2255 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to stop |
|
| 2256 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 2257 | + * allow_no_datafeeds: boolean, // Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |
|
| 2258 | + * force: boolean, // True if the datafeed should be forcefully stopped. |
|
| 2259 | + * timeout: time, // Controls the time to wait until a datafeed has stopped. Default to 20 seconds |
|
| 2260 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2261 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2262 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2263 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2264 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2265 | + * body: array, // The URL params optionally sent in the body |
|
| 2266 | + * } $params |
|
| 2267 | + * |
|
| 2268 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2269 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2270 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2271 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2272 | + * |
|
| 2273 | + * @return Elasticsearch|Promise |
|
| 2274 | + */ |
|
| 2275 | + public function stopDatafeed(array $params = []) |
|
| 2276 | + { |
|
| 2277 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
| 2278 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
| 2279 | + $method = 'POST'; |
|
| 2280 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2281 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2282 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2283 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.stop_datafeed'); |
|
| 2284 | + return $this->client->sendRequest($request); |
|
| 2285 | + } |
|
| 2286 | + /** |
|
| 2287 | + * Stop a trained model deployment. |
|
| 2288 | + * |
|
| 2289 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html |
|
| 2290 | + * |
|
| 2291 | + * @param array{ |
|
| 2292 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2293 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no deployments. (This includes `_all` string or when no deployments have been specified) |
|
| 2294 | + * force: boolean, // True if the deployment should be forcefully stopped |
|
| 2295 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2296 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2297 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2298 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2299 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2300 | + * body: array, // The stop deployment parameters |
|
| 2301 | + * } $params |
|
| 2302 | + * |
|
| 2303 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2304 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2305 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2306 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2307 | + * |
|
| 2308 | + * @return Elasticsearch|Promise |
|
| 2309 | + */ |
|
| 2310 | + public function stopTrainedModelDeployment(array $params = []) |
|
| 2311 | + { |
|
| 2312 | + $this->checkRequiredParameters(['model_id'], $params); |
|
| 2313 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
| 2314 | + $method = 'POST'; |
|
| 2315 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2316 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2317 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2318 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.stop_trained_model_deployment'); |
|
| 2319 | + return $this->client->sendRequest($request); |
|
| 2320 | + } |
|
| 2321 | + /** |
|
| 2322 | + * Updates certain properties of a data frame analytics job. |
|
| 2323 | + * |
|
| 2324 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html |
|
| 2325 | + * |
|
| 2326 | + * @param array{ |
|
| 2327 | + * id: string, // (REQUIRED) The ID of the data frame analytics to update |
|
| 2328 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2329 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2330 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2331 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2332 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2333 | + * body: array, // (REQUIRED) The data frame analytics settings to update |
|
| 2334 | + * } $params |
|
| 2335 | + * |
|
| 2336 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2337 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2338 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2339 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2340 | + * |
|
| 2341 | + * @return Elasticsearch|Promise |
|
| 2342 | + */ |
|
| 2343 | + public function updateDataFrameAnalytics(array $params = []) |
|
| 2344 | + { |
|
| 2345 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 2346 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
| 2347 | + $method = 'POST'; |
|
| 2348 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2349 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2350 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2351 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ml.update_data_frame_analytics'); |
|
| 2352 | + return $this->client->sendRequest($request); |
|
| 2353 | + } |
|
| 2354 | + /** |
|
| 2355 | + * Updates certain properties of a datafeed. |
|
| 2356 | + * |
|
| 2357 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html |
|
| 2358 | + * |
|
| 2359 | + * @param array{ |
|
| 2360 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to update |
|
| 2361 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
| 2362 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
| 2363 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
| 2364 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
| 2365 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2366 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2367 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2368 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2369 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2370 | + * body: array, // (REQUIRED) The datafeed update settings |
|
| 2371 | + * } $params |
|
| 2372 | + * |
|
| 2373 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2374 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2375 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2376 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2377 | + * |
|
| 2378 | + * @return Elasticsearch|Promise |
|
| 2379 | + */ |
|
| 2380 | + public function updateDatafeed(array $params = []) |
|
| 2381 | + { |
|
| 2382 | + $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
| 2383 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
| 2384 | + $method = 'POST'; |
|
| 2385 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2386 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2387 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2388 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'ml.update_datafeed'); |
|
| 2389 | + return $this->client->sendRequest($request); |
|
| 2390 | + } |
|
| 2391 | + /** |
|
| 2392 | + * Updates the description of a filter, adds items, or removes items. |
|
| 2393 | + * |
|
| 2394 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html |
|
| 2395 | + * |
|
| 2396 | + * @param array{ |
|
| 2397 | + * filter_id: string, // (REQUIRED) The ID of the filter to update |
|
| 2398 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2399 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2400 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2401 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2402 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2403 | + * body: array, // (REQUIRED) The filter update |
|
| 2404 | + * } $params |
|
| 2405 | + * |
|
| 2406 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2407 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2408 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2409 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2410 | + * |
|
| 2411 | + * @return Elasticsearch|Promise |
|
| 2412 | + */ |
|
| 2413 | + public function updateFilter(array $params = []) |
|
| 2414 | + { |
|
| 2415 | + $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
| 2416 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
| 2417 | + $method = 'POST'; |
|
| 2418 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2419 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2420 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2421 | + $request = $this->addOtelAttributes($params, ['filter_id'], $request, 'ml.update_filter'); |
|
| 2422 | + return $this->client->sendRequest($request); |
|
| 2423 | + } |
|
| 2424 | + /** |
|
| 2425 | + * Updates certain properties of an anomaly detection job. |
|
| 2426 | + * |
|
| 2427 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html |
|
| 2428 | + * |
|
| 2429 | + * @param array{ |
|
| 2430 | + * job_id: string, // (REQUIRED) The ID of the job to create |
|
| 2431 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2432 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2433 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2434 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2435 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2436 | + * body: array, // (REQUIRED) The job update settings |
|
| 2437 | + * } $params |
|
| 2438 | + * |
|
| 2439 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2440 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2441 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2442 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2443 | + * |
|
| 2444 | + * @return Elasticsearch|Promise |
|
| 2445 | + */ |
|
| 2446 | + public function updateJob(array $params = []) |
|
| 2447 | + { |
|
| 2448 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
| 2449 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
| 2450 | + $method = 'POST'; |
|
| 2451 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2452 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2453 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2454 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'ml.update_job'); |
|
| 2455 | + return $this->client->sendRequest($request); |
|
| 2456 | + } |
|
| 2457 | + /** |
|
| 2458 | + * Updates certain properties of a snapshot. |
|
| 2459 | + * |
|
| 2460 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html |
|
| 2461 | + * |
|
| 2462 | + * @param array{ |
|
| 2463 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
| 2464 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to update |
|
| 2465 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2466 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2467 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2468 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2469 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2470 | + * body: array, // (REQUIRED) The model snapshot properties to update |
|
| 2471 | + * } $params |
|
| 2472 | + * |
|
| 2473 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2474 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2475 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2476 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2477 | + * |
|
| 2478 | + * @return Elasticsearch|Promise |
|
| 2479 | + */ |
|
| 2480 | + public function updateModelSnapshot(array $params = []) |
|
| 2481 | + { |
|
| 2482 | + $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
|
| 2483 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
| 2484 | + $method = 'POST'; |
|
| 2485 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2486 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2487 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2488 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.update_model_snapshot'); |
|
| 2489 | + return $this->client->sendRequest($request); |
|
| 2490 | + } |
|
| 2491 | + /** |
|
| 2492 | + * Updates certain properties of trained model deployment. |
|
| 2493 | + * |
|
| 2494 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html |
|
| 2495 | + * |
|
| 2496 | + * @param array{ |
|
| 2497 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
| 2498 | + * number_of_allocations: int, // Update the model deployment to this number of allocations. |
|
| 2499 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2500 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2501 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2502 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2503 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2504 | + * body: array, // The updated trained model deployment settings |
|
| 2505 | + * } $params |
|
| 2506 | + * |
|
| 2507 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2508 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2509 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2510 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2511 | + * |
|
| 2512 | + * @return Elasticsearch|Promise |
|
| 2513 | + */ |
|
| 2514 | + public function updateTrainedModelDeployment(array $params = []) |
|
| 2515 | + { |
|
| 2516 | + $this->checkRequiredParameters(['model_id'], $params); |
|
| 2517 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
| 2518 | + $method = 'POST'; |
|
| 2519 | + $url = $this->addQueryString($url, $params, ['number_of_allocations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2520 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2521 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2522 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'ml.update_trained_model_deployment'); |
|
| 2523 | + return $this->client->sendRequest($request); |
|
| 2524 | + } |
|
| 2525 | + /** |
|
| 2526 | + * Upgrades a given job snapshot to the current major version. |
|
| 2527 | + * |
|
| 2528 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html |
|
| 2529 | + * |
|
| 2530 | + * @param array{ |
|
| 2531 | + * job_id: string, // (REQUIRED) The ID of the job |
|
| 2532 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot |
|
| 2533 | + * timeout: time, // How long should the API wait for the job to be opened and the old snapshot to be loaded. |
|
| 2534 | + * wait_for_completion: boolean, // Should the request wait until the task is complete before responding to the caller. Default is false. |
|
| 2535 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2536 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2537 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2538 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2539 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2540 | + * } $params |
|
| 2541 | + * |
|
| 2542 | + * @throws MissingParameterException if a required parameter is missing |
|
| 2543 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2544 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2545 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2546 | + * |
|
| 2547 | + * @return Elasticsearch|Promise |
|
| 2548 | + */ |
|
| 2549 | + public function upgradeJobSnapshot(array $params = []) |
|
| 2550 | + { |
|
| 2551 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
| 2552 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
| 2553 | + $method = 'POST'; |
|
| 2554 | + $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2555 | + $headers = ['Accept' => 'application/json']; |
|
| 2556 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2557 | + $request = $this->addOtelAttributes($params, ['job_id', 'snapshot_id'], $request, 'ml.upgrade_job_snapshot'); |
|
| 2558 | + return $this->client->sendRequest($request); |
|
| 2559 | + } |
|
| 2560 | + /** |
|
| 2561 | + * Validates an anomaly detection job. |
|
| 2562 | + * |
|
| 2563 | + * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
| 2564 | + * |
|
| 2565 | + * @param array{ |
|
| 2566 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2567 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2568 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2569 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2570 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2571 | + * body: array, // (REQUIRED) The job config |
|
| 2572 | + * } $params |
|
| 2573 | + * |
|
| 2574 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2575 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2576 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2577 | + * |
|
| 2578 | + * @return Elasticsearch|Promise |
|
| 2579 | + */ |
|
| 2580 | + public function validate(array $params = []) |
|
| 2581 | + { |
|
| 2582 | + $this->checkRequiredParameters(['body'], $params); |
|
| 2583 | + $url = '/_ml/anomaly_detectors/_validate'; |
|
| 2584 | + $method = 'POST'; |
|
| 2585 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2586 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2587 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2588 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.validate'); |
|
| 2589 | + return $this->client->sendRequest($request); |
|
| 2590 | + } |
|
| 2591 | + /** |
|
| 2592 | + * Validates an anomaly detection detector. |
|
| 2593 | + * |
|
| 2594 | + * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
| 2595 | + * |
|
| 2596 | + * @param array{ |
|
| 2597 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 2598 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 2599 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 2600 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 2601 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 2602 | + * body: array, // (REQUIRED) The detector |
|
| 2603 | + * } $params |
|
| 2604 | + * |
|
| 2605 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 2606 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 2607 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 2608 | + * |
|
| 2609 | + * @return Elasticsearch|Promise |
|
| 2610 | + */ |
|
| 2611 | + public function validateDetector(array $params = []) |
|
| 2612 | + { |
|
| 2613 | + $this->checkRequiredParameters(['body'], $params); |
|
| 2614 | + $url = '/_ml/anomaly_detectors/_validate/detector'; |
|
| 2615 | + $method = 'POST'; |
|
| 2616 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 2617 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 2618 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 2619 | + $request = $this->addOtelAttributes($params, [], $request, 'ml.validate_detector'); |
|
| 2620 | + return $this->client->sendRequest($request); |
|
| 2621 | + } |
|
| 2622 | 2622 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function clearTrainedModelDeploymentCache(array $params = []) |
| 50 | 50 | { |
| 51 | 51 | $this->checkRequiredParameters(['model_id'], $params); |
| 52 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/cache/_clear'; |
|
| 52 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/cache/_clear'; |
|
| 53 | 53 | $method = 'POST'; |
| 54 | 54 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 55 | 55 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function closeJob(array $params = []) |
| 86 | 86 | { |
| 87 | 87 | $this->checkRequiredParameters(['job_id'], $params); |
| 88 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
| 88 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_close'; |
|
| 89 | 89 | $method = 'POST'; |
| 90 | 90 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 91 | 91 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function deleteCalendar(array $params = []) |
| 118 | 118 | { |
| 119 | 119 | $this->checkRequiredParameters(['calendar_id'], $params); |
| 120 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 120 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
| 121 | 121 | $method = 'DELETE'; |
| 122 | 122 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 123 | 123 | $headers = ['Accept' => 'application/json']; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function deleteCalendarEvent(array $params = []) |
| 151 | 151 | { |
| 152 | 152 | $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
| 153 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
| 153 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events/'.$this->encode($params['event_id']); |
|
| 154 | 154 | $method = 'DELETE'; |
| 155 | 155 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 156 | 156 | $headers = ['Accept' => 'application/json']; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function deleteCalendarJob(array $params = []) |
| 184 | 184 | { |
| 185 | 185 | $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
| 186 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 186 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/jobs/'.$this->encode($params['job_id']); |
|
| 187 | 187 | $method = 'DELETE'; |
| 188 | 188 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 189 | 189 | $headers = ['Accept' => 'application/json']; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | public function deleteDataFrameAnalytics(array $params = []) |
| 218 | 218 | { |
| 219 | 219 | $this->checkRequiredParameters(['id'], $params); |
| 220 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 220 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
| 221 | 221 | $method = 'DELETE'; |
| 222 | 222 | $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 223 | 223 | $headers = ['Accept' => 'application/json']; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | public function deleteDatafeed(array $params = []) |
| 251 | 251 | { |
| 252 | 252 | $this->checkRequiredParameters(['datafeed_id'], $params); |
| 253 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 253 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
| 254 | 254 | $method = 'DELETE'; |
| 255 | 255 | $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 256 | 256 | $headers = ['Accept' => 'application/json']; |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | public function deleteExpiredData(array $params = []) |
| 285 | 285 | { |
| 286 | 286 | if (isset($params['job_id'])) { |
| 287 | - $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
| 287 | + $url = '/_ml/_delete_expired_data/'.$this->encode($params['job_id']); |
|
| 288 | 288 | $method = 'DELETE'; |
| 289 | 289 | } else { |
| 290 | 290 | $url = '/_ml/_delete_expired_data'; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | public function deleteFilter(array $params = []) |
| 321 | 321 | { |
| 322 | 322 | $this->checkRequiredParameters(['filter_id'], $params); |
| 323 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 323 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
| 324 | 324 | $method = 'DELETE'; |
| 325 | 325 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 326 | 326 | $headers = ['Accept' => 'application/json']; |
@@ -356,10 +356,10 @@ discard block |
||
| 356 | 356 | { |
| 357 | 357 | $this->checkRequiredParameters(['job_id'], $params); |
| 358 | 358 | if (isset($params['forecast_id'])) { |
| 359 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
| 359 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast/'.$this->encode($params['forecast_id']); |
|
| 360 | 360 | $method = 'DELETE'; |
| 361 | 361 | } else { |
| 362 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 362 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast'; |
|
| 363 | 363 | $method = 'DELETE'; |
| 364 | 364 | } |
| 365 | 365 | $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | public function deleteJob(array $params = []) |
| 396 | 396 | { |
| 397 | 397 | $this->checkRequiredParameters(['job_id'], $params); |
| 398 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 398 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
| 399 | 399 | $method = 'DELETE'; |
| 400 | 400 | $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 401 | 401 | $headers = ['Accept' => 'application/json']; |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | public function deleteModelSnapshot(array $params = []) |
| 429 | 429 | { |
| 430 | 430 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
| 431 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 431 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']); |
|
| 432 | 432 | $method = 'DELETE'; |
| 433 | 433 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 434 | 434 | $headers = ['Accept' => 'application/json']; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | public function deleteTrainedModel(array $params = []) |
| 463 | 463 | { |
| 464 | 464 | $this->checkRequiredParameters(['model_id'], $params); |
| 465 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 465 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
| 466 | 466 | $method = 'DELETE'; |
| 467 | 467 | $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 468 | 468 | $headers = ['Accept' => 'application/json']; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | public function deleteTrainedModelAlias(array $params = []) |
| 496 | 496 | { |
| 497 | 497 | $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
| 498 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 498 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/model_aliases/'.$this->encode($params['model_alias']); |
|
| 499 | 499 | $method = 'DELETE'; |
| 500 | 500 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 501 | 501 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | public function explainDataFrameAnalytics(array $params = []) |
| 590 | 590 | { |
| 591 | 591 | if (isset($params['id'])) { |
| 592 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
| 592 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_explain'; |
|
| 593 | 593 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 594 | 594 | } else { |
| 595 | 595 | $url = '/_ml/data_frame/analytics/_explain'; |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | public function flushJob(array $params = []) |
| 632 | 632 | { |
| 633 | 633 | $this->checkRequiredParameters(['job_id'], $params); |
| 634 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
| 634 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_flush'; |
|
| 635 | 635 | $method = 'POST'; |
| 636 | 636 | $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 637 | 637 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | public function forecast(array $params = []) |
| 668 | 668 | { |
| 669 | 669 | $this->checkRequiredParameters(['job_id'], $params); |
| 670 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
| 670 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast'; |
|
| 671 | 671 | $method = 'POST'; |
| 672 | 672 | $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 673 | 673 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -711,10 +711,10 @@ discard block |
||
| 711 | 711 | { |
| 712 | 712 | $this->checkRequiredParameters(['job_id'], $params); |
| 713 | 713 | if (isset($params['timestamp'])) { |
| 714 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
| 714 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/buckets/'.$this->encode($params['timestamp']); |
|
| 715 | 715 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 716 | 716 | } else { |
| 717 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
| 717 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/buckets'; |
|
| 718 | 718 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 719 | 719 | } |
| 720 | 720 | $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | public function getCalendarEvents(array $params = []) |
| 753 | 753 | { |
| 754 | 754 | $this->checkRequiredParameters(['calendar_id'], $params); |
| 755 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 755 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events'; |
|
| 756 | 756 | $method = 'GET'; |
| 757 | 757 | $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 758 | 758 | $headers = ['Accept' => 'application/json']; |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | public function getCalendars(array $params = []) |
| 787 | 787 | { |
| 788 | 788 | if (isset($params['calendar_id'])) { |
| 789 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 789 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
| 790 | 790 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 791 | 791 | } else { |
| 792 | 792 | $url = '/_ml/calendars'; |
@@ -828,10 +828,10 @@ discard block |
||
| 828 | 828 | { |
| 829 | 829 | $this->checkRequiredParameters(['job_id'], $params); |
| 830 | 830 | if (isset($params['category_id'])) { |
| 831 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
| 831 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/categories/'.$this->encode($params['category_id']); |
|
| 832 | 832 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 833 | 833 | } else { |
| 834 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories'; |
|
| 834 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/categories'; |
|
| 835 | 835 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 836 | 836 | } |
| 837 | 837 | $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | public function getDataFrameAnalytics(array $params = []) |
| 868 | 868 | { |
| 869 | 869 | if (isset($params['id'])) { |
| 870 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 870 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
| 871 | 871 | $method = 'GET'; |
| 872 | 872 | } else { |
| 873 | 873 | $url = '/_ml/data_frame/analytics'; |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | public function getDataFrameAnalyticsStats(array $params = []) |
| 907 | 907 | { |
| 908 | 908 | if (isset($params['id'])) { |
| 909 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
| 909 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_stats'; |
|
| 910 | 910 | $method = 'GET'; |
| 911 | 911 | } else { |
| 912 | 912 | $url = '/_ml/data_frame/analytics/_stats'; |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | public function getDatafeedStats(array $params = []) |
| 943 | 943 | { |
| 944 | 944 | if (isset($params['datafeed_id'])) { |
| 945 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
| 945 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_stats'; |
|
| 946 | 946 | $method = 'GET'; |
| 947 | 947 | } else { |
| 948 | 948 | $url = '/_ml/datafeeds/_stats'; |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | public function getDatafeeds(array $params = []) |
| 980 | 980 | { |
| 981 | 981 | if (isset($params['datafeed_id'])) { |
| 982 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 982 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
| 983 | 983 | $method = 'GET'; |
| 984 | 984 | } else { |
| 985 | 985 | $url = '/_ml/datafeeds'; |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | public function getFilters(array $params = []) |
| 1017 | 1017 | { |
| 1018 | 1018 | if (isset($params['filter_id'])) { |
| 1019 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1019 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
| 1020 | 1020 | $method = 'GET'; |
| 1021 | 1021 | } else { |
| 1022 | 1022 | $url = '/_ml/filters'; |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | public function getInfluencers(array $params = []) |
| 1062 | 1062 | { |
| 1063 | 1063 | $this->checkRequiredParameters(['job_id'], $params); |
| 1064 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
| 1064 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/influencers'; |
|
| 1065 | 1065 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1066 | 1066 | $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1067 | 1067 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | public function getJobStats(array $params = []) |
| 1094 | 1094 | { |
| 1095 | 1095 | if (isset($params['job_id'])) { |
| 1096 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
| 1096 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_stats'; |
|
| 1097 | 1097 | $method = 'GET'; |
| 1098 | 1098 | } else { |
| 1099 | 1099 | $url = '/_ml/anomaly_detectors/_stats'; |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | public function getJobs(array $params = []) |
| 1131 | 1131 | { |
| 1132 | 1132 | if (isset($params['job_id'])) { |
| 1133 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1133 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
| 1134 | 1134 | $method = 'GET'; |
| 1135 | 1135 | } else { |
| 1136 | 1136 | $url = '/_ml/anomaly_detectors'; |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | public function getMemoryStats(array $params = []) |
| 1168 | 1168 | { |
| 1169 | 1169 | if (isset($params['node_id'])) { |
| 1170 | - $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
| 1170 | + $url = '/_ml/memory/'.$this->encode($params['node_id']).'/_stats'; |
|
| 1171 | 1171 | $method = 'GET'; |
| 1172 | 1172 | } else { |
| 1173 | 1173 | $url = '/_ml/memory/_stats'; |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | public function getModelSnapshotUpgradeStats(array $params = []) |
| 1206 | 1206 | { |
| 1207 | 1207 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
| 1208 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
| 1208 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_upgrade/_stats'; |
|
| 1209 | 1209 | $method = 'GET'; |
| 1210 | 1210 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1211 | 1211 | $headers = ['Accept' => 'application/json']; |
@@ -1246,10 +1246,10 @@ discard block |
||
| 1246 | 1246 | { |
| 1247 | 1247 | $this->checkRequiredParameters(['job_id'], $params); |
| 1248 | 1248 | if (isset($params['snapshot_id'])) { |
| 1249 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
| 1249 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']); |
|
| 1250 | 1250 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1251 | 1251 | } else { |
| 1252 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
| 1252 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots'; |
|
| 1253 | 1253 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1254 | 1254 | } |
| 1255 | 1255 | $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | public function getOverallBuckets(array $params = []) |
| 1291 | 1291 | { |
| 1292 | 1292 | $this->checkRequiredParameters(['job_id'], $params); |
| 1293 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
| 1293 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/overall_buckets'; |
|
| 1294 | 1294 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1295 | 1295 | $url = $this->addQueryString($url, $params, ['top_n', 'bucket_span', 'overall_score', 'exclude_interim', 'start', 'end', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1296 | 1296 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | public function getRecords(array $params = []) |
| 1332 | 1332 | { |
| 1333 | 1333 | $this->checkRequiredParameters(['job_id'], $params); |
| 1334 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
| 1334 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/records'; |
|
| 1335 | 1335 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1336 | 1336 | $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1337 | 1337 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | public function getTrainedModels(array $params = []) |
| 1371 | 1371 | { |
| 1372 | 1372 | if (isset($params['model_id'])) { |
| 1373 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1373 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
| 1374 | 1374 | $method = 'GET'; |
| 1375 | 1375 | } else { |
| 1376 | 1376 | $url = '/_ml/trained_models'; |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | public function getTrainedModelsStats(array $params = []) |
| 1409 | 1409 | { |
| 1410 | 1410 | if (isset($params['model_id'])) { |
| 1411 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
| 1411 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/_stats'; |
|
| 1412 | 1412 | $method = 'GET'; |
| 1413 | 1413 | } else { |
| 1414 | 1414 | $url = '/_ml/trained_models/_stats'; |
@@ -1446,7 +1446,7 @@ discard block |
||
| 1446 | 1446 | public function inferTrainedModel(array $params = []) |
| 1447 | 1447 | { |
| 1448 | 1448 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
| 1449 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
| 1449 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/_infer'; |
|
| 1450 | 1450 | $method = 'POST'; |
| 1451 | 1451 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1452 | 1452 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1508,7 +1508,7 @@ discard block |
||
| 1508 | 1508 | public function openJob(array $params = []) |
| 1509 | 1509 | { |
| 1510 | 1510 | $this->checkRequiredParameters(['job_id'], $params); |
| 1511 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
| 1511 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_open'; |
|
| 1512 | 1512 | $method = 'POST'; |
| 1513 | 1513 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1514 | 1514 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1541,7 +1541,7 @@ discard block |
||
| 1541 | 1541 | public function postCalendarEvents(array $params = []) |
| 1542 | 1542 | { |
| 1543 | 1543 | $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
| 1544 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
| 1544 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events'; |
|
| 1545 | 1545 | $method = 'POST'; |
| 1546 | 1546 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1547 | 1547 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1576,7 +1576,7 @@ discard block |
||
| 1576 | 1576 | public function postData(array $params = []) |
| 1577 | 1577 | { |
| 1578 | 1578 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
| 1579 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
| 1579 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_data'; |
|
| 1580 | 1580 | $method = 'POST'; |
| 1581 | 1581 | $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1582 | 1582 | $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | public function previewDataFrameAnalytics(array $params = []) |
| 1609 | 1609 | { |
| 1610 | 1610 | if (isset($params['id'])) { |
| 1611 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
| 1611 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_preview'; |
|
| 1612 | 1612 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1613 | 1613 | } else { |
| 1614 | 1614 | $url = '/_ml/data_frame/analytics/_preview'; |
@@ -1646,7 +1646,7 @@ discard block |
||
| 1646 | 1646 | public function previewDatafeed(array $params = []) |
| 1647 | 1647 | { |
| 1648 | 1648 | if (isset($params['datafeed_id'])) { |
| 1649 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
| 1649 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_preview'; |
|
| 1650 | 1650 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1651 | 1651 | } else { |
| 1652 | 1652 | $url = '/_ml/datafeeds/_preview'; |
@@ -1683,7 +1683,7 @@ discard block |
||
| 1683 | 1683 | public function putCalendar(array $params = []) |
| 1684 | 1684 | { |
| 1685 | 1685 | $this->checkRequiredParameters(['calendar_id'], $params); |
| 1686 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
| 1686 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
| 1687 | 1687 | $method = 'PUT'; |
| 1688 | 1688 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1689 | 1689 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1716,7 +1716,7 @@ discard block |
||
| 1716 | 1716 | public function putCalendarJob(array $params = []) |
| 1717 | 1717 | { |
| 1718 | 1718 | $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
| 1719 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
| 1719 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/jobs/'.$this->encode($params['job_id']); |
|
| 1720 | 1720 | $method = 'PUT'; |
| 1721 | 1721 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1722 | 1722 | $headers = ['Accept' => 'application/json']; |
@@ -1749,7 +1749,7 @@ discard block |
||
| 1749 | 1749 | public function putDataFrameAnalytics(array $params = []) |
| 1750 | 1750 | { |
| 1751 | 1751 | $this->checkRequiredParameters(['id', 'body'], $params); |
| 1752 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
| 1752 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
| 1753 | 1753 | $method = 'PUT'; |
| 1754 | 1754 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1755 | 1755 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1786,7 +1786,7 @@ discard block |
||
| 1786 | 1786 | public function putDatafeed(array $params = []) |
| 1787 | 1787 | { |
| 1788 | 1788 | $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
| 1789 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
| 1789 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
| 1790 | 1790 | $method = 'PUT'; |
| 1791 | 1791 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1792 | 1792 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1819,7 +1819,7 @@ discard block |
||
| 1819 | 1819 | public function putFilter(array $params = []) |
| 1820 | 1820 | { |
| 1821 | 1821 | $this->checkRequiredParameters(['filter_id', 'body'], $params); |
| 1822 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
| 1822 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
| 1823 | 1823 | $method = 'PUT'; |
| 1824 | 1824 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1825 | 1825 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | public function putJob(array $params = []) |
| 1857 | 1857 | { |
| 1858 | 1858 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
| 1859 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
| 1859 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
| 1860 | 1860 | $method = 'PUT'; |
| 1861 | 1861 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1862 | 1862 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1891,7 +1891,7 @@ discard block |
||
| 1891 | 1891 | public function putTrainedModel(array $params = []) |
| 1892 | 1892 | { |
| 1893 | 1893 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
| 1894 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
| 1894 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
| 1895 | 1895 | $method = 'PUT'; |
| 1896 | 1896 | $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1897 | 1897 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1925,7 +1925,7 @@ discard block |
||
| 1925 | 1925 | public function putTrainedModelAlias(array $params = []) |
| 1926 | 1926 | { |
| 1927 | 1927 | $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
| 1928 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
| 1928 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/model_aliases/'.$this->encode($params['model_alias']); |
|
| 1929 | 1929 | $method = 'PUT'; |
| 1930 | 1930 | $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1931 | 1931 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1959,7 +1959,7 @@ discard block |
||
| 1959 | 1959 | public function putTrainedModelDefinitionPart(array $params = []) |
| 1960 | 1960 | { |
| 1961 | 1961 | $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
| 1962 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
| 1962 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/definition/'.$this->encode($params['part']); |
|
| 1963 | 1963 | $method = 'PUT'; |
| 1964 | 1964 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1965 | 1965 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1992,7 +1992,7 @@ discard block |
||
| 1992 | 1992 | public function putTrainedModelVocabulary(array $params = []) |
| 1993 | 1993 | { |
| 1994 | 1994 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
| 1995 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
| 1995 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/vocabulary'; |
|
| 1996 | 1996 | $method = 'PUT'; |
| 1997 | 1997 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1998 | 1998 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | public function resetJob(array $params = []) |
| 2027 | 2027 | { |
| 2028 | 2028 | $this->checkRequiredParameters(['job_id'], $params); |
| 2029 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
| 2029 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_reset'; |
|
| 2030 | 2030 | $method = 'POST'; |
| 2031 | 2031 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2032 | 2032 | $headers = ['Accept' => 'application/json']; |
@@ -2061,7 +2061,7 @@ discard block |
||
| 2061 | 2061 | public function revertModelSnapshot(array $params = []) |
| 2062 | 2062 | { |
| 2063 | 2063 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
| 2064 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
| 2064 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_revert'; |
|
| 2065 | 2065 | $method = 'POST'; |
| 2066 | 2066 | $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2067 | 2067 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2126,7 +2126,7 @@ discard block |
||
| 2126 | 2126 | public function startDataFrameAnalytics(array $params = []) |
| 2127 | 2127 | { |
| 2128 | 2128 | $this->checkRequiredParameters(['id'], $params); |
| 2129 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
| 2129 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_start'; |
|
| 2130 | 2130 | $method = 'POST'; |
| 2131 | 2131 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2132 | 2132 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2162,7 +2162,7 @@ discard block |
||
| 2162 | 2162 | public function startDatafeed(array $params = []) |
| 2163 | 2163 | { |
| 2164 | 2164 | $this->checkRequiredParameters(['datafeed_id'], $params); |
| 2165 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
| 2165 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_start'; |
|
| 2166 | 2166 | $method = 'POST'; |
| 2167 | 2167 | $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2168 | 2168 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | public function startTrainedModelDeployment(array $params = []) |
| 2203 | 2203 | { |
| 2204 | 2204 | $this->checkRequiredParameters(['model_id'], $params); |
| 2205 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
| 2205 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_start'; |
|
| 2206 | 2206 | $method = 'POST'; |
| 2207 | 2207 | $url = $this->addQueryString($url, $params, ['cache_size', 'deployment_id', 'number_of_allocations', 'threads_per_allocation', 'priority', 'queue_capacity', 'timeout', 'wait_for', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2208 | 2208 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2238,7 +2238,7 @@ discard block |
||
| 2238 | 2238 | public function stopDataFrameAnalytics(array $params = []) |
| 2239 | 2239 | { |
| 2240 | 2240 | $this->checkRequiredParameters(['id'], $params); |
| 2241 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
| 2241 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_stop'; |
|
| 2242 | 2242 | $method = 'POST'; |
| 2243 | 2243 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2244 | 2244 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2275,7 +2275,7 @@ discard block |
||
| 2275 | 2275 | public function stopDatafeed(array $params = []) |
| 2276 | 2276 | { |
| 2277 | 2277 | $this->checkRequiredParameters(['datafeed_id'], $params); |
| 2278 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
| 2278 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_stop'; |
|
| 2279 | 2279 | $method = 'POST'; |
| 2280 | 2280 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2281 | 2281 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2310,7 +2310,7 @@ discard block |
||
| 2310 | 2310 | public function stopTrainedModelDeployment(array $params = []) |
| 2311 | 2311 | { |
| 2312 | 2312 | $this->checkRequiredParameters(['model_id'], $params); |
| 2313 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
| 2313 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_stop'; |
|
| 2314 | 2314 | $method = 'POST'; |
| 2315 | 2315 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2316 | 2316 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2343,7 +2343,7 @@ discard block |
||
| 2343 | 2343 | public function updateDataFrameAnalytics(array $params = []) |
| 2344 | 2344 | { |
| 2345 | 2345 | $this->checkRequiredParameters(['id', 'body'], $params); |
| 2346 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
| 2346 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_update'; |
|
| 2347 | 2347 | $method = 'POST'; |
| 2348 | 2348 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2349 | 2349 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2380,7 +2380,7 @@ discard block |
||
| 2380 | 2380 | public function updateDatafeed(array $params = []) |
| 2381 | 2381 | { |
| 2382 | 2382 | $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
| 2383 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
| 2383 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_update'; |
|
| 2384 | 2384 | $method = 'POST'; |
| 2385 | 2385 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2386 | 2386 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2413,7 +2413,7 @@ discard block |
||
| 2413 | 2413 | public function updateFilter(array $params = []) |
| 2414 | 2414 | { |
| 2415 | 2415 | $this->checkRequiredParameters(['filter_id', 'body'], $params); |
| 2416 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
| 2416 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']).'/_update'; |
|
| 2417 | 2417 | $method = 'POST'; |
| 2418 | 2418 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2419 | 2419 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2446,7 +2446,7 @@ discard block |
||
| 2446 | 2446 | public function updateJob(array $params = []) |
| 2447 | 2447 | { |
| 2448 | 2448 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
| 2449 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
| 2449 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_update'; |
|
| 2450 | 2450 | $method = 'POST'; |
| 2451 | 2451 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2452 | 2452 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2480,7 +2480,7 @@ discard block |
||
| 2480 | 2480 | public function updateModelSnapshot(array $params = []) |
| 2481 | 2481 | { |
| 2482 | 2482 | $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
| 2483 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
| 2483 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_update'; |
|
| 2484 | 2484 | $method = 'POST'; |
| 2485 | 2485 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2486 | 2486 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2514,7 +2514,7 @@ discard block |
||
| 2514 | 2514 | public function updateTrainedModelDeployment(array $params = []) |
| 2515 | 2515 | { |
| 2516 | 2516 | $this->checkRequiredParameters(['model_id'], $params); |
| 2517 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
| 2517 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_update'; |
|
| 2518 | 2518 | $method = 'POST'; |
| 2519 | 2519 | $url = $this->addQueryString($url, $params, ['number_of_allocations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2520 | 2520 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2549,7 +2549,7 @@ discard block |
||
| 2549 | 2549 | public function upgradeJobSnapshot(array $params = []) |
| 2550 | 2550 | { |
| 2551 | 2551 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
| 2552 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
| 2552 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_upgrade'; |
|
| 2553 | 2553 | $method = 'POST'; |
| 2554 | 2554 | $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 2555 | 2555 | $headers = ['Accept' => 'application/json']; |
@@ -25,168 +25,168 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class TextStructure extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Finds the structure of a text field in an index. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * index: string, // The index containing the analyzed field |
|
| 35 | - * field: string, // The field that should be analyzed |
|
| 36 | - * documents_to_sample: int, // How many documents should be included in the analysis |
|
| 37 | - * timeout: time, // Timeout after which the analysis will be aborted |
|
| 38 | - * format: enum, // Optional parameter to specify the high level file format |
|
| 39 | - * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 40 | - * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 41 | - * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 42 | - * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 43 | - * 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 |
|
| 44 | - * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 45 | - * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 46 | - * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 47 | - * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 48 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 49 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 50 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 51 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 52 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 53 | - * } $params |
|
| 54 | - * |
|
| 55 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 56 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 57 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 58 | - * |
|
| 59 | - * @return Elasticsearch|Promise |
|
| 60 | - */ |
|
| 61 | - public function findFieldStructure(array $params = []) |
|
| 62 | - { |
|
| 63 | - $this->checkRequiredParameters(['index', 'field'], $params); |
|
| 64 | - $url = '/_text_structure/find_field_structure'; |
|
| 65 | - $method = 'GET'; |
|
| 66 | - $url = $this->addQueryString($url, $params, ['index', 'field', 'documents_to_sample', 'timeout', 'format', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 67 | - $headers = ['Accept' => 'application/json']; |
|
| 68 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 69 | - $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_field_structure'); |
|
| 70 | - return $this->client->sendRequest($request); |
|
| 71 | - } |
|
| 72 | - /** |
|
| 73 | - * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. |
|
| 74 | - * |
|
| 75 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html |
|
| 76 | - * |
|
| 77 | - * @param array{ |
|
| 78 | - * timeout: time, // Timeout after which the analysis will be aborted |
|
| 79 | - * format: enum, // Optional parameter to specify the high level file format |
|
| 80 | - * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 81 | - * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 82 | - * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 83 | - * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 84 | - * 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 |
|
| 85 | - * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 86 | - * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 87 | - * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 88 | - * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 89 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 90 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 91 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 92 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 93 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 94 | - * body: array, // (REQUIRED) JSON object with one field [messages], containing an array of messages to be analyzed |
|
| 95 | - * } $params |
|
| 96 | - * |
|
| 97 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 98 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 99 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 100 | - * |
|
| 101 | - * @return Elasticsearch|Promise |
|
| 102 | - */ |
|
| 103 | - public function findMessageStructure(array $params = []) |
|
| 104 | - { |
|
| 105 | - $this->checkRequiredParameters(['body'], $params); |
|
| 106 | - $url = '/_text_structure/find_message_structure'; |
|
| 107 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 108 | - $url = $this->addQueryString($url, $params, ['timeout', 'format', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 109 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 110 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 111 | - $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_message_structure'); |
|
| 112 | - return $this->client->sendRequest($request); |
|
| 113 | - } |
|
| 114 | - /** |
|
| 115 | - * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. |
|
| 116 | - * |
|
| 117 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html |
|
| 118 | - * |
|
| 119 | - * @param array{ |
|
| 120 | - * lines_to_sample: int, // How many lines of the file should be included in the analysis |
|
| 121 | - * line_merge_size_limit: int, // Maximum number of characters permitted in a single message when lines are merged to create messages. |
|
| 122 | - * timeout: time, // Timeout after which the analysis will be aborted |
|
| 123 | - * charset: string, // Optional parameter to specify the character set of the file |
|
| 124 | - * format: enum, // Optional parameter to specify the high level file format |
|
| 125 | - * has_header_row: boolean, // Optional parameter to specify whether a delimited file includes the column names in its first row |
|
| 126 | - * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 127 | - * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 128 | - * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 129 | - * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 130 | - * 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 |
|
| 131 | - * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 132 | - * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 133 | - * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 134 | - * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 135 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 136 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 137 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 138 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 139 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 140 | - * body: array, // (REQUIRED) The contents of the file to be analyzed |
|
| 141 | - * } $params |
|
| 142 | - * |
|
| 143 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 144 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 145 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 146 | - * |
|
| 147 | - * @return Elasticsearch|Promise |
|
| 148 | - */ |
|
| 149 | - public function findStructure(array $params = []) |
|
| 150 | - { |
|
| 151 | - $this->checkRequiredParameters(['body'], $params); |
|
| 152 | - $url = '/_text_structure/find_structure'; |
|
| 153 | - $method = 'POST'; |
|
| 154 | - $url = $this->addQueryString($url, $params, ['lines_to_sample', 'line_merge_size_limit', 'timeout', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 155 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
| 156 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 157 | - $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_structure'); |
|
| 158 | - return $this->client->sendRequest($request); |
|
| 159 | - } |
|
| 160 | - /** |
|
| 161 | - * Tests a Grok pattern on some text. |
|
| 162 | - * |
|
| 163 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html |
|
| 164 | - * |
|
| 165 | - * @param array{ |
|
| 166 | - * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 167 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 168 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 169 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 170 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 171 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 172 | - * body: array, // (REQUIRED) The Grok pattern and text. |
|
| 173 | - * } $params |
|
| 174 | - * |
|
| 175 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 176 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 177 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 178 | - * |
|
| 179 | - * @return Elasticsearch|Promise |
|
| 180 | - */ |
|
| 181 | - public function testGrokPattern(array $params = []) |
|
| 182 | - { |
|
| 183 | - $this->checkRequiredParameters(['body'], $params); |
|
| 184 | - $url = '/_text_structure/test_grok_pattern'; |
|
| 185 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 186 | - $url = $this->addQueryString($url, $params, ['ecs_compatibility', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 187 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 188 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 189 | - $request = $this->addOtelAttributes($params, [], $request, 'text_structure.test_grok_pattern'); |
|
| 190 | - return $this->client->sendRequest($request); |
|
| 191 | - } |
|
| 28 | + /** |
|
| 29 | + * Finds the structure of a text field in an index. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * index: string, // The index containing the analyzed field |
|
| 35 | + * field: string, // The field that should be analyzed |
|
| 36 | + * documents_to_sample: int, // How many documents should be included in the analysis |
|
| 37 | + * timeout: time, // Timeout after which the analysis will be aborted |
|
| 38 | + * format: enum, // Optional parameter to specify the high level file format |
|
| 39 | + * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 40 | + * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 41 | + * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 42 | + * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 43 | + * 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 |
|
| 44 | + * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 45 | + * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 46 | + * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 47 | + * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 48 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 49 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 50 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 51 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 52 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 53 | + * } $params |
|
| 54 | + * |
|
| 55 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 56 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 57 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 58 | + * |
|
| 59 | + * @return Elasticsearch|Promise |
|
| 60 | + */ |
|
| 61 | + public function findFieldStructure(array $params = []) |
|
| 62 | + { |
|
| 63 | + $this->checkRequiredParameters(['index', 'field'], $params); |
|
| 64 | + $url = '/_text_structure/find_field_structure'; |
|
| 65 | + $method = 'GET'; |
|
| 66 | + $url = $this->addQueryString($url, $params, ['index', 'field', 'documents_to_sample', 'timeout', 'format', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 67 | + $headers = ['Accept' => 'application/json']; |
|
| 68 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 69 | + $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_field_structure'); |
|
| 70 | + return $this->client->sendRequest($request); |
|
| 71 | + } |
|
| 72 | + /** |
|
| 73 | + * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. |
|
| 74 | + * |
|
| 75 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html |
|
| 76 | + * |
|
| 77 | + * @param array{ |
|
| 78 | + * timeout: time, // Timeout after which the analysis will be aborted |
|
| 79 | + * format: enum, // Optional parameter to specify the high level file format |
|
| 80 | + * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 81 | + * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 82 | + * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 83 | + * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 84 | + * 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 |
|
| 85 | + * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 86 | + * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 87 | + * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 88 | + * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 89 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 90 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 91 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 92 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 93 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 94 | + * body: array, // (REQUIRED) JSON object with one field [messages], containing an array of messages to be analyzed |
|
| 95 | + * } $params |
|
| 96 | + * |
|
| 97 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 98 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 99 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 100 | + * |
|
| 101 | + * @return Elasticsearch|Promise |
|
| 102 | + */ |
|
| 103 | + public function findMessageStructure(array $params = []) |
|
| 104 | + { |
|
| 105 | + $this->checkRequiredParameters(['body'], $params); |
|
| 106 | + $url = '/_text_structure/find_message_structure'; |
|
| 107 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 108 | + $url = $this->addQueryString($url, $params, ['timeout', 'format', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 109 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 110 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 111 | + $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_message_structure'); |
|
| 112 | + return $this->client->sendRequest($request); |
|
| 113 | + } |
|
| 114 | + /** |
|
| 115 | + * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. |
|
| 116 | + * |
|
| 117 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html |
|
| 118 | + * |
|
| 119 | + * @param array{ |
|
| 120 | + * lines_to_sample: int, // How many lines of the file should be included in the analysis |
|
| 121 | + * line_merge_size_limit: int, // Maximum number of characters permitted in a single message when lines are merged to create messages. |
|
| 122 | + * timeout: time, // Timeout after which the analysis will be aborted |
|
| 123 | + * charset: string, // Optional parameter to specify the character set of the file |
|
| 124 | + * format: enum, // Optional parameter to specify the high level file format |
|
| 125 | + * has_header_row: boolean, // Optional parameter to specify whether a delimited file includes the column names in its first row |
|
| 126 | + * column_names: list, // Optional parameter containing a comma separated list of the column names for a delimited file |
|
| 127 | + * delimiter: string, // Optional parameter to specify the delimiter character for a delimited file - must be a single character |
|
| 128 | + * quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character |
|
| 129 | + * should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them |
|
| 130 | + * 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 |
|
| 131 | + * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 132 | + * timestamp_field: string, // Optional parameter to specify the timestamp field in the file |
|
| 133 | + * timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format |
|
| 134 | + * explain: boolean, // Whether to include a commentary on how the structure was derived |
|
| 135 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 136 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 137 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 138 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 139 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 140 | + * body: array, // (REQUIRED) The contents of the file to be analyzed |
|
| 141 | + * } $params |
|
| 142 | + * |
|
| 143 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 144 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 145 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 146 | + * |
|
| 147 | + * @return Elasticsearch|Promise |
|
| 148 | + */ |
|
| 149 | + public function findStructure(array $params = []) |
|
| 150 | + { |
|
| 151 | + $this->checkRequiredParameters(['body'], $params); |
|
| 152 | + $url = '/_text_structure/find_structure'; |
|
| 153 | + $method = 'POST'; |
|
| 154 | + $url = $this->addQueryString($url, $params, ['lines_to_sample', 'line_merge_size_limit', 'timeout', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'ecs_compatibility', 'timestamp_field', 'timestamp_format', 'explain', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 155 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
| 156 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 157 | + $request = $this->addOtelAttributes($params, [], $request, 'text_structure.find_structure'); |
|
| 158 | + return $this->client->sendRequest($request); |
|
| 159 | + } |
|
| 160 | + /** |
|
| 161 | + * Tests a Grok pattern on some text. |
|
| 162 | + * |
|
| 163 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html |
|
| 164 | + * |
|
| 165 | + * @param array{ |
|
| 166 | + * ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' |
|
| 167 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 168 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 169 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 170 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 171 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 172 | + * body: array, // (REQUIRED) The Grok pattern and text. |
|
| 173 | + * } $params |
|
| 174 | + * |
|
| 175 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 176 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 177 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 178 | + * |
|
| 179 | + * @return Elasticsearch|Promise |
|
| 180 | + */ |
|
| 181 | + public function testGrokPattern(array $params = []) |
|
| 182 | + { |
|
| 183 | + $this->checkRequiredParameters(['body'], $params); |
|
| 184 | + $url = '/_text_structure/test_grok_pattern'; |
|
| 185 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 186 | + $url = $this->addQueryString($url, $params, ['ecs_compatibility', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 187 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 188 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 189 | + $request = $this->addOtelAttributes($params, [], $request, 'text_structure.test_grok_pattern'); |
|
| 190 | + return $this->client->sendRequest($request); |
|
| 191 | + } |
|
| 192 | 192 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class TextStructure extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class TextStructure extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Finds the structure of a text field in an index. |
| 30 | 29 | * |
@@ -25,280 +25,280 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Rollup extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Deletes an existing rollup job. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html |
|
| 32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | - * |
|
| 34 | - * @param array{ |
|
| 35 | - * id: string, // (REQUIRED) The ID of the job to delete |
|
| 36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | - * } $params |
|
| 42 | - * |
|
| 43 | - * @throws MissingParameterException if a required parameter is missing |
|
| 44 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 45 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 46 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 47 | - * |
|
| 48 | - * @return Elasticsearch|Promise |
|
| 49 | - */ |
|
| 50 | - public function deleteJob(array $params = []) |
|
| 51 | - { |
|
| 52 | - $this->checkRequiredParameters(['id'], $params); |
|
| 53 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 54 | - $method = 'DELETE'; |
|
| 55 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 56 | - $headers = ['Accept' => 'application/json']; |
|
| 57 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 58 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.delete_job'); |
|
| 59 | - return $this->client->sendRequest($request); |
|
| 60 | - } |
|
| 61 | - /** |
|
| 62 | - * Retrieves the configuration, stats, and status of rollup jobs. |
|
| 63 | - * |
|
| 64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html |
|
| 65 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 66 | - * |
|
| 67 | - * @param array{ |
|
| 68 | - * id: string, // The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs |
|
| 69 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 70 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 71 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 72 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 73 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 74 | - * } $params |
|
| 75 | - * |
|
| 76 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 77 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 78 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 79 | - * |
|
| 80 | - * @return Elasticsearch|Promise |
|
| 81 | - */ |
|
| 82 | - public function getJobs(array $params = []) |
|
| 83 | - { |
|
| 84 | - if (isset($params['id'])) { |
|
| 85 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 86 | - $method = 'GET'; |
|
| 87 | - } else { |
|
| 88 | - $url = '/_rollup/job'; |
|
| 89 | - $method = 'GET'; |
|
| 90 | - } |
|
| 91 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 92 | - $headers = ['Accept' => 'application/json']; |
|
| 93 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 94 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.get_jobs'); |
|
| 95 | - return $this->client->sendRequest($request); |
|
| 96 | - } |
|
| 97 | - /** |
|
| 98 | - * Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. |
|
| 99 | - * |
|
| 100 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html |
|
| 101 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 102 | - * |
|
| 103 | - * @param array{ |
|
| 104 | - * id: string, // The ID of the index to check rollup capabilities on, or left blank for all jobs |
|
| 105 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 106 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 107 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 108 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 109 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 110 | - * } $params |
|
| 111 | - * |
|
| 112 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 113 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 114 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 115 | - * |
|
| 116 | - * @return Elasticsearch|Promise |
|
| 117 | - */ |
|
| 118 | - public function getRollupCaps(array $params = []) |
|
| 119 | - { |
|
| 120 | - if (isset($params['id'])) { |
|
| 121 | - $url = '/_rollup/data/' . $this->encode($params['id']); |
|
| 122 | - $method = 'GET'; |
|
| 123 | - } else { |
|
| 124 | - $url = '/_rollup/data'; |
|
| 125 | - $method = 'GET'; |
|
| 126 | - } |
|
| 127 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 128 | - $headers = ['Accept' => 'application/json']; |
|
| 129 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 130 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.get_rollup_caps'); |
|
| 131 | - return $this->client->sendRequest($request); |
|
| 132 | - } |
|
| 133 | - /** |
|
| 134 | - * Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). |
|
| 135 | - * |
|
| 136 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html |
|
| 137 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 138 | - * |
|
| 139 | - * @param array{ |
|
| 140 | - * index: string, // (REQUIRED) The rollup index or index pattern to obtain rollup capabilities from. |
|
| 141 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 142 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 143 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 144 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 145 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 146 | - * } $params |
|
| 147 | - * |
|
| 148 | - * @throws MissingParameterException if a required parameter is missing |
|
| 149 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 150 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 151 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 152 | - * |
|
| 153 | - * @return Elasticsearch|Promise |
|
| 154 | - */ |
|
| 155 | - public function getRollupIndexCaps(array $params = []) |
|
| 156 | - { |
|
| 157 | - $this->checkRequiredParameters(['index'], $params); |
|
| 158 | - $url = '/' . $this->encode($params['index']) . '/_rollup/data'; |
|
| 159 | - $method = 'GET'; |
|
| 160 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 161 | - $headers = ['Accept' => 'application/json']; |
|
| 162 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 163 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'rollup.get_rollup_index_caps'); |
|
| 164 | - return $this->client->sendRequest($request); |
|
| 165 | - } |
|
| 166 | - /** |
|
| 167 | - * Creates a rollup job. |
|
| 168 | - * |
|
| 169 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html |
|
| 170 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 171 | - * |
|
| 172 | - * @param array{ |
|
| 173 | - * id: string, // (REQUIRED) The ID of the job to create |
|
| 174 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 175 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 176 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 177 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 178 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 179 | - * body: array, // (REQUIRED) The job configuration |
|
| 180 | - * } $params |
|
| 181 | - * |
|
| 182 | - * @throws MissingParameterException if a required parameter is missing |
|
| 183 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 184 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 185 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 186 | - * |
|
| 187 | - * @return Elasticsearch|Promise |
|
| 188 | - */ |
|
| 189 | - public function putJob(array $params = []) |
|
| 190 | - { |
|
| 191 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 192 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 193 | - $method = 'PUT'; |
|
| 194 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 195 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 196 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 197 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.put_job'); |
|
| 198 | - return $this->client->sendRequest($request); |
|
| 199 | - } |
|
| 200 | - /** |
|
| 201 | - * Enables searching rolled-up data using the standard query DSL. |
|
| 202 | - * |
|
| 203 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html |
|
| 204 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 205 | - * |
|
| 206 | - * @param array{ |
|
| 207 | - * index: list, // (REQUIRED) The indices or index-pattern(s) (containing rollup or regular data) that should be searched |
|
| 208 | - * typed_keys: boolean, // Specify whether aggregation and suggester names should be prefixed by their respective types in the response |
|
| 209 | - * rest_total_hits_as_int: boolean, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response |
|
| 210 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 211 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 212 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 213 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 214 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 215 | - * body: array, // (REQUIRED) The search request body |
|
| 216 | - * } $params |
|
| 217 | - * |
|
| 218 | - * @throws MissingParameterException if a required parameter is missing |
|
| 219 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 220 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 221 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 222 | - * |
|
| 223 | - * @return Elasticsearch|Promise |
|
| 224 | - */ |
|
| 225 | - public function rollupSearch(array $params = []) |
|
| 226 | - { |
|
| 227 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
| 228 | - $url = '/' . $this->encode($params['index']) . '/_rollup_search'; |
|
| 229 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 230 | - $url = $this->addQueryString($url, $params, ['typed_keys', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 231 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 232 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 233 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'rollup.rollup_search'); |
|
| 234 | - return $this->client->sendRequest($request); |
|
| 235 | - } |
|
| 236 | - /** |
|
| 237 | - * Starts an existing, stopped rollup job. |
|
| 238 | - * |
|
| 239 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html |
|
| 240 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 241 | - * |
|
| 242 | - * @param array{ |
|
| 243 | - * id: string, // (REQUIRED) The ID of the job to start |
|
| 244 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 245 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 246 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 247 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 248 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 249 | - * } $params |
|
| 250 | - * |
|
| 251 | - * @throws MissingParameterException if a required parameter is missing |
|
| 252 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 253 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 254 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 255 | - * |
|
| 256 | - * @return Elasticsearch|Promise |
|
| 257 | - */ |
|
| 258 | - public function startJob(array $params = []) |
|
| 259 | - { |
|
| 260 | - $this->checkRequiredParameters(['id'], $params); |
|
| 261 | - $url = '/_rollup/job/' . $this->encode($params['id']) . '/_start'; |
|
| 262 | - $method = 'POST'; |
|
| 263 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 264 | - $headers = ['Accept' => 'application/json']; |
|
| 265 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 266 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.start_job'); |
|
| 267 | - return $this->client->sendRequest($request); |
|
| 268 | - } |
|
| 269 | - /** |
|
| 270 | - * Stops an existing, started rollup job. |
|
| 271 | - * |
|
| 272 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html |
|
| 273 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 274 | - * |
|
| 275 | - * @param array{ |
|
| 276 | - * id: string, // (REQUIRED) The ID of the job to stop |
|
| 277 | - * wait_for_completion: boolean, // True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. |
|
| 278 | - * timeout: time, // Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. |
|
| 279 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 280 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 281 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 282 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 283 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 284 | - * } $params |
|
| 285 | - * |
|
| 286 | - * @throws MissingParameterException if a required parameter is missing |
|
| 287 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 288 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 289 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 290 | - * |
|
| 291 | - * @return Elasticsearch|Promise |
|
| 292 | - */ |
|
| 293 | - public function stopJob(array $params = []) |
|
| 294 | - { |
|
| 295 | - $this->checkRequiredParameters(['id'], $params); |
|
| 296 | - $url = '/_rollup/job/' . $this->encode($params['id']) . '/_stop'; |
|
| 297 | - $method = 'POST'; |
|
| 298 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 299 | - $headers = ['Accept' => 'application/json']; |
|
| 300 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 301 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.stop_job'); |
|
| 302 | - return $this->client->sendRequest($request); |
|
| 303 | - } |
|
| 28 | + /** |
|
| 29 | + * Deletes an existing rollup job. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html |
|
| 32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | + * |
|
| 34 | + * @param array{ |
|
| 35 | + * id: string, // (REQUIRED) The ID of the job to delete |
|
| 36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | + * } $params |
|
| 42 | + * |
|
| 43 | + * @throws MissingParameterException if a required parameter is missing |
|
| 44 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 45 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 46 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 47 | + * |
|
| 48 | + * @return Elasticsearch|Promise |
|
| 49 | + */ |
|
| 50 | + public function deleteJob(array $params = []) |
|
| 51 | + { |
|
| 52 | + $this->checkRequiredParameters(['id'], $params); |
|
| 53 | + $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 54 | + $method = 'DELETE'; |
|
| 55 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 56 | + $headers = ['Accept' => 'application/json']; |
|
| 57 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 58 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.delete_job'); |
|
| 59 | + return $this->client->sendRequest($request); |
|
| 60 | + } |
|
| 61 | + /** |
|
| 62 | + * Retrieves the configuration, stats, and status of rollup jobs. |
|
| 63 | + * |
|
| 64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html |
|
| 65 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 66 | + * |
|
| 67 | + * @param array{ |
|
| 68 | + * id: string, // The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs |
|
| 69 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 70 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 71 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 72 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 73 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 74 | + * } $params |
|
| 75 | + * |
|
| 76 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 77 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 78 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 79 | + * |
|
| 80 | + * @return Elasticsearch|Promise |
|
| 81 | + */ |
|
| 82 | + public function getJobs(array $params = []) |
|
| 83 | + { |
|
| 84 | + if (isset($params['id'])) { |
|
| 85 | + $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 86 | + $method = 'GET'; |
|
| 87 | + } else { |
|
| 88 | + $url = '/_rollup/job'; |
|
| 89 | + $method = 'GET'; |
|
| 90 | + } |
|
| 91 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 92 | + $headers = ['Accept' => 'application/json']; |
|
| 93 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 94 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.get_jobs'); |
|
| 95 | + return $this->client->sendRequest($request); |
|
| 96 | + } |
|
| 97 | + /** |
|
| 98 | + * Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. |
|
| 99 | + * |
|
| 100 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html |
|
| 101 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 102 | + * |
|
| 103 | + * @param array{ |
|
| 104 | + * id: string, // The ID of the index to check rollup capabilities on, or left blank for all jobs |
|
| 105 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 106 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 107 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 108 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 109 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 110 | + * } $params |
|
| 111 | + * |
|
| 112 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 113 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 114 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 115 | + * |
|
| 116 | + * @return Elasticsearch|Promise |
|
| 117 | + */ |
|
| 118 | + public function getRollupCaps(array $params = []) |
|
| 119 | + { |
|
| 120 | + if (isset($params['id'])) { |
|
| 121 | + $url = '/_rollup/data/' . $this->encode($params['id']); |
|
| 122 | + $method = 'GET'; |
|
| 123 | + } else { |
|
| 124 | + $url = '/_rollup/data'; |
|
| 125 | + $method = 'GET'; |
|
| 126 | + } |
|
| 127 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 128 | + $headers = ['Accept' => 'application/json']; |
|
| 129 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 130 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.get_rollup_caps'); |
|
| 131 | + return $this->client->sendRequest($request); |
|
| 132 | + } |
|
| 133 | + /** |
|
| 134 | + * Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). |
|
| 135 | + * |
|
| 136 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html |
|
| 137 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 138 | + * |
|
| 139 | + * @param array{ |
|
| 140 | + * index: string, // (REQUIRED) The rollup index or index pattern to obtain rollup capabilities from. |
|
| 141 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 142 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 143 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 144 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 145 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 146 | + * } $params |
|
| 147 | + * |
|
| 148 | + * @throws MissingParameterException if a required parameter is missing |
|
| 149 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 150 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 151 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 152 | + * |
|
| 153 | + * @return Elasticsearch|Promise |
|
| 154 | + */ |
|
| 155 | + public function getRollupIndexCaps(array $params = []) |
|
| 156 | + { |
|
| 157 | + $this->checkRequiredParameters(['index'], $params); |
|
| 158 | + $url = '/' . $this->encode($params['index']) . '/_rollup/data'; |
|
| 159 | + $method = 'GET'; |
|
| 160 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 161 | + $headers = ['Accept' => 'application/json']; |
|
| 162 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 163 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'rollup.get_rollup_index_caps'); |
|
| 164 | + return $this->client->sendRequest($request); |
|
| 165 | + } |
|
| 166 | + /** |
|
| 167 | + * Creates a rollup job. |
|
| 168 | + * |
|
| 169 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html |
|
| 170 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 171 | + * |
|
| 172 | + * @param array{ |
|
| 173 | + * id: string, // (REQUIRED) The ID of the job to create |
|
| 174 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 175 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 176 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 177 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 178 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 179 | + * body: array, // (REQUIRED) The job configuration |
|
| 180 | + * } $params |
|
| 181 | + * |
|
| 182 | + * @throws MissingParameterException if a required parameter is missing |
|
| 183 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 184 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 185 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 186 | + * |
|
| 187 | + * @return Elasticsearch|Promise |
|
| 188 | + */ |
|
| 189 | + public function putJob(array $params = []) |
|
| 190 | + { |
|
| 191 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 192 | + $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 193 | + $method = 'PUT'; |
|
| 194 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 195 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 196 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 197 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.put_job'); |
|
| 198 | + return $this->client->sendRequest($request); |
|
| 199 | + } |
|
| 200 | + /** |
|
| 201 | + * Enables searching rolled-up data using the standard query DSL. |
|
| 202 | + * |
|
| 203 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html |
|
| 204 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 205 | + * |
|
| 206 | + * @param array{ |
|
| 207 | + * index: list, // (REQUIRED) The indices or index-pattern(s) (containing rollup or regular data) that should be searched |
|
| 208 | + * typed_keys: boolean, // Specify whether aggregation and suggester names should be prefixed by their respective types in the response |
|
| 209 | + * rest_total_hits_as_int: boolean, // Indicates whether hits.total should be rendered as an integer or an object in the rest search response |
|
| 210 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 211 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 212 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 213 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 214 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 215 | + * body: array, // (REQUIRED) The search request body |
|
| 216 | + * } $params |
|
| 217 | + * |
|
| 218 | + * @throws MissingParameterException if a required parameter is missing |
|
| 219 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 220 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 221 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 222 | + * |
|
| 223 | + * @return Elasticsearch|Promise |
|
| 224 | + */ |
|
| 225 | + public function rollupSearch(array $params = []) |
|
| 226 | + { |
|
| 227 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
| 228 | + $url = '/' . $this->encode($params['index']) . '/_rollup_search'; |
|
| 229 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 230 | + $url = $this->addQueryString($url, $params, ['typed_keys', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 231 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 232 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 233 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'rollup.rollup_search'); |
|
| 234 | + return $this->client->sendRequest($request); |
|
| 235 | + } |
|
| 236 | + /** |
|
| 237 | + * Starts an existing, stopped rollup job. |
|
| 238 | + * |
|
| 239 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html |
|
| 240 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 241 | + * |
|
| 242 | + * @param array{ |
|
| 243 | + * id: string, // (REQUIRED) The ID of the job to start |
|
| 244 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 245 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 246 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 247 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 248 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 249 | + * } $params |
|
| 250 | + * |
|
| 251 | + * @throws MissingParameterException if a required parameter is missing |
|
| 252 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 253 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 254 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 255 | + * |
|
| 256 | + * @return Elasticsearch|Promise |
|
| 257 | + */ |
|
| 258 | + public function startJob(array $params = []) |
|
| 259 | + { |
|
| 260 | + $this->checkRequiredParameters(['id'], $params); |
|
| 261 | + $url = '/_rollup/job/' . $this->encode($params['id']) . '/_start'; |
|
| 262 | + $method = 'POST'; |
|
| 263 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 264 | + $headers = ['Accept' => 'application/json']; |
|
| 265 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 266 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.start_job'); |
|
| 267 | + return $this->client->sendRequest($request); |
|
| 268 | + } |
|
| 269 | + /** |
|
| 270 | + * Stops an existing, started rollup job. |
|
| 271 | + * |
|
| 272 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html |
|
| 273 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 274 | + * |
|
| 275 | + * @param array{ |
|
| 276 | + * id: string, // (REQUIRED) The ID of the job to stop |
|
| 277 | + * wait_for_completion: boolean, // True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. |
|
| 278 | + * timeout: time, // Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. |
|
| 279 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 280 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 281 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 282 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 283 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 284 | + * } $params |
|
| 285 | + * |
|
| 286 | + * @throws MissingParameterException if a required parameter is missing |
|
| 287 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 288 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 289 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 290 | + * |
|
| 291 | + * @return Elasticsearch|Promise |
|
| 292 | + */ |
|
| 293 | + public function stopJob(array $params = []) |
|
| 294 | + { |
|
| 295 | + $this->checkRequiredParameters(['id'], $params); |
|
| 296 | + $url = '/_rollup/job/' . $this->encode($params['id']) . '/_stop'; |
|
| 297 | + $method = 'POST'; |
|
| 298 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 299 | + $headers = ['Accept' => 'application/json']; |
|
| 300 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 301 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'rollup.stop_job'); |
|
| 302 | + return $this->client->sendRequest($request); |
|
| 303 | + } |
|
| 304 | 304 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function deleteJob(array $params = []) |
| 51 | 51 | { |
| 52 | 52 | $this->checkRequiredParameters(['id'], $params); |
| 53 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 53 | + $url = '/_rollup/job/'.$this->encode($params['id']); |
|
| 54 | 54 | $method = 'DELETE'; |
| 55 | 55 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | public function getJobs(array $params = []) |
| 83 | 83 | { |
| 84 | 84 | if (isset($params['id'])) { |
| 85 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 85 | + $url = '/_rollup/job/'.$this->encode($params['id']); |
|
| 86 | 86 | $method = 'GET'; |
| 87 | 87 | } else { |
| 88 | 88 | $url = '/_rollup/job'; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function getRollupCaps(array $params = []) |
| 119 | 119 | { |
| 120 | 120 | if (isset($params['id'])) { |
| 121 | - $url = '/_rollup/data/' . $this->encode($params['id']); |
|
| 121 | + $url = '/_rollup/data/'.$this->encode($params['id']); |
|
| 122 | 122 | $method = 'GET'; |
| 123 | 123 | } else { |
| 124 | 124 | $url = '/_rollup/data'; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | public function getRollupIndexCaps(array $params = []) |
| 156 | 156 | { |
| 157 | 157 | $this->checkRequiredParameters(['index'], $params); |
| 158 | - $url = '/' . $this->encode($params['index']) . '/_rollup/data'; |
|
| 158 | + $url = '/'.$this->encode($params['index']).'/_rollup/data'; |
|
| 159 | 159 | $method = 'GET'; |
| 160 | 160 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 161 | 161 | $headers = ['Accept' => 'application/json']; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | public function putJob(array $params = []) |
| 190 | 190 | { |
| 191 | 191 | $this->checkRequiredParameters(['id', 'body'], $params); |
| 192 | - $url = '/_rollup/job/' . $this->encode($params['id']); |
|
| 192 | + $url = '/_rollup/job/'.$this->encode($params['id']); |
|
| 193 | 193 | $method = 'PUT'; |
| 194 | 194 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 195 | 195 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | public function rollupSearch(array $params = []) |
| 226 | 226 | { |
| 227 | 227 | $this->checkRequiredParameters(['index', 'body'], $params); |
| 228 | - $url = '/' . $this->encode($params['index']) . '/_rollup_search'; |
|
| 228 | + $url = '/'.$this->encode($params['index']).'/_rollup_search'; |
|
| 229 | 229 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 230 | 230 | $url = $this->addQueryString($url, $params, ['typed_keys', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 231 | 231 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | public function startJob(array $params = []) |
| 259 | 259 | { |
| 260 | 260 | $this->checkRequiredParameters(['id'], $params); |
| 261 | - $url = '/_rollup/job/' . $this->encode($params['id']) . '/_start'; |
|
| 261 | + $url = '/_rollup/job/'.$this->encode($params['id']).'/_start'; |
|
| 262 | 262 | $method = 'POST'; |
| 263 | 263 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 264 | 264 | $headers = ['Accept' => 'application/json']; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | public function stopJob(array $params = []) |
| 294 | 294 | { |
| 295 | 295 | $this->checkRequiredParameters(['id'], $params); |
| 296 | - $url = '/_rollup/job/' . $this->encode($params['id']) . '/_stop'; |
|
| 296 | + $url = '/_rollup/job/'.$this->encode($params['id']).'/_stop'; |
|
| 297 | 297 | $method = 'POST'; |
| 298 | 298 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 299 | 299 | $headers = ['Accept' => 'application/json']; |
@@ -25,65 +25,65 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Xpack extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Retrieves information about the installed X-Pack features. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
| 35 | - * accept_enterprise: boolean, // If this param is used it must be set to true |
|
| 36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | - * } $params |
|
| 42 | - * |
|
| 43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | - * |
|
| 47 | - * @return Elasticsearch|Promise |
|
| 48 | - */ |
|
| 49 | - public function info(array $params = []) |
|
| 50 | - { |
|
| 51 | - $url = '/_xpack'; |
|
| 52 | - $method = 'GET'; |
|
| 53 | - $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | - $headers = ['Accept' => 'application/json']; |
|
| 55 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 56 | - $request = $this->addOtelAttributes($params, [], $request, 'xpack.info'); |
|
| 57 | - return $this->client->sendRequest($request); |
|
| 58 | - } |
|
| 59 | - /** |
|
| 60 | - * Retrieves usage information about the installed X-Pack features. |
|
| 61 | - * |
|
| 62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
| 63 | - * |
|
| 64 | - * @param array{ |
|
| 65 | - * master_timeout: time, // Specify timeout for watch write operation |
|
| 66 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 67 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 68 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 69 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 70 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 71 | - * } $params |
|
| 72 | - * |
|
| 73 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | - * |
|
| 77 | - * @return Elasticsearch|Promise |
|
| 78 | - */ |
|
| 79 | - public function usage(array $params = []) |
|
| 80 | - { |
|
| 81 | - $url = '/_xpack/usage'; |
|
| 82 | - $method = 'GET'; |
|
| 83 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 84 | - $headers = ['Accept' => 'application/json']; |
|
| 85 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 86 | - $request = $this->addOtelAttributes($params, [], $request, 'xpack.usage'); |
|
| 87 | - return $this->client->sendRequest($request); |
|
| 88 | - } |
|
| 28 | + /** |
|
| 29 | + * Retrieves information about the installed X-Pack features. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
| 35 | + * accept_enterprise: boolean, // If this param is used it must be set to true |
|
| 36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | + * } $params |
|
| 42 | + * |
|
| 43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | + * |
|
| 47 | + * @return Elasticsearch|Promise |
|
| 48 | + */ |
|
| 49 | + public function info(array $params = []) |
|
| 50 | + { |
|
| 51 | + $url = '/_xpack'; |
|
| 52 | + $method = 'GET'; |
|
| 53 | + $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | + $headers = ['Accept' => 'application/json']; |
|
| 55 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 56 | + $request = $this->addOtelAttributes($params, [], $request, 'xpack.info'); |
|
| 57 | + return $this->client->sendRequest($request); |
|
| 58 | + } |
|
| 59 | + /** |
|
| 60 | + * Retrieves usage information about the installed X-Pack features. |
|
| 61 | + * |
|
| 62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
| 63 | + * |
|
| 64 | + * @param array{ |
|
| 65 | + * master_timeout: time, // Specify timeout for watch write operation |
|
| 66 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 67 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 68 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 69 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 70 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 71 | + * } $params |
|
| 72 | + * |
|
| 73 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | + * |
|
| 77 | + * @return Elasticsearch|Promise |
|
| 78 | + */ |
|
| 79 | + public function usage(array $params = []) |
|
| 80 | + { |
|
| 81 | + $url = '/_xpack/usage'; |
|
| 82 | + $method = 'GET'; |
|
| 83 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 84 | + $headers = ['Accept' => 'application/json']; |
|
| 85 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 86 | + $request = $this->addOtelAttributes($params, [], $request, 'xpack.usage'); |
|
| 87 | + return $this->client->sendRequest($request); |
|
| 88 | + } |
|
| 89 | 89 | } |
@@ -25,129 +25,129 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Profiling extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | - * body: array, // (REQUIRED) The filter conditions for the flamegraph |
|
| 40 | - * } $params |
|
| 41 | - * |
|
| 42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 45 | - * |
|
| 46 | - * @return Elasticsearch|Promise |
|
| 47 | - */ |
|
| 48 | - public function flamegraph(array $params = []) |
|
| 49 | - { |
|
| 50 | - $this->checkRequiredParameters(['body'], $params); |
|
| 51 | - $url = '/_profiling/flamegraph'; |
|
| 52 | - $method = 'POST'; |
|
| 53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 55 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 56 | - $request = $this->addOtelAttributes($params, [], $request, 'profiling.flamegraph'); |
|
| 57 | - return $this->client->sendRequest($request); |
|
| 58 | - } |
|
| 59 | - /** |
|
| 60 | - * Extracts raw stacktrace information from Universal Profiling. |
|
| 61 | - * |
|
| 62 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 63 | - * |
|
| 64 | - * @param array{ |
|
| 65 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 66 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 67 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 68 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 69 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 70 | - * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
| 71 | - * } $params |
|
| 72 | - * |
|
| 73 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | - * |
|
| 77 | - * @return Elasticsearch|Promise |
|
| 78 | - */ |
|
| 79 | - public function stacktraces(array $params = []) |
|
| 80 | - { |
|
| 81 | - $this->checkRequiredParameters(['body'], $params); |
|
| 82 | - $url = '/_profiling/stacktraces'; |
|
| 83 | - $method = 'POST'; |
|
| 84 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 85 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 86 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 87 | - $request = $this->addOtelAttributes($params, [], $request, 'profiling.stacktraces'); |
|
| 88 | - return $this->client->sendRequest($request); |
|
| 89 | - } |
|
| 90 | - /** |
|
| 91 | - * Returns basic information about the status of Universal Profiling. |
|
| 92 | - * |
|
| 93 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 94 | - * |
|
| 95 | - * @param array{ |
|
| 96 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 97 | - * timeout: time, // Explicit operation timeout |
|
| 98 | - * wait_for_resources_created: boolean, // Whether to return immediately or wait until resources have been created |
|
| 99 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 100 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 101 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 102 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 103 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 104 | - * } $params |
|
| 105 | - * |
|
| 106 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 107 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 108 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 109 | - * |
|
| 110 | - * @return Elasticsearch|Promise |
|
| 111 | - */ |
|
| 112 | - public function status(array $params = []) |
|
| 113 | - { |
|
| 114 | - $url = '/_profiling/status'; |
|
| 115 | - $method = 'GET'; |
|
| 116 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'wait_for_resources_created', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 117 | - $headers = ['Accept' => 'application/json']; |
|
| 118 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 119 | - $request = $this->addOtelAttributes($params, [], $request, 'profiling.status'); |
|
| 120 | - return $this->client->sendRequest($request); |
|
| 121 | - } |
|
| 122 | - /** |
|
| 123 | - * Extracts a list of topN functions from Universal Profiling. |
|
| 124 | - * |
|
| 125 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 126 | - * |
|
| 127 | - * @param array{ |
|
| 128 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 129 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 130 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 131 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 132 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 133 | - * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
| 134 | - * } $params |
|
| 135 | - * |
|
| 136 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 137 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 138 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 139 | - * |
|
| 140 | - * @return Elasticsearch|Promise |
|
| 141 | - */ |
|
| 142 | - public function topnFunctions(array $params = []) |
|
| 143 | - { |
|
| 144 | - $this->checkRequiredParameters(['body'], $params); |
|
| 145 | - $url = '/_profiling/topn/functions'; |
|
| 146 | - $method = 'POST'; |
|
| 147 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 148 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 149 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 150 | - $request = $this->addOtelAttributes($params, [], $request, 'profiling.topn_functions'); |
|
| 151 | - return $this->client->sendRequest($request); |
|
| 152 | - } |
|
| 28 | + /** |
|
| 29 | + * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | + * body: array, // (REQUIRED) The filter conditions for the flamegraph |
|
| 40 | + * } $params |
|
| 41 | + * |
|
| 42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 45 | + * |
|
| 46 | + * @return Elasticsearch|Promise |
|
| 47 | + */ |
|
| 48 | + public function flamegraph(array $params = []) |
|
| 49 | + { |
|
| 50 | + $this->checkRequiredParameters(['body'], $params); |
|
| 51 | + $url = '/_profiling/flamegraph'; |
|
| 52 | + $method = 'POST'; |
|
| 53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 55 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 56 | + $request = $this->addOtelAttributes($params, [], $request, 'profiling.flamegraph'); |
|
| 57 | + return $this->client->sendRequest($request); |
|
| 58 | + } |
|
| 59 | + /** |
|
| 60 | + * Extracts raw stacktrace information from Universal Profiling. |
|
| 61 | + * |
|
| 62 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 63 | + * |
|
| 64 | + * @param array{ |
|
| 65 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 66 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 67 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 68 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 69 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 70 | + * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
| 71 | + * } $params |
|
| 72 | + * |
|
| 73 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | + * |
|
| 77 | + * @return Elasticsearch|Promise |
|
| 78 | + */ |
|
| 79 | + public function stacktraces(array $params = []) |
|
| 80 | + { |
|
| 81 | + $this->checkRequiredParameters(['body'], $params); |
|
| 82 | + $url = '/_profiling/stacktraces'; |
|
| 83 | + $method = 'POST'; |
|
| 84 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 85 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 86 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 87 | + $request = $this->addOtelAttributes($params, [], $request, 'profiling.stacktraces'); |
|
| 88 | + return $this->client->sendRequest($request); |
|
| 89 | + } |
|
| 90 | + /** |
|
| 91 | + * Returns basic information about the status of Universal Profiling. |
|
| 92 | + * |
|
| 93 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 94 | + * |
|
| 95 | + * @param array{ |
|
| 96 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 97 | + * timeout: time, // Explicit operation timeout |
|
| 98 | + * wait_for_resources_created: boolean, // Whether to return immediately or wait until resources have been created |
|
| 99 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 100 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 101 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 102 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 103 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 104 | + * } $params |
|
| 105 | + * |
|
| 106 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 107 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 108 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 109 | + * |
|
| 110 | + * @return Elasticsearch|Promise |
|
| 111 | + */ |
|
| 112 | + public function status(array $params = []) |
|
| 113 | + { |
|
| 114 | + $url = '/_profiling/status'; |
|
| 115 | + $method = 'GET'; |
|
| 116 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'wait_for_resources_created', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 117 | + $headers = ['Accept' => 'application/json']; |
|
| 118 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 119 | + $request = $this->addOtelAttributes($params, [], $request, 'profiling.status'); |
|
| 120 | + return $this->client->sendRequest($request); |
|
| 121 | + } |
|
| 122 | + /** |
|
| 123 | + * Extracts a list of topN functions from Universal Profiling. |
|
| 124 | + * |
|
| 125 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
| 126 | + * |
|
| 127 | + * @param array{ |
|
| 128 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 129 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 130 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 131 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 132 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 133 | + * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
| 134 | + * } $params |
|
| 135 | + * |
|
| 136 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 137 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 138 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 139 | + * |
|
| 140 | + * @return Elasticsearch|Promise |
|
| 141 | + */ |
|
| 142 | + public function topnFunctions(array $params = []) |
|
| 143 | + { |
|
| 144 | + $this->checkRequiredParameters(['body'], $params); |
|
| 145 | + $url = '/_profiling/topn/functions'; |
|
| 146 | + $method = 'POST'; |
|
| 147 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 148 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 149 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 150 | + $request = $this->addOtelAttributes($params, [], $request, 'profiling.topn_functions'); |
|
| 151 | + return $this->client->sendRequest($request); |
|
| 152 | + } |
|
| 153 | 153 | } |
@@ -25,97 +25,97 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Migration extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * 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. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * index: string, // Index pattern |
|
| 35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | - * } $params |
|
| 41 | - * |
|
| 42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 45 | - * |
|
| 46 | - * @return Elasticsearch|Promise |
|
| 47 | - */ |
|
| 48 | - public function deprecations(array $params = []) |
|
| 49 | - { |
|
| 50 | - if (isset($params['index'])) { |
|
| 51 | - $url = '/' . $this->encode($params['index']) . '/_migration/deprecations'; |
|
| 52 | - $method = 'GET'; |
|
| 53 | - } else { |
|
| 54 | - $url = '/_migration/deprecations'; |
|
| 55 | - $method = 'GET'; |
|
| 56 | - } |
|
| 57 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | - $headers = ['Accept' => 'application/json']; |
|
| 59 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 60 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'migration.deprecations'); |
|
| 61 | - return $this->client->sendRequest($request); |
|
| 62 | - } |
|
| 63 | - /** |
|
| 64 | - * Find out whether system features need to be upgraded or not |
|
| 65 | - * |
|
| 66 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html |
|
| 67 | - * |
|
| 68 | - * @param array{ |
|
| 69 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 70 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 71 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 72 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 73 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 74 | - * } $params |
|
| 75 | - * |
|
| 76 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 77 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 78 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 79 | - * |
|
| 80 | - * @return Elasticsearch|Promise |
|
| 81 | - */ |
|
| 82 | - public function getFeatureUpgradeStatus(array $params = []) |
|
| 83 | - { |
|
| 84 | - $url = '/_migration/system_features'; |
|
| 85 | - $method = 'GET'; |
|
| 86 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 87 | - $headers = ['Accept' => 'application/json']; |
|
| 88 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 89 | - $request = $this->addOtelAttributes($params, [], $request, 'migration.get_feature_upgrade_status'); |
|
| 90 | - return $this->client->sendRequest($request); |
|
| 91 | - } |
|
| 92 | - /** |
|
| 93 | - * Begin upgrades for system features |
|
| 94 | - * |
|
| 95 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html |
|
| 96 | - * |
|
| 97 | - * @param array{ |
|
| 98 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 99 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 100 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 101 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 102 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 103 | - * } $params |
|
| 104 | - * |
|
| 105 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 106 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 107 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 108 | - * |
|
| 109 | - * @return Elasticsearch|Promise |
|
| 110 | - */ |
|
| 111 | - public function postFeatureUpgrade(array $params = []) |
|
| 112 | - { |
|
| 113 | - $url = '/_migration/system_features'; |
|
| 114 | - $method = 'POST'; |
|
| 115 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 116 | - $headers = ['Accept' => 'application/json']; |
|
| 117 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 118 | - $request = $this->addOtelAttributes($params, [], $request, 'migration.post_feature_upgrade'); |
|
| 119 | - return $this->client->sendRequest($request); |
|
| 120 | - } |
|
| 28 | + /** |
|
| 29 | + * 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. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * index: string, // Index pattern |
|
| 35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | + * } $params |
|
| 41 | + * |
|
| 42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 45 | + * |
|
| 46 | + * @return Elasticsearch|Promise |
|
| 47 | + */ |
|
| 48 | + public function deprecations(array $params = []) |
|
| 49 | + { |
|
| 50 | + if (isset($params['index'])) { |
|
| 51 | + $url = '/' . $this->encode($params['index']) . '/_migration/deprecations'; |
|
| 52 | + $method = 'GET'; |
|
| 53 | + } else { |
|
| 54 | + $url = '/_migration/deprecations'; |
|
| 55 | + $method = 'GET'; |
|
| 56 | + } |
|
| 57 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | + $headers = ['Accept' => 'application/json']; |
|
| 59 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 60 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'migration.deprecations'); |
|
| 61 | + return $this->client->sendRequest($request); |
|
| 62 | + } |
|
| 63 | + /** |
|
| 64 | + * Find out whether system features need to be upgraded or not |
|
| 65 | + * |
|
| 66 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html |
|
| 67 | + * |
|
| 68 | + * @param array{ |
|
| 69 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 70 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 71 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 72 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 73 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 74 | + * } $params |
|
| 75 | + * |
|
| 76 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 77 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 78 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 79 | + * |
|
| 80 | + * @return Elasticsearch|Promise |
|
| 81 | + */ |
|
| 82 | + public function getFeatureUpgradeStatus(array $params = []) |
|
| 83 | + { |
|
| 84 | + $url = '/_migration/system_features'; |
|
| 85 | + $method = 'GET'; |
|
| 86 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 87 | + $headers = ['Accept' => 'application/json']; |
|
| 88 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 89 | + $request = $this->addOtelAttributes($params, [], $request, 'migration.get_feature_upgrade_status'); |
|
| 90 | + return $this->client->sendRequest($request); |
|
| 91 | + } |
|
| 92 | + /** |
|
| 93 | + * Begin upgrades for system features |
|
| 94 | + * |
|
| 95 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html |
|
| 96 | + * |
|
| 97 | + * @param array{ |
|
| 98 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 99 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 100 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 101 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 102 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 103 | + * } $params |
|
| 104 | + * |
|
| 105 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 106 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 107 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 108 | + * |
|
| 109 | + * @return Elasticsearch|Promise |
|
| 110 | + */ |
|
| 111 | + public function postFeatureUpgrade(array $params = []) |
|
| 112 | + { |
|
| 113 | + $url = '/_migration/system_features'; |
|
| 114 | + $method = 'POST'; |
|
| 115 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 116 | + $headers = ['Accept' => 'application/json']; |
|
| 117 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
| 118 | + $request = $this->addOtelAttributes($params, [], $request, 'migration.post_feature_upgrade'); |
|
| 119 | + return $this->client->sendRequest($request); |
|
| 120 | + } |
|
| 121 | 121 | } |