@@ -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 delete(array $params = []) |
50 | 50 | { |
51 | 51 | $this->checkRequiredParameters(['id'], $params); |
52 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
52 | + $url = '/_eql/search/'.$this->encode($params['id']); |
|
53 | 53 | $method = 'DELETE'; |
54 | 54 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
55 | 55 | $headers = ['Accept' => 'application/json']; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function get(array $params = []) |
82 | 82 | { |
83 | 83 | $this->checkRequiredParameters(['id'], $params); |
84 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
84 | + $url = '/_eql/search/'.$this->encode($params['id']); |
|
85 | 85 | $method = 'GET'; |
86 | 86 | $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
87 | 87 | $headers = ['Accept' => 'application/json']; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function getStatus(array $params = []) |
112 | 112 | { |
113 | 113 | $this->checkRequiredParameters(['id'], $params); |
114 | - $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
114 | + $url = '/_eql/search/status/'.$this->encode($params['id']); |
|
115 | 115 | $method = 'GET'; |
116 | 116 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
117 | 117 | $headers = ['Accept' => 'application/json']; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function search(array $params = []) |
146 | 146 | { |
147 | 147 | $this->checkRequiredParameters(['index', 'body'], $params); |
148 | - $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
148 | + $url = '/'.$this->encode($params['index']).'/_eql/search'; |
|
149 | 149 | $method = empty($params['body']) ? 'GET' : 'POST'; |
150 | 150 | $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
151 | 151 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Eql extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Eql extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
30 | 29 | * |
@@ -25,138 +25,138 @@ |
||
25 | 25 | */ |
26 | 26 | class Eql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * id: string, // (REQUIRED) The async search ID |
|
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 delete(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['id'], $params); |
|
52 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.delete'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Returns async results from previously executed Event Query Language (EQL) search |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * id: string, // (REQUIRED) The async search ID |
|
67 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
68 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 MissingParameterException if a required parameter is missing |
|
77 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | - * @throws ClientResponseException if the status code of response is 4xx |
|
79 | - * @throws ServerResponseException if the status code of response is 5xx |
|
80 | - * |
|
81 | - * @return Elasticsearch|Promise |
|
82 | - */ |
|
83 | - public function get(array $params = []) |
|
84 | - { |
|
85 | - $this->checkRequiredParameters(['id'], $params); |
|
86 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
87 | - $method = 'GET'; |
|
88 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | - $headers = ['Accept' => 'application/json']; |
|
90 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get'); |
|
92 | - return $this->client->sendRequest($request); |
|
93 | - } |
|
94 | - /** |
|
95 | - * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
98 | - * |
|
99 | - * @param array{ |
|
100 | - * id: string, // (REQUIRED) The async search ID |
|
101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | - * } $params |
|
107 | - * |
|
108 | - * @throws MissingParameterException if a required parameter is missing |
|
109 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | - * @throws ClientResponseException if the status code of response is 4xx |
|
111 | - * @throws ServerResponseException if the status code of response is 5xx |
|
112 | - * |
|
113 | - * @return Elasticsearch|Promise |
|
114 | - */ |
|
115 | - public function getStatus(array $params = []) |
|
116 | - { |
|
117 | - $this->checkRequiredParameters(['id'], $params); |
|
118 | - $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
119 | - $method = 'GET'; |
|
120 | - $url = $this->addQueryString($url, $params, ['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, ['id'], $request, 'eql.get_status'); |
|
124 | - return $this->client->sendRequest($request); |
|
125 | - } |
|
126 | - /** |
|
127 | - * Returns results matching a query expressed in Event Query Language (EQL) |
|
128 | - * |
|
129 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
130 | - * |
|
131 | - * @param array{ |
|
132 | - * index: string, // (REQUIRED) The name of the index to scope the operation |
|
133 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
134 | - * keep_on_completion: boolean, // Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) |
|
135 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 | - * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
142 | - * } $params |
|
143 | - * |
|
144 | - * @throws MissingParameterException if a required parameter is missing |
|
145 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | - * @throws ClientResponseException if the status code of response is 4xx |
|
147 | - * @throws ServerResponseException if the status code of response is 5xx |
|
148 | - * |
|
149 | - * @return Elasticsearch|Promise |
|
150 | - */ |
|
151 | - public function search(array $params = []) |
|
152 | - { |
|
153 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
154 | - $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
155 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
156 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'eql.search'); |
|
160 | - return $this->client->sendRequest($request); |
|
161 | - } |
|
28 | + /** |
|
29 | + * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * id: string, // (REQUIRED) The async search ID |
|
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 delete(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['id'], $params); |
|
52 | + $url = '/_eql/search/' . $this->encode($params['id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.delete'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Returns async results from previously executed Event Query Language (EQL) search |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * id: string, // (REQUIRED) The async search ID |
|
67 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
68 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 MissingParameterException if a required parameter is missing |
|
77 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | + * @throws ClientResponseException if the status code of response is 4xx |
|
79 | + * @throws ServerResponseException if the status code of response is 5xx |
|
80 | + * |
|
81 | + * @return Elasticsearch|Promise |
|
82 | + */ |
|
83 | + public function get(array $params = []) |
|
84 | + { |
|
85 | + $this->checkRequiredParameters(['id'], $params); |
|
86 | + $url = '/_eql/search/' . $this->encode($params['id']); |
|
87 | + $method = 'GET'; |
|
88 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | + $headers = ['Accept' => 'application/json']; |
|
90 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get'); |
|
92 | + return $this->client->sendRequest($request); |
|
93 | + } |
|
94 | + /** |
|
95 | + * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
98 | + * |
|
99 | + * @param array{ |
|
100 | + * id: string, // (REQUIRED) The async search ID |
|
101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | + * } $params |
|
107 | + * |
|
108 | + * @throws MissingParameterException if a required parameter is missing |
|
109 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | + * @throws ClientResponseException if the status code of response is 4xx |
|
111 | + * @throws ServerResponseException if the status code of response is 5xx |
|
112 | + * |
|
113 | + * @return Elasticsearch|Promise |
|
114 | + */ |
|
115 | + public function getStatus(array $params = []) |
|
116 | + { |
|
117 | + $this->checkRequiredParameters(['id'], $params); |
|
118 | + $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
119 | + $method = 'GET'; |
|
120 | + $url = $this->addQueryString($url, $params, ['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, ['id'], $request, 'eql.get_status'); |
|
124 | + return $this->client->sendRequest($request); |
|
125 | + } |
|
126 | + /** |
|
127 | + * Returns results matching a query expressed in Event Query Language (EQL) |
|
128 | + * |
|
129 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
130 | + * |
|
131 | + * @param array{ |
|
132 | + * index: string, // (REQUIRED) The name of the index to scope the operation |
|
133 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
134 | + * keep_on_completion: boolean, // Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) |
|
135 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 | + * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
142 | + * } $params |
|
143 | + * |
|
144 | + * @throws MissingParameterException if a required parameter is missing |
|
145 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | + * @throws ClientResponseException if the status code of response is 4xx |
|
147 | + * @throws ServerResponseException if the status code of response is 5xx |
|
148 | + * |
|
149 | + * @return Elasticsearch|Promise |
|
150 | + */ |
|
151 | + public function search(array $params = []) |
|
152 | + { |
|
153 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
154 | + $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
155 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
156 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'eql.search'); |
|
160 | + return $this->client->sendRequest($request); |
|
161 | + } |
|
162 | 162 | } |
@@ -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; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $this->checkRequiredParameters(['body'], $params); |
55 | 55 | if (isset($params['type'])) { |
56 | - $url = '/_monitoring/' . $this->encode($params['type']) . '/bulk'; |
|
56 | + $url = '/_monitoring/'.$this->encode($params['type']).'/bulk'; |
|
57 | 57 | $method = 'POST'; |
58 | 58 | } else { |
59 | 59 | $url = '/_monitoring/bulk'; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Monitoring extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Monitoring extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Used by the monitoring features to send monitoring data. |
30 | 29 | * |
@@ -25,44 +25,44 @@ |
||
25 | 25 | */ |
26 | 26 | class Monitoring extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Used by the monitoring features to send monitoring data. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * type: string, // Default document type for items which don't provide one |
|
35 | - * system_id: string, // Identifier of the monitored system |
|
36 | - * system_api_version: string, // API Version of the monitored system |
|
37 | - * interval: string, // Collection interval (e.g., '10s' or '10000ms') of the payload |
|
38 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
39 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
40 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
41 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
42 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
43 | - * body: array, // (REQUIRED) The operation definition and data (action-data pairs), separated by newlines |
|
44 | - * } $params |
|
45 | - * |
|
46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
49 | - * |
|
50 | - * @return Elasticsearch|Promise |
|
51 | - */ |
|
52 | - public function bulk(array $params = []) |
|
53 | - { |
|
54 | - $this->checkRequiredParameters(['body'], $params); |
|
55 | - if (isset($params['type'])) { |
|
56 | - $url = '/_monitoring/' . $this->encode($params['type']) . '/bulk'; |
|
57 | - $method = 'POST'; |
|
58 | - } else { |
|
59 | - $url = '/_monitoring/bulk'; |
|
60 | - $method = 'POST'; |
|
61 | - } |
|
62 | - $url = $this->addQueryString($url, $params, ['system_id', 'system_api_version', 'interval', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
63 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
64 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
65 | - $request = $this->addOtelAttributes($params, ['type'], $request, 'monitoring.bulk'); |
|
66 | - return $this->client->sendRequest($request); |
|
67 | - } |
|
28 | + /** |
|
29 | + * Used by the monitoring features to send monitoring data. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * type: string, // Default document type for items which don't provide one |
|
35 | + * system_id: string, // Identifier of the monitored system |
|
36 | + * system_api_version: string, // API Version of the monitored system |
|
37 | + * interval: string, // Collection interval (e.g., '10s' or '10000ms') of the payload |
|
38 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
39 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
40 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
41 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
42 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
43 | + * body: array, // (REQUIRED) The operation definition and data (action-data pairs), separated by newlines |
|
44 | + * } $params |
|
45 | + * |
|
46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
49 | + * |
|
50 | + * @return Elasticsearch|Promise |
|
51 | + */ |
|
52 | + public function bulk(array $params = []) |
|
53 | + { |
|
54 | + $this->checkRequiredParameters(['body'], $params); |
|
55 | + if (isset($params['type'])) { |
|
56 | + $url = '/_monitoring/' . $this->encode($params['type']) . '/bulk'; |
|
57 | + $method = 'POST'; |
|
58 | + } else { |
|
59 | + $url = '/_monitoring/bulk'; |
|
60 | + $method = 'POST'; |
|
61 | + } |
|
62 | + $url = $this->addQueryString($url, $params, ['system_id', 'system_api_version', 'interval', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
63 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
64 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
65 | + $request = $this->addOtelAttributes($params, ['type'], $request, 'monitoring.bulk'); |
|
66 | + return $this->client->sendRequest($request); |
|
67 | + } |
|
68 | 68 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Ml extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Ml extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Clear the cached results from a trained model deployment |
30 | 29 | * |
@@ -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']; |
@@ -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; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function globalCheckpoints(array $params = []) |
54 | 54 | { |
55 | 55 | $this->checkRequiredParameters(['index'], $params); |
56 | - $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; |
|
56 | + $url = '/'.$this->encode($params['index']).'/_fleet/global_checkpoints'; |
|
57 | 57 | $method = 'GET'; |
58 | 58 | $url = $this->addQueryString($url, $params, ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
59 | 59 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $this->checkRequiredParameters(['body'], $params); |
86 | 86 | if (isset($params['index'])) { |
87 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
87 | + $url = '/'.$this->encode($params['index']).'/_fleet/_fleet_msearch'; |
|
88 | 88 | $method = empty($params['body']) ? 'GET' : 'POST'; |
89 | 89 | } else { |
90 | 90 | $url = '/_fleet/_fleet_msearch'; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function search(array $params = []) |
123 | 123 | { |
124 | 124 | $this->checkRequiredParameters(['index'], $params); |
125 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
125 | + $url = '/'.$this->encode($params['index']).'/_fleet/_fleet_search'; |
|
126 | 126 | $method = empty($params['body']) ? 'GET' : 'POST'; |
127 | 127 | $url = $this->addQueryString($url, $params, ['wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
128 | 128 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Fleet extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Fleet extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. |
30 | 29 | * |
@@ -25,113 +25,113 @@ |
||
25 | 25 | */ |
26 | 26 | class Fleet extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * index: string, // (REQUIRED) The name of the index. |
|
35 | - * wait_for_advance: boolean, // Whether to wait for the global checkpoint to advance past the specified current checkpoints |
|
36 | - * wait_for_index: boolean, // Whether to wait for the target index to exist and all primary shards be active |
|
37 | - * checkpoints: list, // Comma separated list of checkpoints |
|
38 | - * timeout: time, // Timeout to wait for global checkpoint to advance |
|
39 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
40 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
41 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
42 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
43 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
44 | - * } $params |
|
45 | - * |
|
46 | - * @throws MissingParameterException if a required parameter is missing |
|
47 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
48 | - * @throws ClientResponseException if the status code of response is 4xx |
|
49 | - * @throws ServerResponseException if the status code of response is 5xx |
|
50 | - * |
|
51 | - * @return Elasticsearch|Promise |
|
52 | - */ |
|
53 | - public function globalCheckpoints(array $params = []) |
|
54 | - { |
|
55 | - $this->checkRequiredParameters(['index'], $params); |
|
56 | - $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; |
|
57 | - $method = 'GET'; |
|
58 | - $url = $this->addQueryString($url, $params, ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
60 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.global_checkpoints'); |
|
62 | - return $this->client->sendRequest($request); |
|
63 | - } |
|
64 | - /** |
|
65 | - * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
66 | - * |
|
67 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
68 | - * |
|
69 | - * @param array{ |
|
70 | - * index: string, // The index name to use as the default |
|
71 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
72 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
73 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
74 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
75 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
76 | - * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
77 | - * } $params |
|
78 | - * |
|
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 msearch(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['body'], $params); |
|
88 | - if (isset($params['index'])) { |
|
89 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
90 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
91 | - } else { |
|
92 | - $url = '/_fleet/_fleet_msearch'; |
|
93 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
94 | - } |
|
95 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
97 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
98 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.msearch'); |
|
99 | - return $this->client->sendRequest($request); |
|
100 | - } |
|
101 | - /** |
|
102 | - * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
103 | - * |
|
104 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
105 | - * |
|
106 | - * @param array{ |
|
107 | - * index: string, // (REQUIRED) The index name to search. |
|
108 | - * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
109 | - * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
110 | - * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
111 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
112 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
113 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
114 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
115 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
116 | - * body: array, // The search definition using the Query DSL |
|
117 | - * } $params |
|
118 | - * |
|
119 | - * @throws MissingParameterException if a required parameter is missing |
|
120 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
121 | - * @throws ClientResponseException if the status code of response is 4xx |
|
122 | - * @throws ServerResponseException if the status code of response is 5xx |
|
123 | - * |
|
124 | - * @return Elasticsearch|Promise |
|
125 | - */ |
|
126 | - public function search(array $params = []) |
|
127 | - { |
|
128 | - $this->checkRequiredParameters(['index'], $params); |
|
129 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
130 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
131 | - $url = $this->addQueryString($url, $params, ['wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
132 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
133 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
134 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.search'); |
|
135 | - return $this->client->sendRequest($request); |
|
136 | - } |
|
28 | + /** |
|
29 | + * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * index: string, // (REQUIRED) The name of the index. |
|
35 | + * wait_for_advance: boolean, // Whether to wait for the global checkpoint to advance past the specified current checkpoints |
|
36 | + * wait_for_index: boolean, // Whether to wait for the target index to exist and all primary shards be active |
|
37 | + * checkpoints: list, // Comma separated list of checkpoints |
|
38 | + * timeout: time, // Timeout to wait for global checkpoint to advance |
|
39 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
40 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
41 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
42 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
43 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
44 | + * } $params |
|
45 | + * |
|
46 | + * @throws MissingParameterException if a required parameter is missing |
|
47 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
48 | + * @throws ClientResponseException if the status code of response is 4xx |
|
49 | + * @throws ServerResponseException if the status code of response is 5xx |
|
50 | + * |
|
51 | + * @return Elasticsearch|Promise |
|
52 | + */ |
|
53 | + public function globalCheckpoints(array $params = []) |
|
54 | + { |
|
55 | + $this->checkRequiredParameters(['index'], $params); |
|
56 | + $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; |
|
57 | + $method = 'GET'; |
|
58 | + $url = $this->addQueryString($url, $params, ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
60 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.global_checkpoints'); |
|
62 | + return $this->client->sendRequest($request); |
|
63 | + } |
|
64 | + /** |
|
65 | + * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
66 | + * |
|
67 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
68 | + * |
|
69 | + * @param array{ |
|
70 | + * index: string, // The index name to use as the default |
|
71 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
72 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
73 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
74 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
75 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
76 | + * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
77 | + * } $params |
|
78 | + * |
|
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 msearch(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['body'], $params); |
|
88 | + if (isset($params['index'])) { |
|
89 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
90 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
91 | + } else { |
|
92 | + $url = '/_fleet/_fleet_msearch'; |
|
93 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
94 | + } |
|
95 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
97 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
98 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.msearch'); |
|
99 | + return $this->client->sendRequest($request); |
|
100 | + } |
|
101 | + /** |
|
102 | + * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
103 | + * |
|
104 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
105 | + * |
|
106 | + * @param array{ |
|
107 | + * index: string, // (REQUIRED) The index name to search. |
|
108 | + * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
109 | + * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
110 | + * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
111 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
112 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
113 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
114 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
115 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
116 | + * body: array, // The search definition using the Query DSL |
|
117 | + * } $params |
|
118 | + * |
|
119 | + * @throws MissingParameterException if a required parameter is missing |
|
120 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
121 | + * @throws ClientResponseException if the status code of response is 4xx |
|
122 | + * @throws ServerResponseException if the status code of response is 5xx |
|
123 | + * |
|
124 | + * @return Elasticsearch|Promise |
|
125 | + */ |
|
126 | + public function search(array $params = []) |
|
127 | + { |
|
128 | + $this->checkRequiredParameters(['index'], $params); |
|
129 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
130 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
131 | + $url = $this->addQueryString($url, $params, ['wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
132 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
133 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
134 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.search'); |
|
135 | + return $this->client->sendRequest($request); |
|
136 | + } |
|
137 | 137 | } |
@@ -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; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function explore(array $params = []) |
53 | 53 | { |
54 | 54 | $this->checkRequiredParameters(['index'], $params); |
55 | - $url = '/' . $this->encode($params['index']) . '/_graph/explore'; |
|
55 | + $url = '/'.$this->encode($params['index']).'/_graph/explore'; |
|
56 | 56 | $method = empty($params['body']) ? 'GET' : 'POST'; |
57 | 57 | $url = $this->addQueryString($url, $params, ['routing', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
58 | 58 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Graph extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Graph extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Explore extracted and summarized information about the documents and terms in an index. |
30 | 29 | * |
@@ -25,39 +25,39 @@ |
||
25 | 25 | */ |
26 | 26 | class Graph extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Explore extracted and summarized information about the documents and terms in an index. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * index: list, // (REQUIRED) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices |
|
35 | - * routing: string, // Specific routing value |
|
36 | - * timeout: time, // Explicit operation timeout |
|
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, // Graph Query DSL |
|
43 | - * } $params |
|
44 | - * |
|
45 | - * @throws MissingParameterException if a required parameter is missing |
|
46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
49 | - * |
|
50 | - * @return Elasticsearch|Promise |
|
51 | - */ |
|
52 | - public function explore(array $params = []) |
|
53 | - { |
|
54 | - $this->checkRequiredParameters(['index'], $params); |
|
55 | - $url = '/' . $this->encode($params['index']) . '/_graph/explore'; |
|
56 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
57 | - $url = $this->addQueryString($url, $params, ['routing', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
59 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
60 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'graph.explore'); |
|
61 | - return $this->client->sendRequest($request); |
|
62 | - } |
|
28 | + /** |
|
29 | + * Explore extracted and summarized information about the documents and terms in an index. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * index: list, // (REQUIRED) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices |
|
35 | + * routing: string, // Specific routing value |
|
36 | + * timeout: time, // Explicit operation timeout |
|
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, // Graph Query DSL |
|
43 | + * } $params |
|
44 | + * |
|
45 | + * @throws MissingParameterException if a required parameter is missing |
|
46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
49 | + * |
|
50 | + * @return Elasticsearch|Promise |
|
51 | + */ |
|
52 | + public function explore(array $params = []) |
|
53 | + { |
|
54 | + $this->checkRequiredParameters(['index'], $params); |
|
55 | + $url = '/' . $this->encode($params['index']) . '/_graph/explore'; |
|
56 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
57 | + $url = $this->addQueryString($url, $params, ['routing', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
59 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
60 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'graph.explore'); |
|
61 | + return $this->client->sendRequest($request); |
|
62 | + } |
|
63 | 63 | } |
@@ -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; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function aliases(array $params = []) |
56 | 56 | { |
57 | 57 | if (isset($params['name'])) { |
58 | - $url = '/_cat/aliases/' . $this->encode($params['name']); |
|
58 | + $url = '/_cat/aliases/'.$this->encode($params['name']); |
|
59 | 59 | $method = 'GET'; |
60 | 60 | } else { |
61 | 61 | $url = '/_cat/aliases'; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function allocation(array $params = []) |
97 | 97 | { |
98 | 98 | if (isset($params['node_id'])) { |
99 | - $url = '/_cat/allocation/' . $this->encode($params['node_id']); |
|
99 | + $url = '/_cat/allocation/'.$this->encode($params['node_id']); |
|
100 | 100 | $method = 'GET'; |
101 | 101 | } else { |
102 | 102 | $url = '/_cat/allocation'; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function componentTemplates(array $params = []) |
137 | 137 | { |
138 | 138 | if (isset($params['name'])) { |
139 | - $url = '/_cat/component_templates/' . $this->encode($params['name']); |
|
139 | + $url = '/_cat/component_templates/'.$this->encode($params['name']); |
|
140 | 140 | $method = 'GET'; |
141 | 141 | } else { |
142 | 142 | $url = '/_cat/component_templates'; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function count(array $params = []) |
175 | 175 | { |
176 | 176 | if (isset($params['index'])) { |
177 | - $url = '/_cat/count/' . $this->encode($params['index']); |
|
177 | + $url = '/_cat/count/'.$this->encode($params['index']); |
|
178 | 178 | $method = 'GET'; |
179 | 179 | } else { |
180 | 180 | $url = '/_cat/count'; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | public function fielddata(array $params = []) |
214 | 214 | { |
215 | 215 | if (isset($params['fields'])) { |
216 | - $url = '/_cat/fielddata/' . $this->encode($params['fields']); |
|
216 | + $url = '/_cat/fielddata/'.$this->encode($params['fields']); |
|
217 | 217 | $method = 'GET'; |
218 | 218 | } else { |
219 | 219 | $url = '/_cat/fielddata'; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function indices(array $params = []) |
322 | 322 | { |
323 | 323 | if (isset($params['index'])) { |
324 | - $url = '/_cat/indices/' . $this->encode($params['index']); |
|
324 | + $url = '/_cat/indices/'.$this->encode($params['index']); |
|
325 | 325 | $method = 'GET'; |
326 | 326 | } else { |
327 | 327 | $url = '/_cat/indices'; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | public function mlDataFrameAnalytics(array $params = []) |
397 | 397 | { |
398 | 398 | if (isset($params['id'])) { |
399 | - $url = '/_cat/ml/data_frame/analytics/' . $this->encode($params['id']); |
|
399 | + $url = '/_cat/ml/data_frame/analytics/'.$this->encode($params['id']); |
|
400 | 400 | $method = 'GET'; |
401 | 401 | } else { |
402 | 402 | $url = '/_cat/ml/data_frame/analytics'; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | public function mlDatafeeds(array $params = []) |
437 | 437 | { |
438 | 438 | if (isset($params['datafeed_id'])) { |
439 | - $url = '/_cat/ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
439 | + $url = '/_cat/ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
440 | 440 | $method = 'GET'; |
441 | 441 | } else { |
442 | 442 | $url = '/_cat/ml/datafeeds'; |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | public function mlJobs(array $params = []) |
478 | 478 | { |
479 | 479 | if (isset($params['job_id'])) { |
480 | - $url = '/_cat/ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
480 | + $url = '/_cat/ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
481 | 481 | $method = 'GET'; |
482 | 482 | } else { |
483 | 483 | $url = '/_cat/ml/anomaly_detectors'; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | public function mlTrainedModels(array $params = []) |
521 | 521 | { |
522 | 522 | if (isset($params['model_id'])) { |
523 | - $url = '/_cat/ml/trained_models/' . $this->encode($params['model_id']); |
|
523 | + $url = '/_cat/ml/trained_models/'.$this->encode($params['model_id']); |
|
524 | 524 | $method = 'GET'; |
525 | 525 | } else { |
526 | 526 | $url = '/_cat/ml/trained_models'; |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | public function recovery(array $params = []) |
704 | 704 | { |
705 | 705 | if (isset($params['index'])) { |
706 | - $url = '/_cat/recovery/' . $this->encode($params['index']); |
|
706 | + $url = '/_cat/recovery/'.$this->encode($params['index']); |
|
707 | 707 | $method = 'GET'; |
708 | 708 | } else { |
709 | 709 | $url = '/_cat/recovery'; |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | public function segments(array $params = []) |
777 | 777 | { |
778 | 778 | if (isset($params['index'])) { |
779 | - $url = '/_cat/segments/' . $this->encode($params['index']); |
|
779 | + $url = '/_cat/segments/'.$this->encode($params['index']); |
|
780 | 780 | $method = 'GET'; |
781 | 781 | } else { |
782 | 782 | $url = '/_cat/segments'; |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | public function shards(array $params = []) |
818 | 818 | { |
819 | 819 | if (isset($params['index'])) { |
820 | - $url = '/_cat/shards/' . $this->encode($params['index']); |
|
820 | + $url = '/_cat/shards/'.$this->encode($params['index']); |
|
821 | 821 | $method = 'GET'; |
822 | 822 | } else { |
823 | 823 | $url = '/_cat/shards'; |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | public function snapshots(array $params = []) |
859 | 859 | { |
860 | 860 | if (isset($params['repository'])) { |
861 | - $url = '/_cat/snapshots/' . $this->encode($params['repository']); |
|
861 | + $url = '/_cat/snapshots/'.$this->encode($params['repository']); |
|
862 | 862 | $method = 'GET'; |
863 | 863 | } else { |
864 | 864 | $url = '/_cat/snapshots'; |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | public function templates(array $params = []) |
937 | 937 | { |
938 | 938 | if (isset($params['name'])) { |
939 | - $url = '/_cat/templates/' . $this->encode($params['name']); |
|
939 | + $url = '/_cat/templates/'.$this->encode($params['name']); |
|
940 | 940 | $method = 'GET'; |
941 | 941 | } else { |
942 | 942 | $url = '/_cat/templates'; |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | public function threadPool(array $params = []) |
979 | 979 | { |
980 | 980 | if (isset($params['thread_pool_patterns'])) { |
981 | - $url = '/_cat/thread_pool/' . $this->encode($params['thread_pool_patterns']); |
|
981 | + $url = '/_cat/thread_pool/'.$this->encode($params['thread_pool_patterns']); |
|
982 | 982 | $method = 'GET'; |
983 | 983 | } else { |
984 | 984 | $url = '/_cat/thread_pool'; |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | public function transforms(array $params = []) |
1021 | 1021 | { |
1022 | 1022 | if (isset($params['transform_id'])) { |
1023 | - $url = '/_cat/transforms/' . $this->encode($params['transform_id']); |
|
1023 | + $url = '/_cat/transforms/'.$this->encode($params['transform_id']); |
|
1024 | 1024 | $method = 'GET'; |
1025 | 1025 | } else { |
1026 | 1026 | $url = '/_cat/transforms'; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Cat extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Cat extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Shows information about currently configured aliases to indices including filter and routing infos. |
30 | 29 | * |
@@ -25,1061 +25,1061 @@ |
||
25 | 25 | */ |
26 | 26 | class Cat extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Shows information about currently configured aliases to indices including filter and routing infos. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: list, // A comma-separated list of alias names to return |
|
35 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
36 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
37 | - * h: list, // Comma-separated list of column names to display |
|
38 | - * help: boolean, // Return help information |
|
39 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
40 | - * v: boolean, // Verbose mode. Display column headers |
|
41 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
42 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
43 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
44 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
45 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
46 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
47 | - * } $params |
|
48 | - * |
|
49 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
50 | - * @throws ClientResponseException if the status code of response is 4xx |
|
51 | - * @throws ServerResponseException if the status code of response is 5xx |
|
52 | - * |
|
53 | - * @return Elasticsearch|Promise |
|
54 | - */ |
|
55 | - public function aliases(array $params = []) |
|
56 | - { |
|
57 | - if (isset($params['name'])) { |
|
58 | - $url = '/_cat/aliases/' . $this->encode($params['name']); |
|
59 | - $method = 'GET'; |
|
60 | - } else { |
|
61 | - $url = '/_cat/aliases'; |
|
62 | - $method = 'GET'; |
|
63 | - } |
|
64 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
65 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
66 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
67 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.aliases'); |
|
68 | - return $this->client->sendRequest($request); |
|
69 | - } |
|
70 | - /** |
|
71 | - * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. |
|
72 | - * |
|
73 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html |
|
74 | - * |
|
75 | - * @param array{ |
|
76 | - * node_id: list, // A comma-separated list of node IDs or names to limit the returned information |
|
77 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
78 | - * bytes: enum, // The unit in which to display byte values |
|
79 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
80 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
81 | - * h: list, // Comma-separated list of column names to display |
|
82 | - * help: boolean, // Return help information |
|
83 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
84 | - * v: boolean, // Verbose mode. Display column headers |
|
85 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
86 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
87 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
88 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
89 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
90 | - * } $params |
|
91 | - * |
|
92 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
93 | - * @throws ClientResponseException if the status code of response is 4xx |
|
94 | - * @throws ServerResponseException if the status code of response is 5xx |
|
95 | - * |
|
96 | - * @return Elasticsearch|Promise |
|
97 | - */ |
|
98 | - public function allocation(array $params = []) |
|
99 | - { |
|
100 | - if (isset($params['node_id'])) { |
|
101 | - $url = '/_cat/allocation/' . $this->encode($params['node_id']); |
|
102 | - $method = 'GET'; |
|
103 | - } else { |
|
104 | - $url = '/_cat/allocation'; |
|
105 | - $method = 'GET'; |
|
106 | - } |
|
107 | - $url = $this->addQueryString($url, $params, ['format', 'bytes', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
108 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
109 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
110 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'cat.allocation'); |
|
111 | - return $this->client->sendRequest($request); |
|
112 | - } |
|
113 | - /** |
|
114 | - * Returns information about existing component_templates templates. |
|
115 | - * |
|
116 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html |
|
117 | - * |
|
118 | - * @param array{ |
|
119 | - * name: string, // A pattern that returned component template names must match |
|
120 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
121 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
122 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
123 | - * h: list, // Comma-separated list of column names to display |
|
124 | - * help: boolean, // Return help information |
|
125 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
126 | - * v: boolean, // Verbose mode. Display column headers |
|
127 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
128 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
129 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
130 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
131 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
132 | - * } $params |
|
133 | - * |
|
134 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
135 | - * @throws ClientResponseException if the status code of response is 4xx |
|
136 | - * @throws ServerResponseException if the status code of response is 5xx |
|
137 | - * |
|
138 | - * @return Elasticsearch|Promise |
|
139 | - */ |
|
140 | - public function componentTemplates(array $params = []) |
|
141 | - { |
|
142 | - if (isset($params['name'])) { |
|
143 | - $url = '/_cat/component_templates/' . $this->encode($params['name']); |
|
144 | - $method = 'GET'; |
|
145 | - } else { |
|
146 | - $url = '/_cat/component_templates'; |
|
147 | - $method = 'GET'; |
|
148 | - } |
|
149 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
151 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
152 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.component_templates'); |
|
153 | - return $this->client->sendRequest($request); |
|
154 | - } |
|
155 | - /** |
|
156 | - * Provides quick access to the document count of the entire cluster, or individual indices. |
|
157 | - * |
|
158 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html |
|
159 | - * |
|
160 | - * @param array{ |
|
161 | - * index: list, // A comma-separated list of index names to limit the returned information |
|
162 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
163 | - * h: list, // Comma-separated list of column names to display |
|
164 | - * help: boolean, // Return help information |
|
165 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
166 | - * v: boolean, // Verbose mode. Display column headers |
|
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 | - * } $params |
|
173 | - * |
|
174 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
175 | - * @throws ClientResponseException if the status code of response is 4xx |
|
176 | - * @throws ServerResponseException if the status code of response is 5xx |
|
177 | - * |
|
178 | - * @return Elasticsearch|Promise |
|
179 | - */ |
|
180 | - public function count(array $params = []) |
|
181 | - { |
|
182 | - if (isset($params['index'])) { |
|
183 | - $url = '/_cat/count/' . $this->encode($params['index']); |
|
184 | - $method = 'GET'; |
|
185 | - } else { |
|
186 | - $url = '/_cat/count'; |
|
187 | - $method = 'GET'; |
|
188 | - } |
|
189 | - $url = $this->addQueryString($url, $params, ['format', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
191 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.count'); |
|
193 | - return $this->client->sendRequest($request); |
|
194 | - } |
|
195 | - /** |
|
196 | - * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. |
|
197 | - * |
|
198 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html |
|
199 | - * |
|
200 | - * @param array{ |
|
201 | - * fields: list, // A comma-separated list of fields to return the fielddata size |
|
202 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
203 | - * bytes: enum, // The unit in which to display byte values |
|
204 | - * h: list, // Comma-separated list of column names to display |
|
205 | - * help: boolean, // Return help information |
|
206 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
207 | - * v: boolean, // Verbose mode. Display column headers |
|
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 fielddata(array $params = []) |
|
222 | - { |
|
223 | - if (isset($params['fields'])) { |
|
224 | - $url = '/_cat/fielddata/' . $this->encode($params['fields']); |
|
225 | - $method = 'GET'; |
|
226 | - } else { |
|
227 | - $url = '/_cat/fielddata'; |
|
228 | - $method = 'GET'; |
|
229 | - } |
|
230 | - $url = $this->addQueryString($url, $params, ['format', 'bytes', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
231 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
232 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
233 | - $request = $this->addOtelAttributes($params, ['fields'], $request, 'cat.fielddata'); |
|
234 | - return $this->client->sendRequest($request); |
|
235 | - } |
|
236 | - /** |
|
237 | - * Returns a concise representation of the cluster health. |
|
238 | - * |
|
239 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html |
|
240 | - * |
|
241 | - * @param array{ |
|
242 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
243 | - * h: list, // Comma-separated list of column names to display |
|
244 | - * help: boolean, // Return help information |
|
245 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
246 | - * time: enum, // The unit in which to display time values |
|
247 | - * ts: boolean, // Set to false to disable timestamping |
|
248 | - * v: boolean, // Verbose mode. Display column headers |
|
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 | - $url = '/_cat/health'; |
|
265 | - $method = 'GET'; |
|
266 | - $url = $this->addQueryString($url, $params, ['format', 'h', 'help', 's', 'time', 'ts', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
267 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
268 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
269 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.health'); |
|
270 | - return $this->client->sendRequest($request); |
|
271 | - } |
|
272 | - /** |
|
273 | - * Returns help for the Cat APIs. |
|
274 | - * |
|
275 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html |
|
276 | - * |
|
277 | - * @param array{ |
|
278 | - * help: boolean, // Return help information |
|
279 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
280 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
281 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
282 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
283 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
284 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
285 | - * } $params |
|
286 | - * |
|
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 help(array $params = []) |
|
294 | - { |
|
295 | - $url = '/_cat'; |
|
296 | - $method = 'GET'; |
|
297 | - $url = $this->addQueryString($url, $params, ['help', 's', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
298 | - $headers = ['Accept' => 'text/plain']; |
|
299 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
300 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.help'); |
|
301 | - return $this->client->sendRequest($request); |
|
302 | - } |
|
303 | - /** |
|
304 | - * Returns information about indices: number of primaries and replicas, document counts, disk size, ... |
|
305 | - * |
|
306 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html |
|
307 | - * |
|
308 | - * @param array{ |
|
309 | - * index: list, // A comma-separated list of index names to limit the returned information |
|
310 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
311 | - * bytes: enum, // The unit in which to display byte values |
|
312 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
313 | - * h: list, // Comma-separated list of column names to display |
|
314 | - * health: enum, // A health status ("green", "yellow", or "red" to filter only indices matching the specified health status |
|
315 | - * help: boolean, // Return help information |
|
316 | - * pri: boolean, // Set to true to return stats only for primary shards |
|
317 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
318 | - * time: enum, // The unit in which to display time values |
|
319 | - * v: boolean, // Verbose mode. Display column headers |
|
320 | - * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
321 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
322 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
323 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
324 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
325 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
326 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
327 | - * } $params |
|
328 | - * |
|
329 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
330 | - * @throws ClientResponseException if the status code of response is 4xx |
|
331 | - * @throws ServerResponseException if the status code of response is 5xx |
|
332 | - * |
|
333 | - * @return Elasticsearch|Promise |
|
334 | - */ |
|
335 | - public function indices(array $params = []) |
|
336 | - { |
|
337 | - if (isset($params['index'])) { |
|
338 | - $url = '/_cat/indices/' . $this->encode($params['index']); |
|
339 | - $method = 'GET'; |
|
340 | - } else { |
|
341 | - $url = '/_cat/indices'; |
|
342 | - $method = 'GET'; |
|
343 | - } |
|
344 | - $url = $this->addQueryString($url, $params, ['format', 'bytes', 'master_timeout', 'h', 'health', 'help', 'pri', 's', 'time', 'v', 'include_unloaded_segments', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
345 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
346 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
347 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.indices'); |
|
348 | - return $this->client->sendRequest($request); |
|
349 | - } |
|
350 | - /** |
|
351 | - * Returns information about the master node. |
|
352 | - * |
|
353 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html |
|
354 | - * |
|
355 | - * @param array{ |
|
356 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
357 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
358 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
359 | - * h: list, // Comma-separated list of column names to display |
|
360 | - * help: boolean, // Return help information |
|
361 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
362 | - * v: boolean, // Verbose mode. Display column headers |
|
363 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
364 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
365 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
366 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
367 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
368 | - * } $params |
|
369 | - * |
|
370 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
371 | - * @throws ClientResponseException if the status code of response is 4xx |
|
372 | - * @throws ServerResponseException if the status code of response is 5xx |
|
373 | - * |
|
374 | - * @return Elasticsearch|Promise |
|
375 | - */ |
|
376 | - public function master(array $params = []) |
|
377 | - { |
|
378 | - $url = '/_cat/master'; |
|
379 | - $method = 'GET'; |
|
380 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
381 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
382 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
383 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.master'); |
|
384 | - return $this->client->sendRequest($request); |
|
385 | - } |
|
386 | - /** |
|
387 | - * Gets configuration and usage information about data frame analytics jobs. |
|
388 | - * |
|
389 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html |
|
390 | - * |
|
391 | - * @param array{ |
|
392 | - * id: string, // The ID of the data frame analytics to fetch |
|
393 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) |
|
394 | - * bytes: enum, // The unit in which to display byte values |
|
395 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
396 | - * h: list, // Comma-separated list of column names to display |
|
397 | - * help: boolean, // Return help information |
|
398 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
399 | - * time: enum, // The unit in which to display time values |
|
400 | - * v: boolean, // Verbose mode. Display column headers |
|
401 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
402 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
403 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
404 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
405 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
406 | - * } $params |
|
407 | - * |
|
408 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
409 | - * @throws ClientResponseException if the status code of response is 4xx |
|
410 | - * @throws ServerResponseException if the status code of response is 5xx |
|
411 | - * |
|
412 | - * @return Elasticsearch|Promise |
|
413 | - */ |
|
414 | - public function mlDataFrameAnalytics(array $params = []) |
|
415 | - { |
|
416 | - if (isset($params['id'])) { |
|
417 | - $url = '/_cat/ml/data_frame/analytics/' . $this->encode($params['id']); |
|
418 | - $method = 'GET'; |
|
419 | - } else { |
|
420 | - $url = '/_cat/ml/data_frame/analytics'; |
|
421 | - $method = 'GET'; |
|
422 | - } |
|
423 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
424 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
425 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
426 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'cat.ml_data_frame_analytics'); |
|
427 | - return $this->client->sendRequest($request); |
|
428 | - } |
|
429 | - /** |
|
430 | - * Gets configuration and usage information about datafeeds. |
|
431 | - * |
|
432 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html |
|
433 | - * |
|
434 | - * @param array{ |
|
435 | - * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
436 | - * 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) |
|
437 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
438 | - * h: list, // Comma-separated list of column names to display |
|
439 | - * help: boolean, // Return help information |
|
440 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
441 | - * time: enum, // The unit in which to display time values |
|
442 | - * v: boolean, // Verbose mode. Display column headers |
|
443 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
444 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
445 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
446 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
447 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
448 | - * } $params |
|
449 | - * |
|
450 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
451 | - * @throws ClientResponseException if the status code of response is 4xx |
|
452 | - * @throws ServerResponseException if the status code of response is 5xx |
|
453 | - * |
|
454 | - * @return Elasticsearch|Promise |
|
455 | - */ |
|
456 | - public function mlDatafeeds(array $params = []) |
|
457 | - { |
|
458 | - if (isset($params['datafeed_id'])) { |
|
459 | - $url = '/_cat/ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
460 | - $method = 'GET'; |
|
461 | - } else { |
|
462 | - $url = '/_cat/ml/datafeeds'; |
|
463 | - $method = 'GET'; |
|
464 | - } |
|
465 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
466 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
467 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
468 | - $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'cat.ml_datafeeds'); |
|
469 | - return $this->client->sendRequest($request); |
|
470 | - } |
|
471 | - /** |
|
472 | - * Gets configuration and usage information about anomaly detection jobs. |
|
473 | - * |
|
474 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html |
|
475 | - * |
|
476 | - * @param array{ |
|
477 | - * job_id: string, // The ID of the jobs stats to fetch |
|
478 | - * 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) |
|
479 | - * bytes: enum, // The unit in which to display byte values |
|
480 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
481 | - * h: list, // Comma-separated list of column names to display |
|
482 | - * help: boolean, // Return help information |
|
483 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
484 | - * time: enum, // The unit in which to display time values |
|
485 | - * v: boolean, // Verbose mode. Display column headers |
|
486 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
487 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
488 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
489 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
490 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 mlJobs(array $params = []) |
|
500 | - { |
|
501 | - if (isset($params['job_id'])) { |
|
502 | - $url = '/_cat/ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
503 | - $method = 'GET'; |
|
504 | - } else { |
|
505 | - $url = '/_cat/ml/anomaly_detectors'; |
|
506 | - $method = 'GET'; |
|
507 | - } |
|
508 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
509 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
510 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
511 | - $request = $this->addOtelAttributes($params, ['job_id'], $request, 'cat.ml_jobs'); |
|
512 | - return $this->client->sendRequest($request); |
|
513 | - } |
|
514 | - /** |
|
515 | - * Gets configuration and usage information about inference trained models. |
|
516 | - * |
|
517 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html |
|
518 | - * |
|
519 | - * @param array{ |
|
520 | - * model_id: string, // The ID of the trained models stats to fetch |
|
521 | - * 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) |
|
522 | - * from: int, // skips a number of trained models |
|
523 | - * size: int, // specifies a max number of trained models to get |
|
524 | - * bytes: enum, // The unit in which to display byte values |
|
525 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
526 | - * h: list, // Comma-separated list of column names to display |
|
527 | - * help: boolean, // Return help information |
|
528 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
529 | - * time: enum, // The unit in which to display time values |
|
530 | - * v: boolean, // Verbose mode. Display column headers |
|
531 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
532 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
533 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
534 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
535 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
536 | - * } $params |
|
537 | - * |
|
538 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
539 | - * @throws ClientResponseException if the status code of response is 4xx |
|
540 | - * @throws ServerResponseException if the status code of response is 5xx |
|
541 | - * |
|
542 | - * @return Elasticsearch|Promise |
|
543 | - */ |
|
544 | - public function mlTrainedModels(array $params = []) |
|
545 | - { |
|
546 | - if (isset($params['model_id'])) { |
|
547 | - $url = '/_cat/ml/trained_models/' . $this->encode($params['model_id']); |
|
548 | - $method = 'GET'; |
|
549 | - } else { |
|
550 | - $url = '/_cat/ml/trained_models'; |
|
551 | - $method = 'GET'; |
|
552 | - } |
|
553 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
554 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
555 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
556 | - $request = $this->addOtelAttributes($params, ['model_id'], $request, 'cat.ml_trained_models'); |
|
557 | - return $this->client->sendRequest($request); |
|
558 | - } |
|
559 | - /** |
|
560 | - * Returns information about custom node attributes. |
|
561 | - * |
|
562 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html |
|
563 | - * |
|
564 | - * @param array{ |
|
565 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
566 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
567 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
568 | - * h: list, // Comma-separated list of column names to display |
|
569 | - * help: boolean, // Return help information |
|
570 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
571 | - * v: boolean, // Verbose mode. Display column headers |
|
572 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
573 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
574 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
575 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
576 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
577 | - * } $params |
|
578 | - * |
|
579 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
580 | - * @throws ClientResponseException if the status code of response is 4xx |
|
581 | - * @throws ServerResponseException if the status code of response is 5xx |
|
582 | - * |
|
583 | - * @return Elasticsearch|Promise |
|
584 | - */ |
|
585 | - public function nodeattrs(array $params = []) |
|
586 | - { |
|
587 | - $url = '/_cat/nodeattrs'; |
|
588 | - $method = 'GET'; |
|
589 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
590 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
591 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
592 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.nodeattrs'); |
|
593 | - return $this->client->sendRequest($request); |
|
594 | - } |
|
595 | - /** |
|
596 | - * Returns basic statistics about performance of cluster nodes. |
|
597 | - * |
|
598 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html |
|
599 | - * |
|
600 | - * @param array{ |
|
601 | - * bytes: enum, // The unit in which to display byte values |
|
602 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
603 | - * full_id: boolean, // Return the full node ID instead of the shortened version (default: false) |
|
604 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
605 | - * h: list, // Comma-separated list of column names to display |
|
606 | - * help: boolean, // Return help information |
|
607 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
608 | - * time: enum, // The unit in which to display time values |
|
609 | - * v: boolean, // Verbose mode. Display column headers |
|
610 | - * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
611 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
612 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
613 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
614 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
615 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
616 | - * } $params |
|
617 | - * |
|
618 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
619 | - * @throws ClientResponseException if the status code of response is 4xx |
|
620 | - * @throws ServerResponseException if the status code of response is 5xx |
|
621 | - * |
|
622 | - * @return Elasticsearch|Promise |
|
623 | - */ |
|
624 | - public function nodes(array $params = []) |
|
625 | - { |
|
626 | - $url = '/_cat/nodes'; |
|
627 | - $method = 'GET'; |
|
628 | - $url = $this->addQueryString($url, $params, ['bytes', 'format', 'full_id', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'include_unloaded_segments', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
629 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
630 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
631 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.nodes'); |
|
632 | - return $this->client->sendRequest($request); |
|
633 | - } |
|
634 | - /** |
|
635 | - * Returns a concise representation of the cluster pending tasks. |
|
636 | - * |
|
637 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html |
|
638 | - * |
|
639 | - * @param array{ |
|
640 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
641 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
642 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
643 | - * h: list, // Comma-separated list of column names to display |
|
644 | - * help: boolean, // Return help information |
|
645 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
646 | - * time: enum, // The unit in which to display time values |
|
647 | - * v: boolean, // Verbose mode. Display column headers |
|
648 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
649 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
650 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
651 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
652 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
653 | - * } $params |
|
654 | - * |
|
655 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
656 | - * @throws ClientResponseException if the status code of response is 4xx |
|
657 | - * @throws ServerResponseException if the status code of response is 5xx |
|
658 | - * |
|
659 | - * @return Elasticsearch|Promise |
|
660 | - */ |
|
661 | - public function pendingTasks(array $params = []) |
|
662 | - { |
|
663 | - $url = '/_cat/pending_tasks'; |
|
664 | - $method = 'GET'; |
|
665 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
666 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
667 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
668 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.pending_tasks'); |
|
669 | - return $this->client->sendRequest($request); |
|
670 | - } |
|
671 | - /** |
|
672 | - * Returns information about installed plugins across nodes node. |
|
673 | - * |
|
674 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html |
|
675 | - * |
|
676 | - * @param array{ |
|
677 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
678 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
679 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
680 | - * h: list, // Comma-separated list of column names to display |
|
681 | - * help: boolean, // Return help information |
|
682 | - * include_bootstrap: boolean, // Include bootstrap plugins in the response |
|
683 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
684 | - * v: boolean, // Verbose mode. Display column headers |
|
685 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
686 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
687 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
688 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
689 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
690 | - * } $params |
|
691 | - * |
|
692 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
693 | - * @throws ClientResponseException if the status code of response is 4xx |
|
694 | - * @throws ServerResponseException if the status code of response is 5xx |
|
695 | - * |
|
696 | - * @return Elasticsearch|Promise |
|
697 | - */ |
|
698 | - public function plugins(array $params = []) |
|
699 | - { |
|
700 | - $url = '/_cat/plugins'; |
|
701 | - $method = 'GET'; |
|
702 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 'include_bootstrap', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
703 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
704 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
705 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.plugins'); |
|
706 | - return $this->client->sendRequest($request); |
|
707 | - } |
|
708 | - /** |
|
709 | - * Returns information about index shard recoveries, both on-going completed. |
|
710 | - * |
|
711 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html |
|
712 | - * |
|
713 | - * @param array{ |
|
714 | - * index: list, // Comma-separated list or wildcard expression of index names to limit the returned information |
|
715 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
716 | - * active_only: boolean, // If `true`, the response only includes ongoing shard recoveries |
|
717 | - * bytes: enum, // The unit in which to display byte values |
|
718 | - * detailed: boolean, // If `true`, the response includes detailed information about shard recoveries |
|
719 | - * h: list, // Comma-separated list of column names to display |
|
720 | - * help: boolean, // Return help information |
|
721 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
722 | - * time: enum, // The unit in which to display time values |
|
723 | - * v: boolean, // Verbose mode. Display column headers |
|
724 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
725 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
726 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
727 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
728 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
729 | - * } $params |
|
730 | - * |
|
731 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
732 | - * @throws ClientResponseException if the status code of response is 4xx |
|
733 | - * @throws ServerResponseException if the status code of response is 5xx |
|
734 | - * |
|
735 | - * @return Elasticsearch|Promise |
|
736 | - */ |
|
737 | - public function recovery(array $params = []) |
|
738 | - { |
|
739 | - if (isset($params['index'])) { |
|
740 | - $url = '/_cat/recovery/' . $this->encode($params['index']); |
|
741 | - $method = 'GET'; |
|
742 | - } else { |
|
743 | - $url = '/_cat/recovery'; |
|
744 | - $method = 'GET'; |
|
745 | - } |
|
746 | - $url = $this->addQueryString($url, $params, ['format', 'active_only', 'bytes', 'detailed', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
747 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
748 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
749 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.recovery'); |
|
750 | - return $this->client->sendRequest($request); |
|
751 | - } |
|
752 | - /** |
|
753 | - * Returns information about snapshot repositories registered in the cluster. |
|
754 | - * |
|
755 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html |
|
756 | - * |
|
757 | - * @param array{ |
|
758 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
759 | - * local: boolean, // Return local information, do not retrieve the state from master node |
|
760 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
761 | - * h: list, // Comma-separated list of column names to display |
|
762 | - * help: boolean, // Return help information |
|
763 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
764 | - * v: boolean, // Verbose mode. Display column headers |
|
765 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
766 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
767 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
768 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
769 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
770 | - * } $params |
|
771 | - * |
|
772 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
773 | - * @throws ClientResponseException if the status code of response is 4xx |
|
774 | - * @throws ServerResponseException if the status code of response is 5xx |
|
775 | - * |
|
776 | - * @return Elasticsearch|Promise |
|
777 | - */ |
|
778 | - public function repositories(array $params = []) |
|
779 | - { |
|
780 | - $url = '/_cat/repositories'; |
|
781 | - $method = 'GET'; |
|
782 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
783 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
784 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
785 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.repositories'); |
|
786 | - return $this->client->sendRequest($request); |
|
787 | - } |
|
788 | - /** |
|
789 | - * Provides low-level information about the segments in the shards of an index. |
|
790 | - * |
|
791 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html |
|
792 | - * |
|
793 | - * @param array{ |
|
794 | - * index: list, // A comma-separated list of index names to limit the returned information |
|
795 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
796 | - * bytes: enum, // The unit in which to display byte values |
|
797 | - * h: list, // Comma-separated list of column names to display |
|
798 | - * help: boolean, // Return help information |
|
799 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
800 | - * v: boolean, // Verbose mode. Display column headers |
|
801 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
802 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
803 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
804 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
805 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
806 | - * } $params |
|
807 | - * |
|
808 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
809 | - * @throws ClientResponseException if the status code of response is 4xx |
|
810 | - * @throws ServerResponseException if the status code of response is 5xx |
|
811 | - * |
|
812 | - * @return Elasticsearch|Promise |
|
813 | - */ |
|
814 | - public function segments(array $params = []) |
|
815 | - { |
|
816 | - if (isset($params['index'])) { |
|
817 | - $url = '/_cat/segments/' . $this->encode($params['index']); |
|
818 | - $method = 'GET'; |
|
819 | - } else { |
|
820 | - $url = '/_cat/segments'; |
|
821 | - $method = 'GET'; |
|
822 | - } |
|
823 | - $url = $this->addQueryString($url, $params, ['format', 'bytes', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
824 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
825 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
826 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.segments'); |
|
827 | - return $this->client->sendRequest($request); |
|
828 | - } |
|
829 | - /** |
|
830 | - * Provides a detailed view of shard allocation on nodes. |
|
831 | - * |
|
832 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html |
|
833 | - * |
|
834 | - * @param array{ |
|
835 | - * index: list, // A comma-separated list of index names to limit the returned information |
|
836 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
837 | - * bytes: enum, // The unit in which to display byte values |
|
838 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
839 | - * h: list, // Comma-separated list of column names to display |
|
840 | - * help: boolean, // Return help information |
|
841 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
842 | - * time: enum, // The unit in which to display time values |
|
843 | - * v: boolean, // Verbose mode. Display column headers |
|
844 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
845 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
846 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
847 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
848 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
849 | - * } $params |
|
850 | - * |
|
851 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
852 | - * @throws ClientResponseException if the status code of response is 4xx |
|
853 | - * @throws ServerResponseException if the status code of response is 5xx |
|
854 | - * |
|
855 | - * @return Elasticsearch|Promise |
|
856 | - */ |
|
857 | - public function shards(array $params = []) |
|
858 | - { |
|
859 | - if (isset($params['index'])) { |
|
860 | - $url = '/_cat/shards/' . $this->encode($params['index']); |
|
861 | - $method = 'GET'; |
|
862 | - } else { |
|
863 | - $url = '/_cat/shards'; |
|
864 | - $method = 'GET'; |
|
865 | - } |
|
866 | - $url = $this->addQueryString($url, $params, ['format', 'bytes', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
867 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
868 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
869 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.shards'); |
|
870 | - return $this->client->sendRequest($request); |
|
871 | - } |
|
872 | - /** |
|
873 | - * Returns all snapshots in a specific repository. |
|
874 | - * |
|
875 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html |
|
876 | - * |
|
877 | - * @param array{ |
|
878 | - * repository: list, // Name of repository from which to fetch the snapshot information |
|
879 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
880 | - * ignore_unavailable: boolean, // Set to true to ignore unavailable snapshots |
|
881 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
882 | - * h: list, // Comma-separated list of column names to display |
|
883 | - * help: boolean, // Return help information |
|
884 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
885 | - * time: enum, // The unit in which to display time values |
|
886 | - * v: boolean, // Verbose mode. Display column headers |
|
887 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
888 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
889 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
890 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
891 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
892 | - * } $params |
|
893 | - * |
|
894 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
895 | - * @throws ClientResponseException if the status code of response is 4xx |
|
896 | - * @throws ServerResponseException if the status code of response is 5xx |
|
897 | - * |
|
898 | - * @return Elasticsearch|Promise |
|
899 | - */ |
|
900 | - public function snapshots(array $params = []) |
|
901 | - { |
|
902 | - if (isset($params['repository'])) { |
|
903 | - $url = '/_cat/snapshots/' . $this->encode($params['repository']); |
|
904 | - $method = 'GET'; |
|
905 | - } else { |
|
906 | - $url = '/_cat/snapshots'; |
|
907 | - $method = 'GET'; |
|
908 | - } |
|
909 | - $url = $this->addQueryString($url, $params, ['format', 'ignore_unavailable', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
910 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
911 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
912 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'cat.snapshots'); |
|
913 | - return $this->client->sendRequest($request); |
|
914 | - } |
|
915 | - /** |
|
916 | - * Returns information about the tasks currently executing on one or more nodes in the cluster. |
|
917 | - * |
|
918 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
919 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
920 | - * |
|
921 | - * @param array{ |
|
922 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
923 | - * nodes: 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 |
|
924 | - * actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all. |
|
925 | - * detailed: boolean, // Return detailed task information (default: false) |
|
926 | - * parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. |
|
927 | - * h: list, // Comma-separated list of column names to display |
|
928 | - * help: boolean, // Return help information |
|
929 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
930 | - * time: enum, // The unit in which to display time values |
|
931 | - * v: boolean, // Verbose mode. Display column headers |
|
932 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
933 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
934 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
935 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
936 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
937 | - * } $params |
|
938 | - * |
|
939 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
940 | - * @throws ClientResponseException if the status code of response is 4xx |
|
941 | - * @throws ServerResponseException if the status code of response is 5xx |
|
942 | - * |
|
943 | - * @return Elasticsearch|Promise |
|
944 | - */ |
|
945 | - public function tasks(array $params = []) |
|
946 | - { |
|
947 | - $url = '/_cat/tasks'; |
|
948 | - $method = 'GET'; |
|
949 | - $url = $this->addQueryString($url, $params, ['format', 'nodes', 'actions', 'detailed', 'parent_task_id', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
950 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
951 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
952 | - $request = $this->addOtelAttributes($params, [], $request, 'cat.tasks'); |
|
953 | - return $this->client->sendRequest($request); |
|
954 | - } |
|
955 | - /** |
|
956 | - * Returns information about existing templates. |
|
957 | - * |
|
958 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html |
|
959 | - * |
|
960 | - * @param array{ |
|
961 | - * name: string, // A pattern that returned template names must match |
|
962 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
963 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
964 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
965 | - * h: list, // Comma-separated list of column names to display |
|
966 | - * help: boolean, // Return help information |
|
967 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
968 | - * v: boolean, // Verbose mode. Display column headers |
|
969 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
970 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
971 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
972 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
973 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
974 | - * } $params |
|
975 | - * |
|
976 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
977 | - * @throws ClientResponseException if the status code of response is 4xx |
|
978 | - * @throws ServerResponseException if the status code of response is 5xx |
|
979 | - * |
|
980 | - * @return Elasticsearch|Promise |
|
981 | - */ |
|
982 | - public function templates(array $params = []) |
|
983 | - { |
|
984 | - if (isset($params['name'])) { |
|
985 | - $url = '/_cat/templates/' . $this->encode($params['name']); |
|
986 | - $method = 'GET'; |
|
987 | - } else { |
|
988 | - $url = '/_cat/templates'; |
|
989 | - $method = 'GET'; |
|
990 | - } |
|
991 | - $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
992 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
993 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
994 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.templates'); |
|
995 | - return $this->client->sendRequest($request); |
|
996 | - } |
|
997 | - /** |
|
998 | - * Returns cluster-wide thread pool statistics per node. |
|
999 | - * By default the active, queue and rejected statistics are returned for all thread pools. |
|
1000 | - * |
|
1001 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html |
|
1002 | - * |
|
1003 | - * @param array{ |
|
1004 | - * thread_pool_patterns: list, // A comma-separated list of regular-expressions to filter the thread pools in the output |
|
1005 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
1006 | - * time: enum, // The unit in which to display time values |
|
1007 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
1008 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
1009 | - * h: list, // Comma-separated list of column names to display |
|
1010 | - * help: boolean, // Return help information |
|
1011 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
1012 | - * v: boolean, // Verbose mode. Display column headers |
|
1013 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1014 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1015 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1016 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1017 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1018 | - * } $params |
|
1019 | - * |
|
1020 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1021 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1022 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1023 | - * |
|
1024 | - * @return Elasticsearch|Promise |
|
1025 | - */ |
|
1026 | - public function threadPool(array $params = []) |
|
1027 | - { |
|
1028 | - if (isset($params['thread_pool_patterns'])) { |
|
1029 | - $url = '/_cat/thread_pool/' . $this->encode($params['thread_pool_patterns']); |
|
1030 | - $method = 'GET'; |
|
1031 | - } else { |
|
1032 | - $url = '/_cat/thread_pool'; |
|
1033 | - $method = 'GET'; |
|
1034 | - } |
|
1035 | - $url = $this->addQueryString($url, $params, ['format', 'time', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1036 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
1037 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1038 | - $request = $this->addOtelAttributes($params, ['thread_pool_patterns'], $request, 'cat.thread_pool'); |
|
1039 | - return $this->client->sendRequest($request); |
|
1040 | - } |
|
1041 | - /** |
|
1042 | - * Gets configuration and usage information about transforms. |
|
1043 | - * |
|
1044 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html |
|
1045 | - * |
|
1046 | - * @param array{ |
|
1047 | - * transform_id: string, // The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
1048 | - * from: int, // skips a number of transform configs, defaults to 0 |
|
1049 | - * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
1050 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
1051 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
1052 | - * h: list, // Comma-separated list of column names to display |
|
1053 | - * help: boolean, // Return help information |
|
1054 | - * s: list, // Comma-separated list of column names or column aliases to sort by |
|
1055 | - * time: enum, // The unit in which to display time values |
|
1056 | - * v: boolean, // Verbose mode. Display column headers |
|
1057 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1058 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1059 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1060 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1061 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1062 | - * } $params |
|
1063 | - * |
|
1064 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1065 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1066 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1067 | - * |
|
1068 | - * @return Elasticsearch|Promise |
|
1069 | - */ |
|
1070 | - public function transforms(array $params = []) |
|
1071 | - { |
|
1072 | - if (isset($params['transform_id'])) { |
|
1073 | - $url = '/_cat/transforms/' . $this->encode($params['transform_id']); |
|
1074 | - $method = 'GET'; |
|
1075 | - } else { |
|
1076 | - $url = '/_cat/transforms'; |
|
1077 | - $method = 'GET'; |
|
1078 | - } |
|
1079 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1080 | - $headers = ['Accept' => 'text/plain,application/json']; |
|
1081 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1082 | - $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'cat.transforms'); |
|
1083 | - return $this->client->sendRequest($request); |
|
1084 | - } |
|
28 | + /** |
|
29 | + * Shows information about currently configured aliases to indices including filter and routing infos. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: list, // A comma-separated list of alias names to return |
|
35 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
36 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
37 | + * h: list, // Comma-separated list of column names to display |
|
38 | + * help: boolean, // Return help information |
|
39 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
40 | + * v: boolean, // Verbose mode. Display column headers |
|
41 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
42 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
43 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
44 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
45 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
46 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
47 | + * } $params |
|
48 | + * |
|
49 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
50 | + * @throws ClientResponseException if the status code of response is 4xx |
|
51 | + * @throws ServerResponseException if the status code of response is 5xx |
|
52 | + * |
|
53 | + * @return Elasticsearch|Promise |
|
54 | + */ |
|
55 | + public function aliases(array $params = []) |
|
56 | + { |
|
57 | + if (isset($params['name'])) { |
|
58 | + $url = '/_cat/aliases/' . $this->encode($params['name']); |
|
59 | + $method = 'GET'; |
|
60 | + } else { |
|
61 | + $url = '/_cat/aliases'; |
|
62 | + $method = 'GET'; |
|
63 | + } |
|
64 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
65 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
66 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
67 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.aliases'); |
|
68 | + return $this->client->sendRequest($request); |
|
69 | + } |
|
70 | + /** |
|
71 | + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. |
|
72 | + * |
|
73 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html |
|
74 | + * |
|
75 | + * @param array{ |
|
76 | + * node_id: list, // A comma-separated list of node IDs or names to limit the returned information |
|
77 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
78 | + * bytes: enum, // The unit in which to display byte values |
|
79 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
80 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
81 | + * h: list, // Comma-separated list of column names to display |
|
82 | + * help: boolean, // Return help information |
|
83 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
84 | + * v: boolean, // Verbose mode. Display column headers |
|
85 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
86 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
87 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
88 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
89 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
90 | + * } $params |
|
91 | + * |
|
92 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
93 | + * @throws ClientResponseException if the status code of response is 4xx |
|
94 | + * @throws ServerResponseException if the status code of response is 5xx |
|
95 | + * |
|
96 | + * @return Elasticsearch|Promise |
|
97 | + */ |
|
98 | + public function allocation(array $params = []) |
|
99 | + { |
|
100 | + if (isset($params['node_id'])) { |
|
101 | + $url = '/_cat/allocation/' . $this->encode($params['node_id']); |
|
102 | + $method = 'GET'; |
|
103 | + } else { |
|
104 | + $url = '/_cat/allocation'; |
|
105 | + $method = 'GET'; |
|
106 | + } |
|
107 | + $url = $this->addQueryString($url, $params, ['format', 'bytes', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
108 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
109 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
110 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'cat.allocation'); |
|
111 | + return $this->client->sendRequest($request); |
|
112 | + } |
|
113 | + /** |
|
114 | + * Returns information about existing component_templates templates. |
|
115 | + * |
|
116 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html |
|
117 | + * |
|
118 | + * @param array{ |
|
119 | + * name: string, // A pattern that returned component template names must match |
|
120 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
121 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
122 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
123 | + * h: list, // Comma-separated list of column names to display |
|
124 | + * help: boolean, // Return help information |
|
125 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
126 | + * v: boolean, // Verbose mode. Display column headers |
|
127 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
128 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
129 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
130 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
131 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
132 | + * } $params |
|
133 | + * |
|
134 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
135 | + * @throws ClientResponseException if the status code of response is 4xx |
|
136 | + * @throws ServerResponseException if the status code of response is 5xx |
|
137 | + * |
|
138 | + * @return Elasticsearch|Promise |
|
139 | + */ |
|
140 | + public function componentTemplates(array $params = []) |
|
141 | + { |
|
142 | + if (isset($params['name'])) { |
|
143 | + $url = '/_cat/component_templates/' . $this->encode($params['name']); |
|
144 | + $method = 'GET'; |
|
145 | + } else { |
|
146 | + $url = '/_cat/component_templates'; |
|
147 | + $method = 'GET'; |
|
148 | + } |
|
149 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
151 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
152 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.component_templates'); |
|
153 | + return $this->client->sendRequest($request); |
|
154 | + } |
|
155 | + /** |
|
156 | + * Provides quick access to the document count of the entire cluster, or individual indices. |
|
157 | + * |
|
158 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html |
|
159 | + * |
|
160 | + * @param array{ |
|
161 | + * index: list, // A comma-separated list of index names to limit the returned information |
|
162 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
163 | + * h: list, // Comma-separated list of column names to display |
|
164 | + * help: boolean, // Return help information |
|
165 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
166 | + * v: boolean, // Verbose mode. Display column headers |
|
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 | + * } $params |
|
173 | + * |
|
174 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
175 | + * @throws ClientResponseException if the status code of response is 4xx |
|
176 | + * @throws ServerResponseException if the status code of response is 5xx |
|
177 | + * |
|
178 | + * @return Elasticsearch|Promise |
|
179 | + */ |
|
180 | + public function count(array $params = []) |
|
181 | + { |
|
182 | + if (isset($params['index'])) { |
|
183 | + $url = '/_cat/count/' . $this->encode($params['index']); |
|
184 | + $method = 'GET'; |
|
185 | + } else { |
|
186 | + $url = '/_cat/count'; |
|
187 | + $method = 'GET'; |
|
188 | + } |
|
189 | + $url = $this->addQueryString($url, $params, ['format', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
191 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.count'); |
|
193 | + return $this->client->sendRequest($request); |
|
194 | + } |
|
195 | + /** |
|
196 | + * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. |
|
197 | + * |
|
198 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html |
|
199 | + * |
|
200 | + * @param array{ |
|
201 | + * fields: list, // A comma-separated list of fields to return the fielddata size |
|
202 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
203 | + * bytes: enum, // The unit in which to display byte values |
|
204 | + * h: list, // Comma-separated list of column names to display |
|
205 | + * help: boolean, // Return help information |
|
206 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
207 | + * v: boolean, // Verbose mode. Display column headers |
|
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 fielddata(array $params = []) |
|
222 | + { |
|
223 | + if (isset($params['fields'])) { |
|
224 | + $url = '/_cat/fielddata/' . $this->encode($params['fields']); |
|
225 | + $method = 'GET'; |
|
226 | + } else { |
|
227 | + $url = '/_cat/fielddata'; |
|
228 | + $method = 'GET'; |
|
229 | + } |
|
230 | + $url = $this->addQueryString($url, $params, ['format', 'bytes', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
231 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
232 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
233 | + $request = $this->addOtelAttributes($params, ['fields'], $request, 'cat.fielddata'); |
|
234 | + return $this->client->sendRequest($request); |
|
235 | + } |
|
236 | + /** |
|
237 | + * Returns a concise representation of the cluster health. |
|
238 | + * |
|
239 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html |
|
240 | + * |
|
241 | + * @param array{ |
|
242 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
243 | + * h: list, // Comma-separated list of column names to display |
|
244 | + * help: boolean, // Return help information |
|
245 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
246 | + * time: enum, // The unit in which to display time values |
|
247 | + * ts: boolean, // Set to false to disable timestamping |
|
248 | + * v: boolean, // Verbose mode. Display column headers |
|
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 | + $url = '/_cat/health'; |
|
265 | + $method = 'GET'; |
|
266 | + $url = $this->addQueryString($url, $params, ['format', 'h', 'help', 's', 'time', 'ts', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
267 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
268 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
269 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.health'); |
|
270 | + return $this->client->sendRequest($request); |
|
271 | + } |
|
272 | + /** |
|
273 | + * Returns help for the Cat APIs. |
|
274 | + * |
|
275 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html |
|
276 | + * |
|
277 | + * @param array{ |
|
278 | + * help: boolean, // Return help information |
|
279 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
280 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
281 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
282 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
283 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
284 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
285 | + * } $params |
|
286 | + * |
|
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 help(array $params = []) |
|
294 | + { |
|
295 | + $url = '/_cat'; |
|
296 | + $method = 'GET'; |
|
297 | + $url = $this->addQueryString($url, $params, ['help', 's', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
298 | + $headers = ['Accept' => 'text/plain']; |
|
299 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
300 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.help'); |
|
301 | + return $this->client->sendRequest($request); |
|
302 | + } |
|
303 | + /** |
|
304 | + * Returns information about indices: number of primaries and replicas, document counts, disk size, ... |
|
305 | + * |
|
306 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html |
|
307 | + * |
|
308 | + * @param array{ |
|
309 | + * index: list, // A comma-separated list of index names to limit the returned information |
|
310 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
311 | + * bytes: enum, // The unit in which to display byte values |
|
312 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
313 | + * h: list, // Comma-separated list of column names to display |
|
314 | + * health: enum, // A health status ("green", "yellow", or "red" to filter only indices matching the specified health status |
|
315 | + * help: boolean, // Return help information |
|
316 | + * pri: boolean, // Set to true to return stats only for primary shards |
|
317 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
318 | + * time: enum, // The unit in which to display time values |
|
319 | + * v: boolean, // Verbose mode. Display column headers |
|
320 | + * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
321 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
322 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
323 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
324 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
325 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
326 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
327 | + * } $params |
|
328 | + * |
|
329 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
330 | + * @throws ClientResponseException if the status code of response is 4xx |
|
331 | + * @throws ServerResponseException if the status code of response is 5xx |
|
332 | + * |
|
333 | + * @return Elasticsearch|Promise |
|
334 | + */ |
|
335 | + public function indices(array $params = []) |
|
336 | + { |
|
337 | + if (isset($params['index'])) { |
|
338 | + $url = '/_cat/indices/' . $this->encode($params['index']); |
|
339 | + $method = 'GET'; |
|
340 | + } else { |
|
341 | + $url = '/_cat/indices'; |
|
342 | + $method = 'GET'; |
|
343 | + } |
|
344 | + $url = $this->addQueryString($url, $params, ['format', 'bytes', 'master_timeout', 'h', 'health', 'help', 'pri', 's', 'time', 'v', 'include_unloaded_segments', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
345 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
346 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
347 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.indices'); |
|
348 | + return $this->client->sendRequest($request); |
|
349 | + } |
|
350 | + /** |
|
351 | + * Returns information about the master node. |
|
352 | + * |
|
353 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html |
|
354 | + * |
|
355 | + * @param array{ |
|
356 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
357 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
358 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
359 | + * h: list, // Comma-separated list of column names to display |
|
360 | + * help: boolean, // Return help information |
|
361 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
362 | + * v: boolean, // Verbose mode. Display column headers |
|
363 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
364 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
365 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
366 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
367 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
368 | + * } $params |
|
369 | + * |
|
370 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
371 | + * @throws ClientResponseException if the status code of response is 4xx |
|
372 | + * @throws ServerResponseException if the status code of response is 5xx |
|
373 | + * |
|
374 | + * @return Elasticsearch|Promise |
|
375 | + */ |
|
376 | + public function master(array $params = []) |
|
377 | + { |
|
378 | + $url = '/_cat/master'; |
|
379 | + $method = 'GET'; |
|
380 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
381 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
382 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
383 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.master'); |
|
384 | + return $this->client->sendRequest($request); |
|
385 | + } |
|
386 | + /** |
|
387 | + * Gets configuration and usage information about data frame analytics jobs. |
|
388 | + * |
|
389 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html |
|
390 | + * |
|
391 | + * @param array{ |
|
392 | + * id: string, // The ID of the data frame analytics to fetch |
|
393 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) |
|
394 | + * bytes: enum, // The unit in which to display byte values |
|
395 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
396 | + * h: list, // Comma-separated list of column names to display |
|
397 | + * help: boolean, // Return help information |
|
398 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
399 | + * time: enum, // The unit in which to display time values |
|
400 | + * v: boolean, // Verbose mode. Display column headers |
|
401 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
402 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
403 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
404 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
405 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
406 | + * } $params |
|
407 | + * |
|
408 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
409 | + * @throws ClientResponseException if the status code of response is 4xx |
|
410 | + * @throws ServerResponseException if the status code of response is 5xx |
|
411 | + * |
|
412 | + * @return Elasticsearch|Promise |
|
413 | + */ |
|
414 | + public function mlDataFrameAnalytics(array $params = []) |
|
415 | + { |
|
416 | + if (isset($params['id'])) { |
|
417 | + $url = '/_cat/ml/data_frame/analytics/' . $this->encode($params['id']); |
|
418 | + $method = 'GET'; |
|
419 | + } else { |
|
420 | + $url = '/_cat/ml/data_frame/analytics'; |
|
421 | + $method = 'GET'; |
|
422 | + } |
|
423 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
424 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
425 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
426 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'cat.ml_data_frame_analytics'); |
|
427 | + return $this->client->sendRequest($request); |
|
428 | + } |
|
429 | + /** |
|
430 | + * Gets configuration and usage information about datafeeds. |
|
431 | + * |
|
432 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html |
|
433 | + * |
|
434 | + * @param array{ |
|
435 | + * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
436 | + * 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) |
|
437 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
438 | + * h: list, // Comma-separated list of column names to display |
|
439 | + * help: boolean, // Return help information |
|
440 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
441 | + * time: enum, // The unit in which to display time values |
|
442 | + * v: boolean, // Verbose mode. Display column headers |
|
443 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
444 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
445 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
446 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
447 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
448 | + * } $params |
|
449 | + * |
|
450 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
451 | + * @throws ClientResponseException if the status code of response is 4xx |
|
452 | + * @throws ServerResponseException if the status code of response is 5xx |
|
453 | + * |
|
454 | + * @return Elasticsearch|Promise |
|
455 | + */ |
|
456 | + public function mlDatafeeds(array $params = []) |
|
457 | + { |
|
458 | + if (isset($params['datafeed_id'])) { |
|
459 | + $url = '/_cat/ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
460 | + $method = 'GET'; |
|
461 | + } else { |
|
462 | + $url = '/_cat/ml/datafeeds'; |
|
463 | + $method = 'GET'; |
|
464 | + } |
|
465 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
466 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
467 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
468 | + $request = $this->addOtelAttributes($params, ['datafeed_id'], $request, 'cat.ml_datafeeds'); |
|
469 | + return $this->client->sendRequest($request); |
|
470 | + } |
|
471 | + /** |
|
472 | + * Gets configuration and usage information about anomaly detection jobs. |
|
473 | + * |
|
474 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html |
|
475 | + * |
|
476 | + * @param array{ |
|
477 | + * job_id: string, // The ID of the jobs stats to fetch |
|
478 | + * 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) |
|
479 | + * bytes: enum, // The unit in which to display byte values |
|
480 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
481 | + * h: list, // Comma-separated list of column names to display |
|
482 | + * help: boolean, // Return help information |
|
483 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
484 | + * time: enum, // The unit in which to display time values |
|
485 | + * v: boolean, // Verbose mode. Display column headers |
|
486 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
487 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
488 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
489 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
490 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 mlJobs(array $params = []) |
|
500 | + { |
|
501 | + if (isset($params['job_id'])) { |
|
502 | + $url = '/_cat/ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
503 | + $method = 'GET'; |
|
504 | + } else { |
|
505 | + $url = '/_cat/ml/anomaly_detectors'; |
|
506 | + $method = 'GET'; |
|
507 | + } |
|
508 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
509 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
510 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
511 | + $request = $this->addOtelAttributes($params, ['job_id'], $request, 'cat.ml_jobs'); |
|
512 | + return $this->client->sendRequest($request); |
|
513 | + } |
|
514 | + /** |
|
515 | + * Gets configuration and usage information about inference trained models. |
|
516 | + * |
|
517 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html |
|
518 | + * |
|
519 | + * @param array{ |
|
520 | + * model_id: string, // The ID of the trained models stats to fetch |
|
521 | + * 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) |
|
522 | + * from: int, // skips a number of trained models |
|
523 | + * size: int, // specifies a max number of trained models to get |
|
524 | + * bytes: enum, // The unit in which to display byte values |
|
525 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
526 | + * h: list, // Comma-separated list of column names to display |
|
527 | + * help: boolean, // Return help information |
|
528 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
529 | + * time: enum, // The unit in which to display time values |
|
530 | + * v: boolean, // Verbose mode. Display column headers |
|
531 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
532 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
533 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
534 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
535 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
536 | + * } $params |
|
537 | + * |
|
538 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
539 | + * @throws ClientResponseException if the status code of response is 4xx |
|
540 | + * @throws ServerResponseException if the status code of response is 5xx |
|
541 | + * |
|
542 | + * @return Elasticsearch|Promise |
|
543 | + */ |
|
544 | + public function mlTrainedModels(array $params = []) |
|
545 | + { |
|
546 | + if (isset($params['model_id'])) { |
|
547 | + $url = '/_cat/ml/trained_models/' . $this->encode($params['model_id']); |
|
548 | + $method = 'GET'; |
|
549 | + } else { |
|
550 | + $url = '/_cat/ml/trained_models'; |
|
551 | + $method = 'GET'; |
|
552 | + } |
|
553 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'bytes', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
554 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
555 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
556 | + $request = $this->addOtelAttributes($params, ['model_id'], $request, 'cat.ml_trained_models'); |
|
557 | + return $this->client->sendRequest($request); |
|
558 | + } |
|
559 | + /** |
|
560 | + * Returns information about custom node attributes. |
|
561 | + * |
|
562 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html |
|
563 | + * |
|
564 | + * @param array{ |
|
565 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
566 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
567 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
568 | + * h: list, // Comma-separated list of column names to display |
|
569 | + * help: boolean, // Return help information |
|
570 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
571 | + * v: boolean, // Verbose mode. Display column headers |
|
572 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
573 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
574 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
575 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
576 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
577 | + * } $params |
|
578 | + * |
|
579 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
580 | + * @throws ClientResponseException if the status code of response is 4xx |
|
581 | + * @throws ServerResponseException if the status code of response is 5xx |
|
582 | + * |
|
583 | + * @return Elasticsearch|Promise |
|
584 | + */ |
|
585 | + public function nodeattrs(array $params = []) |
|
586 | + { |
|
587 | + $url = '/_cat/nodeattrs'; |
|
588 | + $method = 'GET'; |
|
589 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
590 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
591 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
592 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.nodeattrs'); |
|
593 | + return $this->client->sendRequest($request); |
|
594 | + } |
|
595 | + /** |
|
596 | + * Returns basic statistics about performance of cluster nodes. |
|
597 | + * |
|
598 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html |
|
599 | + * |
|
600 | + * @param array{ |
|
601 | + * bytes: enum, // The unit in which to display byte values |
|
602 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
603 | + * full_id: boolean, // Return the full node ID instead of the shortened version (default: false) |
|
604 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
605 | + * h: list, // Comma-separated list of column names to display |
|
606 | + * help: boolean, // Return help information |
|
607 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
608 | + * time: enum, // The unit in which to display time values |
|
609 | + * v: boolean, // Verbose mode. Display column headers |
|
610 | + * include_unloaded_segments: boolean, // If set to true segment stats will include stats for segments that are not currently loaded into memory |
|
611 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
612 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
613 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
614 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
615 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
616 | + * } $params |
|
617 | + * |
|
618 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
619 | + * @throws ClientResponseException if the status code of response is 4xx |
|
620 | + * @throws ServerResponseException if the status code of response is 5xx |
|
621 | + * |
|
622 | + * @return Elasticsearch|Promise |
|
623 | + */ |
|
624 | + public function nodes(array $params = []) |
|
625 | + { |
|
626 | + $url = '/_cat/nodes'; |
|
627 | + $method = 'GET'; |
|
628 | + $url = $this->addQueryString($url, $params, ['bytes', 'format', 'full_id', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'include_unloaded_segments', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
629 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
630 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
631 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.nodes'); |
|
632 | + return $this->client->sendRequest($request); |
|
633 | + } |
|
634 | + /** |
|
635 | + * Returns a concise representation of the cluster pending tasks. |
|
636 | + * |
|
637 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html |
|
638 | + * |
|
639 | + * @param array{ |
|
640 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
641 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
642 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
643 | + * h: list, // Comma-separated list of column names to display |
|
644 | + * help: boolean, // Return help information |
|
645 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
646 | + * time: enum, // The unit in which to display time values |
|
647 | + * v: boolean, // Verbose mode. Display column headers |
|
648 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
649 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
650 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
651 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
652 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
653 | + * } $params |
|
654 | + * |
|
655 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
656 | + * @throws ClientResponseException if the status code of response is 4xx |
|
657 | + * @throws ServerResponseException if the status code of response is 5xx |
|
658 | + * |
|
659 | + * @return Elasticsearch|Promise |
|
660 | + */ |
|
661 | + public function pendingTasks(array $params = []) |
|
662 | + { |
|
663 | + $url = '/_cat/pending_tasks'; |
|
664 | + $method = 'GET'; |
|
665 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
666 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
667 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
668 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.pending_tasks'); |
|
669 | + return $this->client->sendRequest($request); |
|
670 | + } |
|
671 | + /** |
|
672 | + * Returns information about installed plugins across nodes node. |
|
673 | + * |
|
674 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html |
|
675 | + * |
|
676 | + * @param array{ |
|
677 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
678 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
679 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
680 | + * h: list, // Comma-separated list of column names to display |
|
681 | + * help: boolean, // Return help information |
|
682 | + * include_bootstrap: boolean, // Include bootstrap plugins in the response |
|
683 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
684 | + * v: boolean, // Verbose mode. Display column headers |
|
685 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
686 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
687 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
688 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
689 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
690 | + * } $params |
|
691 | + * |
|
692 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
693 | + * @throws ClientResponseException if the status code of response is 4xx |
|
694 | + * @throws ServerResponseException if the status code of response is 5xx |
|
695 | + * |
|
696 | + * @return Elasticsearch|Promise |
|
697 | + */ |
|
698 | + public function plugins(array $params = []) |
|
699 | + { |
|
700 | + $url = '/_cat/plugins'; |
|
701 | + $method = 'GET'; |
|
702 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 'include_bootstrap', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
703 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
704 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
705 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.plugins'); |
|
706 | + return $this->client->sendRequest($request); |
|
707 | + } |
|
708 | + /** |
|
709 | + * Returns information about index shard recoveries, both on-going completed. |
|
710 | + * |
|
711 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html |
|
712 | + * |
|
713 | + * @param array{ |
|
714 | + * index: list, // Comma-separated list or wildcard expression of index names to limit the returned information |
|
715 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
716 | + * active_only: boolean, // If `true`, the response only includes ongoing shard recoveries |
|
717 | + * bytes: enum, // The unit in which to display byte values |
|
718 | + * detailed: boolean, // If `true`, the response includes detailed information about shard recoveries |
|
719 | + * h: list, // Comma-separated list of column names to display |
|
720 | + * help: boolean, // Return help information |
|
721 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
722 | + * time: enum, // The unit in which to display time values |
|
723 | + * v: boolean, // Verbose mode. Display column headers |
|
724 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
725 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
726 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
727 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
728 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
729 | + * } $params |
|
730 | + * |
|
731 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
732 | + * @throws ClientResponseException if the status code of response is 4xx |
|
733 | + * @throws ServerResponseException if the status code of response is 5xx |
|
734 | + * |
|
735 | + * @return Elasticsearch|Promise |
|
736 | + */ |
|
737 | + public function recovery(array $params = []) |
|
738 | + { |
|
739 | + if (isset($params['index'])) { |
|
740 | + $url = '/_cat/recovery/' . $this->encode($params['index']); |
|
741 | + $method = 'GET'; |
|
742 | + } else { |
|
743 | + $url = '/_cat/recovery'; |
|
744 | + $method = 'GET'; |
|
745 | + } |
|
746 | + $url = $this->addQueryString($url, $params, ['format', 'active_only', 'bytes', 'detailed', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
747 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
748 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
749 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.recovery'); |
|
750 | + return $this->client->sendRequest($request); |
|
751 | + } |
|
752 | + /** |
|
753 | + * Returns information about snapshot repositories registered in the cluster. |
|
754 | + * |
|
755 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html |
|
756 | + * |
|
757 | + * @param array{ |
|
758 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
759 | + * local: boolean, // Return local information, do not retrieve the state from master node |
|
760 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
761 | + * h: list, // Comma-separated list of column names to display |
|
762 | + * help: boolean, // Return help information |
|
763 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
764 | + * v: boolean, // Verbose mode. Display column headers |
|
765 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
766 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
767 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
768 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
769 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
770 | + * } $params |
|
771 | + * |
|
772 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
773 | + * @throws ClientResponseException if the status code of response is 4xx |
|
774 | + * @throws ServerResponseException if the status code of response is 5xx |
|
775 | + * |
|
776 | + * @return Elasticsearch|Promise |
|
777 | + */ |
|
778 | + public function repositories(array $params = []) |
|
779 | + { |
|
780 | + $url = '/_cat/repositories'; |
|
781 | + $method = 'GET'; |
|
782 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
783 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
784 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
785 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.repositories'); |
|
786 | + return $this->client->sendRequest($request); |
|
787 | + } |
|
788 | + /** |
|
789 | + * Provides low-level information about the segments in the shards of an index. |
|
790 | + * |
|
791 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html |
|
792 | + * |
|
793 | + * @param array{ |
|
794 | + * index: list, // A comma-separated list of index names to limit the returned information |
|
795 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
796 | + * bytes: enum, // The unit in which to display byte values |
|
797 | + * h: list, // Comma-separated list of column names to display |
|
798 | + * help: boolean, // Return help information |
|
799 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
800 | + * v: boolean, // Verbose mode. Display column headers |
|
801 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
802 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
803 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
804 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
805 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
806 | + * } $params |
|
807 | + * |
|
808 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
809 | + * @throws ClientResponseException if the status code of response is 4xx |
|
810 | + * @throws ServerResponseException if the status code of response is 5xx |
|
811 | + * |
|
812 | + * @return Elasticsearch|Promise |
|
813 | + */ |
|
814 | + public function segments(array $params = []) |
|
815 | + { |
|
816 | + if (isset($params['index'])) { |
|
817 | + $url = '/_cat/segments/' . $this->encode($params['index']); |
|
818 | + $method = 'GET'; |
|
819 | + } else { |
|
820 | + $url = '/_cat/segments'; |
|
821 | + $method = 'GET'; |
|
822 | + } |
|
823 | + $url = $this->addQueryString($url, $params, ['format', 'bytes', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
824 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
825 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
826 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.segments'); |
|
827 | + return $this->client->sendRequest($request); |
|
828 | + } |
|
829 | + /** |
|
830 | + * Provides a detailed view of shard allocation on nodes. |
|
831 | + * |
|
832 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html |
|
833 | + * |
|
834 | + * @param array{ |
|
835 | + * index: list, // A comma-separated list of index names to limit the returned information |
|
836 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
837 | + * bytes: enum, // The unit in which to display byte values |
|
838 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
839 | + * h: list, // Comma-separated list of column names to display |
|
840 | + * help: boolean, // Return help information |
|
841 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
842 | + * time: enum, // The unit in which to display time values |
|
843 | + * v: boolean, // Verbose mode. Display column headers |
|
844 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
845 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
846 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
847 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
848 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
849 | + * } $params |
|
850 | + * |
|
851 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
852 | + * @throws ClientResponseException if the status code of response is 4xx |
|
853 | + * @throws ServerResponseException if the status code of response is 5xx |
|
854 | + * |
|
855 | + * @return Elasticsearch|Promise |
|
856 | + */ |
|
857 | + public function shards(array $params = []) |
|
858 | + { |
|
859 | + if (isset($params['index'])) { |
|
860 | + $url = '/_cat/shards/' . $this->encode($params['index']); |
|
861 | + $method = 'GET'; |
|
862 | + } else { |
|
863 | + $url = '/_cat/shards'; |
|
864 | + $method = 'GET'; |
|
865 | + } |
|
866 | + $url = $this->addQueryString($url, $params, ['format', 'bytes', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
867 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
868 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
869 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'cat.shards'); |
|
870 | + return $this->client->sendRequest($request); |
|
871 | + } |
|
872 | + /** |
|
873 | + * Returns all snapshots in a specific repository. |
|
874 | + * |
|
875 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html |
|
876 | + * |
|
877 | + * @param array{ |
|
878 | + * repository: list, // Name of repository from which to fetch the snapshot information |
|
879 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
880 | + * ignore_unavailable: boolean, // Set to true to ignore unavailable snapshots |
|
881 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
882 | + * h: list, // Comma-separated list of column names to display |
|
883 | + * help: boolean, // Return help information |
|
884 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
885 | + * time: enum, // The unit in which to display time values |
|
886 | + * v: boolean, // Verbose mode. Display column headers |
|
887 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
888 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
889 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
890 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
891 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
892 | + * } $params |
|
893 | + * |
|
894 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
895 | + * @throws ClientResponseException if the status code of response is 4xx |
|
896 | + * @throws ServerResponseException if the status code of response is 5xx |
|
897 | + * |
|
898 | + * @return Elasticsearch|Promise |
|
899 | + */ |
|
900 | + public function snapshots(array $params = []) |
|
901 | + { |
|
902 | + if (isset($params['repository'])) { |
|
903 | + $url = '/_cat/snapshots/' . $this->encode($params['repository']); |
|
904 | + $method = 'GET'; |
|
905 | + } else { |
|
906 | + $url = '/_cat/snapshots'; |
|
907 | + $method = 'GET'; |
|
908 | + } |
|
909 | + $url = $this->addQueryString($url, $params, ['format', 'ignore_unavailable', 'master_timeout', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
910 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
911 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
912 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'cat.snapshots'); |
|
913 | + return $this->client->sendRequest($request); |
|
914 | + } |
|
915 | + /** |
|
916 | + * Returns information about the tasks currently executing on one or more nodes in the cluster. |
|
917 | + * |
|
918 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
919 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
920 | + * |
|
921 | + * @param array{ |
|
922 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
923 | + * nodes: 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 |
|
924 | + * actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all. |
|
925 | + * detailed: boolean, // Return detailed task information (default: false) |
|
926 | + * parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. |
|
927 | + * h: list, // Comma-separated list of column names to display |
|
928 | + * help: boolean, // Return help information |
|
929 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
930 | + * time: enum, // The unit in which to display time values |
|
931 | + * v: boolean, // Verbose mode. Display column headers |
|
932 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
933 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
934 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
935 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
936 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
937 | + * } $params |
|
938 | + * |
|
939 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
940 | + * @throws ClientResponseException if the status code of response is 4xx |
|
941 | + * @throws ServerResponseException if the status code of response is 5xx |
|
942 | + * |
|
943 | + * @return Elasticsearch|Promise |
|
944 | + */ |
|
945 | + public function tasks(array $params = []) |
|
946 | + { |
|
947 | + $url = '/_cat/tasks'; |
|
948 | + $method = 'GET'; |
|
949 | + $url = $this->addQueryString($url, $params, ['format', 'nodes', 'actions', 'detailed', 'parent_task_id', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
950 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
951 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
952 | + $request = $this->addOtelAttributes($params, [], $request, 'cat.tasks'); |
|
953 | + return $this->client->sendRequest($request); |
|
954 | + } |
|
955 | + /** |
|
956 | + * Returns information about existing templates. |
|
957 | + * |
|
958 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html |
|
959 | + * |
|
960 | + * @param array{ |
|
961 | + * name: string, // A pattern that returned template names must match |
|
962 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
963 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
964 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
965 | + * h: list, // Comma-separated list of column names to display |
|
966 | + * help: boolean, // Return help information |
|
967 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
968 | + * v: boolean, // Verbose mode. Display column headers |
|
969 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
970 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
971 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
972 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
973 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
974 | + * } $params |
|
975 | + * |
|
976 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
977 | + * @throws ClientResponseException if the status code of response is 4xx |
|
978 | + * @throws ServerResponseException if the status code of response is 5xx |
|
979 | + * |
|
980 | + * @return Elasticsearch|Promise |
|
981 | + */ |
|
982 | + public function templates(array $params = []) |
|
983 | + { |
|
984 | + if (isset($params['name'])) { |
|
985 | + $url = '/_cat/templates/' . $this->encode($params['name']); |
|
986 | + $method = 'GET'; |
|
987 | + } else { |
|
988 | + $url = '/_cat/templates'; |
|
989 | + $method = 'GET'; |
|
990 | + } |
|
991 | + $url = $this->addQueryString($url, $params, ['format', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
992 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
993 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
994 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'cat.templates'); |
|
995 | + return $this->client->sendRequest($request); |
|
996 | + } |
|
997 | + /** |
|
998 | + * Returns cluster-wide thread pool statistics per node. |
|
999 | + * By default the active, queue and rejected statistics are returned for all thread pools. |
|
1000 | + * |
|
1001 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html |
|
1002 | + * |
|
1003 | + * @param array{ |
|
1004 | + * thread_pool_patterns: list, // A comma-separated list of regular-expressions to filter the thread pools in the output |
|
1005 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
1006 | + * time: enum, // The unit in which to display time values |
|
1007 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
1008 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
1009 | + * h: list, // Comma-separated list of column names to display |
|
1010 | + * help: boolean, // Return help information |
|
1011 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
1012 | + * v: boolean, // Verbose mode. Display column headers |
|
1013 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1014 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1015 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1016 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1017 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1018 | + * } $params |
|
1019 | + * |
|
1020 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1021 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1022 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1023 | + * |
|
1024 | + * @return Elasticsearch|Promise |
|
1025 | + */ |
|
1026 | + public function threadPool(array $params = []) |
|
1027 | + { |
|
1028 | + if (isset($params['thread_pool_patterns'])) { |
|
1029 | + $url = '/_cat/thread_pool/' . $this->encode($params['thread_pool_patterns']); |
|
1030 | + $method = 'GET'; |
|
1031 | + } else { |
|
1032 | + $url = '/_cat/thread_pool'; |
|
1033 | + $method = 'GET'; |
|
1034 | + } |
|
1035 | + $url = $this->addQueryString($url, $params, ['format', 'time', 'local', 'master_timeout', 'h', 'help', 's', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1036 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
1037 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1038 | + $request = $this->addOtelAttributes($params, ['thread_pool_patterns'], $request, 'cat.thread_pool'); |
|
1039 | + return $this->client->sendRequest($request); |
|
1040 | + } |
|
1041 | + /** |
|
1042 | + * Gets configuration and usage information about transforms. |
|
1043 | + * |
|
1044 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html |
|
1045 | + * |
|
1046 | + * @param array{ |
|
1047 | + * transform_id: string, // The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
1048 | + * from: int, // skips a number of transform configs, defaults to 0 |
|
1049 | + * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
1050 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
1051 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
1052 | + * h: list, // Comma-separated list of column names to display |
|
1053 | + * help: boolean, // Return help information |
|
1054 | + * s: list, // Comma-separated list of column names or column aliases to sort by |
|
1055 | + * time: enum, // The unit in which to display time values |
|
1056 | + * v: boolean, // Verbose mode. Display column headers |
|
1057 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1058 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1059 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1060 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1061 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1062 | + * } $params |
|
1063 | + * |
|
1064 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1065 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1066 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1067 | + * |
|
1068 | + * @return Elasticsearch|Promise |
|
1069 | + */ |
|
1070 | + public function transforms(array $params = []) |
|
1071 | + { |
|
1072 | + if (isset($params['transform_id'])) { |
|
1073 | + $url = '/_cat/transforms/' . $this->encode($params['transform_id']); |
|
1074 | + $method = 'GET'; |
|
1075 | + } else { |
|
1076 | + $url = '/_cat/transforms'; |
|
1077 | + $method = 'GET'; |
|
1078 | + } |
|
1079 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'format', 'h', 'help', 's', 'time', 'v', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1080 | + $headers = ['Accept' => 'text/plain,application/json']; |
|
1081 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1082 | + $request = $this->addOtelAttributes($params, ['transform_id'], $request, 'cat.transforms'); |
|
1083 | + return $this->client->sendRequest($request); |
|
1084 | + } |
|
1085 | 1085 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Enrich extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Enrich extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes an existing enrich policy and its enrich index. |
30 | 29 | * |
@@ -25,171 +25,171 @@ |
||
25 | 25 | */ |
26 | 26 | class Enrich extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an existing enrich policy and its enrich index. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
35 | - * master_timeout: time, // Timeout for processing on master node |
|
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 deletePolicy(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['name'], $params); |
|
53 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
54 | - $method = 'DELETE'; |
|
55 | - $url = $this->addQueryString($url, $params, ['master_timeout', '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, ['name'], $request, 'enrich.delete_policy'); |
|
59 | - return $this->client->sendRequest($request); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Creates the enrich index for an existing enrich policy. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
68 | - * wait_for_completion: boolean, // Should the request should block until the execution is complete. |
|
69 | - * master_timeout: time, // Timeout for processing on master node |
|
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 executePolicy(array $params = []) |
|
85 | - { |
|
86 | - $this->checkRequiredParameters(['name'], $params); |
|
87 | - $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
88 | - $method = 'PUT'; |
|
89 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', '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, 'enrich.execute_policy'); |
|
93 | - return $this->client->sendRequest($request); |
|
94 | - } |
|
95 | - /** |
|
96 | - * Gets information about an enrich policy. |
|
97 | - * |
|
98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html |
|
99 | - * |
|
100 | - * @param array{ |
|
101 | - * name: list, // A comma-separated list of enrich policy names |
|
102 | - * master_timeout: time, // Timeout for processing on master node |
|
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 getPolicy(array $params = []) |
|
117 | - { |
|
118 | - if (isset($params['name'])) { |
|
119 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
120 | - $method = 'GET'; |
|
121 | - } else { |
|
122 | - $url = '/_enrich/policy'; |
|
123 | - $method = 'GET'; |
|
124 | - } |
|
125 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | - $headers = ['Accept' => 'application/json']; |
|
127 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.get_policy'); |
|
129 | - return $this->client->sendRequest($request); |
|
130 | - } |
|
131 | - /** |
|
132 | - * Creates a new enrich policy. |
|
133 | - * |
|
134 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html |
|
135 | - * |
|
136 | - * @param array{ |
|
137 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
138 | - * master_timeout: time, // Timeout for processing on master node |
|
139 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
140 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
141 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
142 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
143 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
144 | - * body: array, // (REQUIRED) The enrich policy to register |
|
145 | - * } $params |
|
146 | - * |
|
147 | - * @throws MissingParameterException if a required parameter is missing |
|
148 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | - * @throws ClientResponseException if the status code of response is 4xx |
|
150 | - * @throws ServerResponseException if the status code of response is 5xx |
|
151 | - * |
|
152 | - * @return Elasticsearch|Promise |
|
153 | - */ |
|
154 | - public function putPolicy(array $params = []) |
|
155 | - { |
|
156 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
157 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
158 | - $method = 'PUT'; |
|
159 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
160 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
161 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
162 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.put_policy'); |
|
163 | - return $this->client->sendRequest($request); |
|
164 | - } |
|
165 | - /** |
|
166 | - * Gets enrich coordinator statistics and information about enrich policies that are currently executing. |
|
167 | - * |
|
168 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html |
|
169 | - * |
|
170 | - * @param array{ |
|
171 | - * master_timeout: time, // Timeout for processing on master node |
|
172 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
173 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
174 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
175 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
176 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
177 | - * } $params |
|
178 | - * |
|
179 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | - * @throws ClientResponseException if the status code of response is 4xx |
|
181 | - * @throws ServerResponseException if the status code of response is 5xx |
|
182 | - * |
|
183 | - * @return Elasticsearch|Promise |
|
184 | - */ |
|
185 | - public function stats(array $params = []) |
|
186 | - { |
|
187 | - $url = '/_enrich/_stats'; |
|
188 | - $method = 'GET'; |
|
189 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | - $headers = ['Accept' => 'application/json']; |
|
191 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | - $request = $this->addOtelAttributes($params, [], $request, 'enrich.stats'); |
|
193 | - return $this->client->sendRequest($request); |
|
194 | - } |
|
28 | + /** |
|
29 | + * Deletes an existing enrich policy and its enrich index. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
35 | + * master_timeout: time, // Timeout for processing on master node |
|
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 deletePolicy(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['name'], $params); |
|
53 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
54 | + $method = 'DELETE'; |
|
55 | + $url = $this->addQueryString($url, $params, ['master_timeout', '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, ['name'], $request, 'enrich.delete_policy'); |
|
59 | + return $this->client->sendRequest($request); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Creates the enrich index for an existing enrich policy. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
68 | + * wait_for_completion: boolean, // Should the request should block until the execution is complete. |
|
69 | + * master_timeout: time, // Timeout for processing on master node |
|
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 executePolicy(array $params = []) |
|
85 | + { |
|
86 | + $this->checkRequiredParameters(['name'], $params); |
|
87 | + $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
88 | + $method = 'PUT'; |
|
89 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', '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, 'enrich.execute_policy'); |
|
93 | + return $this->client->sendRequest($request); |
|
94 | + } |
|
95 | + /** |
|
96 | + * Gets information about an enrich policy. |
|
97 | + * |
|
98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html |
|
99 | + * |
|
100 | + * @param array{ |
|
101 | + * name: list, // A comma-separated list of enrich policy names |
|
102 | + * master_timeout: time, // Timeout for processing on master node |
|
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 getPolicy(array $params = []) |
|
117 | + { |
|
118 | + if (isset($params['name'])) { |
|
119 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
120 | + $method = 'GET'; |
|
121 | + } else { |
|
122 | + $url = '/_enrich/policy'; |
|
123 | + $method = 'GET'; |
|
124 | + } |
|
125 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | + $headers = ['Accept' => 'application/json']; |
|
127 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.get_policy'); |
|
129 | + return $this->client->sendRequest($request); |
|
130 | + } |
|
131 | + /** |
|
132 | + * Creates a new enrich policy. |
|
133 | + * |
|
134 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html |
|
135 | + * |
|
136 | + * @param array{ |
|
137 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
138 | + * master_timeout: time, // Timeout for processing on master node |
|
139 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
140 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
141 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
142 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
143 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
144 | + * body: array, // (REQUIRED) The enrich policy to register |
|
145 | + * } $params |
|
146 | + * |
|
147 | + * @throws MissingParameterException if a required parameter is missing |
|
148 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | + * @throws ClientResponseException if the status code of response is 4xx |
|
150 | + * @throws ServerResponseException if the status code of response is 5xx |
|
151 | + * |
|
152 | + * @return Elasticsearch|Promise |
|
153 | + */ |
|
154 | + public function putPolicy(array $params = []) |
|
155 | + { |
|
156 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
157 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
158 | + $method = 'PUT'; |
|
159 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
160 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
161 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
162 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.put_policy'); |
|
163 | + return $this->client->sendRequest($request); |
|
164 | + } |
|
165 | + /** |
|
166 | + * Gets enrich coordinator statistics and information about enrich policies that are currently executing. |
|
167 | + * |
|
168 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html |
|
169 | + * |
|
170 | + * @param array{ |
|
171 | + * master_timeout: time, // Timeout for processing on master node |
|
172 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
173 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
174 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
175 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
176 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
177 | + * } $params |
|
178 | + * |
|
179 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | + * @throws ClientResponseException if the status code of response is 4xx |
|
181 | + * @throws ServerResponseException if the status code of response is 5xx |
|
182 | + * |
|
183 | + * @return Elasticsearch|Promise |
|
184 | + */ |
|
185 | + public function stats(array $params = []) |
|
186 | + { |
|
187 | + $url = '/_enrich/_stats'; |
|
188 | + $method = 'GET'; |
|
189 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | + $headers = ['Accept' => 'application/json']; |
|
191 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | + $request = $this->addOtelAttributes($params, [], $request, 'enrich.stats'); |
|
193 | + return $this->client->sendRequest($request); |
|
194 | + } |
|
195 | 195 | } |
@@ -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 deletePolicy(array $params = []) |
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['name'], $params); |
53 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
53 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
54 | 54 | $method = 'DELETE'; |
55 | 55 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function executePolicy(array $params = []) |
85 | 85 | { |
86 | 86 | $this->checkRequiredParameters(['name'], $params); |
87 | - $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
87 | + $url = '/_enrich/policy/'.$this->encode($params['name']).'/_execute'; |
|
88 | 88 | $method = 'PUT'; |
89 | 89 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
90 | 90 | $headers = ['Accept' => 'application/json']; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function getPolicy(array $params = []) |
117 | 117 | { |
118 | 118 | if (isset($params['name'])) { |
119 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
119 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
120 | 120 | $method = 'GET'; |
121 | 121 | } else { |
122 | 122 | $url = '/_enrich/policy'; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | public function putPolicy(array $params = []) |
155 | 155 | { |
156 | 156 | $this->checkRequiredParameters(['name', 'body'], $params); |
157 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
157 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
158 | 158 | $method = 'PUT'; |
159 | 159 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
160 | 160 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class License extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class License extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes licensing information for the cluster |
30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
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; |
@@ -25,222 +25,222 @@ |
||
25 | 25 | */ |
26 | 26 | class License extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes licensing information for the cluster |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * master_timeout: time, // Timeout for processing on master node |
|
35 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
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 delete(array $params = []) |
|
50 | - { |
|
51 | - $url = '/_license'; |
|
52 | - $method = 'DELETE'; |
|
53 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', '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, 'license.delete'); |
|
57 | - return $this->client->sendRequest($request); |
|
58 | - } |
|
59 | - /** |
|
60 | - * Retrieves licensing information for the cluster |
|
61 | - * |
|
62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html |
|
63 | - * |
|
64 | - * @param array{ |
|
65 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
66 | - * accept_enterprise: boolean, // Supported for backwards compatibility with 7.x. If this param is used it must be set to true |
|
67 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | - * @throws ClientResponseException if the status code of response is 4xx |
|
76 | - * @throws ServerResponseException if the status code of response is 5xx |
|
77 | - * |
|
78 | - * @return Elasticsearch|Promise |
|
79 | - */ |
|
80 | - public function get(array $params = []) |
|
81 | - { |
|
82 | - $url = '/_license'; |
|
83 | - $method = 'GET'; |
|
84 | - $url = $this->addQueryString($url, $params, ['local', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | - $headers = ['Accept' => 'application/json']; |
|
86 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
87 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get'); |
|
88 | - return $this->client->sendRequest($request); |
|
89 | - } |
|
90 | - /** |
|
91 | - * Retrieves information about the status of the basic license. |
|
92 | - * |
|
93 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html |
|
94 | - * |
|
95 | - * @param array{ |
|
96 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
97 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
98 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
99 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
100 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
101 | - * } $params |
|
102 | - * |
|
103 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | - * @throws ClientResponseException if the status code of response is 4xx |
|
105 | - * @throws ServerResponseException if the status code of response is 5xx |
|
106 | - * |
|
107 | - * @return Elasticsearch|Promise |
|
108 | - */ |
|
109 | - public function getBasicStatus(array $params = []) |
|
110 | - { |
|
111 | - $url = '/_license/basic_status'; |
|
112 | - $method = 'GET'; |
|
113 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
114 | - $headers = ['Accept' => 'application/json']; |
|
115 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
116 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get_basic_status'); |
|
117 | - return $this->client->sendRequest($request); |
|
118 | - } |
|
119 | - /** |
|
120 | - * Retrieves information about the status of the trial license. |
|
121 | - * |
|
122 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html |
|
123 | - * |
|
124 | - * @param array{ |
|
125 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
126 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
127 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
128 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
129 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
130 | - * } $params |
|
131 | - * |
|
132 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
133 | - * @throws ClientResponseException if the status code of response is 4xx |
|
134 | - * @throws ServerResponseException if the status code of response is 5xx |
|
135 | - * |
|
136 | - * @return Elasticsearch|Promise |
|
137 | - */ |
|
138 | - public function getTrialStatus(array $params = []) |
|
139 | - { |
|
140 | - $url = '/_license/trial_status'; |
|
141 | - $method = 'GET'; |
|
142 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
143 | - $headers = ['Accept' => 'application/json']; |
|
144 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
145 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get_trial_status'); |
|
146 | - return $this->client->sendRequest($request); |
|
147 | - } |
|
148 | - /** |
|
149 | - * Updates the license for the cluster. |
|
150 | - * |
|
151 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html |
|
152 | - * |
|
153 | - * @param array{ |
|
154 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
155 | - * master_timeout: time, // Timeout for processing on master node |
|
156 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
157 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
158 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
159 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
160 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
161 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
162 | - * body: array, // licenses to be installed |
|
163 | - * } $params |
|
164 | - * |
|
165 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
166 | - * @throws ClientResponseException if the status code of response is 4xx |
|
167 | - * @throws ServerResponseException if the status code of response is 5xx |
|
168 | - * |
|
169 | - * @return Elasticsearch|Promise |
|
170 | - */ |
|
171 | - public function post(array $params = []) |
|
172 | - { |
|
173 | - $url = '/_license'; |
|
174 | - $method = 'PUT'; |
|
175 | - $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
176 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
177 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
178 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post'); |
|
179 | - return $this->client->sendRequest($request); |
|
180 | - } |
|
181 | - /** |
|
182 | - * Starts an indefinite basic license. |
|
183 | - * |
|
184 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html |
|
185 | - * |
|
186 | - * @param array{ |
|
187 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
188 | - * master_timeout: time, // Timeout for processing on master node |
|
189 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
190 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
191 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
192 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
193 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
194 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 postStartBasic(array $params = []) |
|
204 | - { |
|
205 | - $url = '/_license/start_basic'; |
|
206 | - $method = 'POST'; |
|
207 | - $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
208 | - $headers = ['Accept' => 'application/json']; |
|
209 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
210 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_basic'); |
|
211 | - return $this->client->sendRequest($request); |
|
212 | - } |
|
213 | - /** |
|
214 | - * starts a limited time trial license. |
|
215 | - * |
|
216 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html |
|
217 | - * |
|
218 | - * @param array{ |
|
219 | - * type: string, // The type of trial license to generate (default: "trial") |
|
220 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
221 | - * master_timeout: time, // Timeout for processing on master node |
|
222 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
223 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | - * } $params |
|
229 | - * |
|
230 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | - * @throws ClientResponseException if the status code of response is 4xx |
|
232 | - * @throws ServerResponseException if the status code of response is 5xx |
|
233 | - * |
|
234 | - * @return Elasticsearch|Promise |
|
235 | - */ |
|
236 | - public function postStartTrial(array $params = []) |
|
237 | - { |
|
238 | - $url = '/_license/start_trial'; |
|
239 | - $method = 'POST'; |
|
240 | - $url = $this->addQueryString($url, $params, ['type', 'acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | - $headers = ['Accept' => 'application/json']; |
|
242 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
243 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_trial'); |
|
244 | - return $this->client->sendRequest($request); |
|
245 | - } |
|
28 | + /** |
|
29 | + * Deletes licensing information for the cluster |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * master_timeout: time, // Timeout for processing on master node |
|
35 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
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 delete(array $params = []) |
|
50 | + { |
|
51 | + $url = '/_license'; |
|
52 | + $method = 'DELETE'; |
|
53 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', '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, 'license.delete'); |
|
57 | + return $this->client->sendRequest($request); |
|
58 | + } |
|
59 | + /** |
|
60 | + * Retrieves licensing information for the cluster |
|
61 | + * |
|
62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html |
|
63 | + * |
|
64 | + * @param array{ |
|
65 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
66 | + * accept_enterprise: boolean, // Supported for backwards compatibility with 7.x. If this param is used it must be set to true |
|
67 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | + * @throws ClientResponseException if the status code of response is 4xx |
|
76 | + * @throws ServerResponseException if the status code of response is 5xx |
|
77 | + * |
|
78 | + * @return Elasticsearch|Promise |
|
79 | + */ |
|
80 | + public function get(array $params = []) |
|
81 | + { |
|
82 | + $url = '/_license'; |
|
83 | + $method = 'GET'; |
|
84 | + $url = $this->addQueryString($url, $params, ['local', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | + $headers = ['Accept' => 'application/json']; |
|
86 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
87 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get'); |
|
88 | + return $this->client->sendRequest($request); |
|
89 | + } |
|
90 | + /** |
|
91 | + * Retrieves information about the status of the basic license. |
|
92 | + * |
|
93 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html |
|
94 | + * |
|
95 | + * @param array{ |
|
96 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
97 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
98 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
99 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
100 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
101 | + * } $params |
|
102 | + * |
|
103 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | + * @throws ClientResponseException if the status code of response is 4xx |
|
105 | + * @throws ServerResponseException if the status code of response is 5xx |
|
106 | + * |
|
107 | + * @return Elasticsearch|Promise |
|
108 | + */ |
|
109 | + public function getBasicStatus(array $params = []) |
|
110 | + { |
|
111 | + $url = '/_license/basic_status'; |
|
112 | + $method = 'GET'; |
|
113 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
114 | + $headers = ['Accept' => 'application/json']; |
|
115 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
116 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get_basic_status'); |
|
117 | + return $this->client->sendRequest($request); |
|
118 | + } |
|
119 | + /** |
|
120 | + * Retrieves information about the status of the trial license. |
|
121 | + * |
|
122 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html |
|
123 | + * |
|
124 | + * @param array{ |
|
125 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
126 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
127 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
128 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
129 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
130 | + * } $params |
|
131 | + * |
|
132 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
133 | + * @throws ClientResponseException if the status code of response is 4xx |
|
134 | + * @throws ServerResponseException if the status code of response is 5xx |
|
135 | + * |
|
136 | + * @return Elasticsearch|Promise |
|
137 | + */ |
|
138 | + public function getTrialStatus(array $params = []) |
|
139 | + { |
|
140 | + $url = '/_license/trial_status'; |
|
141 | + $method = 'GET'; |
|
142 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
143 | + $headers = ['Accept' => 'application/json']; |
|
144 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
145 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get_trial_status'); |
|
146 | + return $this->client->sendRequest($request); |
|
147 | + } |
|
148 | + /** |
|
149 | + * Updates the license for the cluster. |
|
150 | + * |
|
151 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html |
|
152 | + * |
|
153 | + * @param array{ |
|
154 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
155 | + * master_timeout: time, // Timeout for processing on master node |
|
156 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
157 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
158 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
159 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
160 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
161 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
162 | + * body: array, // licenses to be installed |
|
163 | + * } $params |
|
164 | + * |
|
165 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
166 | + * @throws ClientResponseException if the status code of response is 4xx |
|
167 | + * @throws ServerResponseException if the status code of response is 5xx |
|
168 | + * |
|
169 | + * @return Elasticsearch|Promise |
|
170 | + */ |
|
171 | + public function post(array $params = []) |
|
172 | + { |
|
173 | + $url = '/_license'; |
|
174 | + $method = 'PUT'; |
|
175 | + $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
176 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
177 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
178 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post'); |
|
179 | + return $this->client->sendRequest($request); |
|
180 | + } |
|
181 | + /** |
|
182 | + * Starts an indefinite basic license. |
|
183 | + * |
|
184 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html |
|
185 | + * |
|
186 | + * @param array{ |
|
187 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
188 | + * master_timeout: time, // Timeout for processing on master node |
|
189 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
190 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
191 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
192 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
193 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
194 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 postStartBasic(array $params = []) |
|
204 | + { |
|
205 | + $url = '/_license/start_basic'; |
|
206 | + $method = 'POST'; |
|
207 | + $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
208 | + $headers = ['Accept' => 'application/json']; |
|
209 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
210 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_basic'); |
|
211 | + return $this->client->sendRequest($request); |
|
212 | + } |
|
213 | + /** |
|
214 | + * starts a limited time trial license. |
|
215 | + * |
|
216 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html |
|
217 | + * |
|
218 | + * @param array{ |
|
219 | + * type: string, // The type of trial license to generate (default: "trial") |
|
220 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
221 | + * master_timeout: time, // Timeout for processing on master node |
|
222 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
223 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | + * } $params |
|
229 | + * |
|
230 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | + * @throws ClientResponseException if the status code of response is 4xx |
|
232 | + * @throws ServerResponseException if the status code of response is 5xx |
|
233 | + * |
|
234 | + * @return Elasticsearch|Promise |
|
235 | + */ |
|
236 | + public function postStartTrial(array $params = []) |
|
237 | + { |
|
238 | + $url = '/_license/start_trial'; |
|
239 | + $method = 'POST'; |
|
240 | + $url = $this->addQueryString($url, $params, ['type', 'acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | + $headers = ['Accept' => 'application/json']; |
|
242 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
243 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_trial'); |
|
244 | + return $this->client->sendRequest($request); |
|
245 | + } |
|
246 | 246 | } |
@@ -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 deletePipeline(array $params = []) |
50 | 50 | { |
51 | 51 | $this->checkRequiredParameters(['id'], $params); |
52 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
52 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
53 | 53 | $method = 'DELETE'; |
54 | 54 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
55 | 55 | $headers = ['Accept' => 'application/json']; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function getPipeline(array $params = []) |
79 | 79 | { |
80 | 80 | if (isset($params['id'])) { |
81 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
81 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
82 | 82 | $method = 'GET'; |
83 | 83 | } else { |
84 | 84 | $url = '/_logstash/pipeline'; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | public function putPipeline(array $params = []) |
114 | 114 | { |
115 | 115 | $this->checkRequiredParameters(['id', 'body'], $params); |
116 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
116 | + $url = '/_logstash/pipeline/'.$this->encode($params['id']); |
|
117 | 117 | $method = 'PUT'; |
118 | 118 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
119 | 119 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Logstash extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Logstash extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes Logstash Pipelines used by Central Management |
30 | 29 | * |
@@ -25,104 +25,104 @@ |
||
25 | 25 | */ |
26 | 26 | class Logstash extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes Logstash Pipelines used by Central Management |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * id: string, // (REQUIRED) The ID of the Pipeline |
|
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 deletePipeline(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['id'], $params); |
|
52 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'logstash.delete_pipeline'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Retrieves Logstash Pipelines used by Central Management |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * id: string, // A comma-separated list of Pipeline IDs |
|
67 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | - * @throws ClientResponseException if the status code of response is 4xx |
|
76 | - * @throws ServerResponseException if the status code of response is 5xx |
|
77 | - * |
|
78 | - * @return Elasticsearch|Promise |
|
79 | - */ |
|
80 | - public function getPipeline(array $params = []) |
|
81 | - { |
|
82 | - if (isset($params['id'])) { |
|
83 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
84 | - $method = 'GET'; |
|
85 | - } else { |
|
86 | - $url = '/_logstash/pipeline'; |
|
87 | - $method = 'GET'; |
|
88 | - } |
|
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, ['id'], $request, 'logstash.get_pipeline'); |
|
93 | - return $this->client->sendRequest($request); |
|
94 | - } |
|
95 | - /** |
|
96 | - * Adds and updates Logstash Pipelines used for Central Management |
|
97 | - * |
|
98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html |
|
99 | - * |
|
100 | - * @param array{ |
|
101 | - * id: string, // (REQUIRED) The ID of the Pipeline |
|
102 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | - * body: array, // (REQUIRED) The Pipeline to add or update |
|
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 putPipeline(array $params = []) |
|
118 | - { |
|
119 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
120 | - $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
121 | - $method = 'PUT'; |
|
122 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
123 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
124 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
125 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'logstash.put_pipeline'); |
|
126 | - return $this->client->sendRequest($request); |
|
127 | - } |
|
28 | + /** |
|
29 | + * Deletes Logstash Pipelines used by Central Management |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * id: string, // (REQUIRED) The ID of the Pipeline |
|
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 deletePipeline(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['id'], $params); |
|
52 | + $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'logstash.delete_pipeline'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Retrieves Logstash Pipelines used by Central Management |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * id: string, // A comma-separated list of Pipeline IDs |
|
67 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | + * @throws ClientResponseException if the status code of response is 4xx |
|
76 | + * @throws ServerResponseException if the status code of response is 5xx |
|
77 | + * |
|
78 | + * @return Elasticsearch|Promise |
|
79 | + */ |
|
80 | + public function getPipeline(array $params = []) |
|
81 | + { |
|
82 | + if (isset($params['id'])) { |
|
83 | + $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
84 | + $method = 'GET'; |
|
85 | + } else { |
|
86 | + $url = '/_logstash/pipeline'; |
|
87 | + $method = 'GET'; |
|
88 | + } |
|
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, ['id'], $request, 'logstash.get_pipeline'); |
|
93 | + return $this->client->sendRequest($request); |
|
94 | + } |
|
95 | + /** |
|
96 | + * Adds and updates Logstash Pipelines used for Central Management |
|
97 | + * |
|
98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html |
|
99 | + * |
|
100 | + * @param array{ |
|
101 | + * id: string, // (REQUIRED) The ID of the Pipeline |
|
102 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | + * body: array, // (REQUIRED) The Pipeline to add or update |
|
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 putPipeline(array $params = []) |
|
118 | + { |
|
119 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
120 | + $url = '/_logstash/pipeline/' . $this->encode($params['id']); |
|
121 | + $method = 'PUT'; |
|
122 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
123 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
124 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
125 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'logstash.put_pipeline'); |
|
126 | + return $this->client->sendRequest($request); |
|
127 | + } |
|
128 | 128 | } |