@@ -25,110 +25,110 @@ |
||
25 | 25 | */ |
26 | 26 | class Tasks extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Cancels a task, if it can be cancelled through an API. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * task_id: string, // Cancel the task with specified task id (node_id:task_number) |
|
36 | - * 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 |
|
37 | - * actions: list, // A comma-separated list of actions that should be cancelled. Leave empty to cancel all. |
|
38 | - * parent_task_id: string, // Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. |
|
39 | - * wait_for_completion: boolean, // Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false |
|
40 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
41 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
42 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
43 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
44 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
45 | - * } $params |
|
46 | - * |
|
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 cancel(array $params = []) |
|
54 | - { |
|
55 | - if (isset($params['task_id'])) { |
|
56 | - $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel'; |
|
57 | - $method = 'POST'; |
|
58 | - } else { |
|
59 | - $url = '/_tasks/_cancel'; |
|
60 | - $method = 'POST'; |
|
61 | - } |
|
62 | - $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'parent_task_id', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
63 | - $headers = ['Accept' => 'application/json']; |
|
64 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
65 | - } |
|
66 | - /** |
|
67 | - * Returns information about a task. |
|
68 | - * |
|
69 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
70 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
71 | - * |
|
72 | - * @param array{ |
|
73 | - * task_id: string, // (REQUIRED) Return the task with specified id (node_id:task_number) |
|
74 | - * wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false) |
|
75 | - * timeout: time, // Explicit operation timeout |
|
76 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
77 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
78 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
79 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
80 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
81 | - * } $params |
|
82 | - * |
|
83 | - * @throws MissingParameterException if a required parameter is missing |
|
84 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
85 | - * @throws ClientResponseException if the status code of response is 4xx |
|
86 | - * @throws ServerResponseException if the status code of response is 5xx |
|
87 | - * |
|
88 | - * @return Elasticsearch|Promise |
|
89 | - */ |
|
90 | - public function get(array $params = []) |
|
91 | - { |
|
92 | - $this->checkRequiredParameters(['task_id'], $params); |
|
93 | - $url = '/_tasks/' . $this->encode($params['task_id']); |
|
94 | - $method = 'GET'; |
|
95 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | - $headers = ['Accept' => 'application/json']; |
|
97 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
98 | - } |
|
99 | - /** |
|
100 | - * Returns a list of tasks. |
|
101 | - * |
|
102 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
103 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
104 | - * |
|
105 | - * @param array{ |
|
106 | - * 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 |
|
107 | - * actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all. |
|
108 | - * detailed: boolean, // Return detailed task information (default: false) |
|
109 | - * parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. |
|
110 | - * wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false) |
|
111 | - * group_by: enum, // Group tasks by nodes or parent/child relationships |
|
112 | - * timeout: time, // Explicit operation timeout |
|
113 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
114 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
115 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
116 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
117 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
118 | - * } $params |
|
119 | - * |
|
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 list(array $params = []) |
|
127 | - { |
|
128 | - $url = '/_tasks'; |
|
129 | - $method = 'GET'; |
|
130 | - $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'detailed', 'parent_task_id', 'wait_for_completion', 'group_by', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
131 | - $headers = ['Accept' => 'application/json']; |
|
132 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
133 | - } |
|
28 | + /** |
|
29 | + * Cancels a task, if it can be cancelled through an API. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * task_id: string, // Cancel the task with specified task id (node_id:task_number) |
|
36 | + * 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 |
|
37 | + * actions: list, // A comma-separated list of actions that should be cancelled. Leave empty to cancel all. |
|
38 | + * parent_task_id: string, // Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. |
|
39 | + * wait_for_completion: boolean, // Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false |
|
40 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
41 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
42 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
43 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
44 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
45 | + * } $params |
|
46 | + * |
|
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 cancel(array $params = []) |
|
54 | + { |
|
55 | + if (isset($params['task_id'])) { |
|
56 | + $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel'; |
|
57 | + $method = 'POST'; |
|
58 | + } else { |
|
59 | + $url = '/_tasks/_cancel'; |
|
60 | + $method = 'POST'; |
|
61 | + } |
|
62 | + $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'parent_task_id', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
63 | + $headers = ['Accept' => 'application/json']; |
|
64 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
65 | + } |
|
66 | + /** |
|
67 | + * Returns information about a task. |
|
68 | + * |
|
69 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
70 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
71 | + * |
|
72 | + * @param array{ |
|
73 | + * task_id: string, // (REQUIRED) Return the task with specified id (node_id:task_number) |
|
74 | + * wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false) |
|
75 | + * timeout: time, // Explicit operation timeout |
|
76 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
77 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
78 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
79 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
80 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
81 | + * } $params |
|
82 | + * |
|
83 | + * @throws MissingParameterException if a required parameter is missing |
|
84 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
85 | + * @throws ClientResponseException if the status code of response is 4xx |
|
86 | + * @throws ServerResponseException if the status code of response is 5xx |
|
87 | + * |
|
88 | + * @return Elasticsearch|Promise |
|
89 | + */ |
|
90 | + public function get(array $params = []) |
|
91 | + { |
|
92 | + $this->checkRequiredParameters(['task_id'], $params); |
|
93 | + $url = '/_tasks/' . $this->encode($params['task_id']); |
|
94 | + $method = 'GET'; |
|
95 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | + $headers = ['Accept' => 'application/json']; |
|
97 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
98 | + } |
|
99 | + /** |
|
100 | + * Returns a list of tasks. |
|
101 | + * |
|
102 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html |
|
103 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
104 | + * |
|
105 | + * @param array{ |
|
106 | + * 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 |
|
107 | + * actions: list, // A comma-separated list of actions that should be returned. Leave empty to return all. |
|
108 | + * detailed: boolean, // Return detailed task information (default: false) |
|
109 | + * parent_task_id: string, // Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. |
|
110 | + * wait_for_completion: boolean, // Wait for the matching tasks to complete (default: false) |
|
111 | + * group_by: enum, // Group tasks by nodes or parent/child relationships |
|
112 | + * timeout: time, // Explicit operation timeout |
|
113 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
114 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
115 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
116 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
117 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
118 | + * } $params |
|
119 | + * |
|
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 list(array $params = []) |
|
127 | + { |
|
128 | + $url = '/_tasks'; |
|
129 | + $method = 'GET'; |
|
130 | + $url = $this->addQueryString($url, $params, ['nodes', 'actions', 'detailed', 'parent_task_id', 'wait_for_completion', 'group_by', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
131 | + $headers = ['Accept' => 'application/json']; |
|
132 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
133 | + } |
|
134 | 134 | } |
@@ -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 cancel(array $params = []) |
54 | 54 | { |
55 | 55 | if (isset($params['task_id'])) { |
56 | - $url = '/_tasks/' . $this->encode($params['task_id']) . '/_cancel'; |
|
56 | + $url = '/_tasks/'.$this->encode($params['task_id']).'/_cancel'; |
|
57 | 57 | $method = 'POST'; |
58 | 58 | } else { |
59 | 59 | $url = '/_tasks/_cancel'; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function get(array $params = []) |
91 | 91 | { |
92 | 92 | $this->checkRequiredParameters(['task_id'], $params); |
93 | - $url = '/_tasks/' . $this->encode($params['task_id']); |
|
93 | + $url = '/_tasks/'.$this->encode($params['task_id']); |
|
94 | 94 | $method = 'GET'; |
95 | 95 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
96 | 96 | $headers = ['Accept' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Tasks extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Tasks extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Cancels a task, if it can be cancelled through an API. |
30 | 29 | * |
@@ -25,186 +25,186 @@ |
||
25 | 25 | */ |
26 | 26 | class Sql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Clears the SQL cursor |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | - * body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
45 | - * |
|
46 | - * @return Elasticsearch|Promise |
|
47 | - */ |
|
48 | - public function clearCursor(array $params = []) |
|
49 | - { |
|
50 | - $this->checkRequiredParameters(['body'], $params); |
|
51 | - $url = '/_sql/close'; |
|
52 | - $method = 'POST'; |
|
53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | - } |
|
57 | - /** |
|
58 | - * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. |
|
59 | - * |
|
60 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html |
|
61 | - * |
|
62 | - * @param array{ |
|
63 | - * id: string, // (REQUIRED) The async search ID |
|
64 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
65 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
66 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
67 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
68 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
69 | - * } $params |
|
70 | - * |
|
71 | - * @throws MissingParameterException if a required parameter is missing |
|
72 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
73 | - * @throws ClientResponseException if the status code of response is 4xx |
|
74 | - * @throws ServerResponseException if the status code of response is 5xx |
|
75 | - * |
|
76 | - * @return Elasticsearch|Promise |
|
77 | - */ |
|
78 | - public function deleteAsync(array $params = []) |
|
79 | - { |
|
80 | - $this->checkRequiredParameters(['id'], $params); |
|
81 | - $url = '/_sql/async/delete/' . $this->encode($params['id']); |
|
82 | - $method = 'DELETE'; |
|
83 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
84 | - $headers = ['Accept' => 'application/json']; |
|
85 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
86 | - } |
|
87 | - /** |
|
88 | - * Returns the current status and available results for an async SQL search or stored synchronous SQL search |
|
89 | - * |
|
90 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html |
|
91 | - * |
|
92 | - * @param array{ |
|
93 | - * id: string, // (REQUIRED) The async search ID |
|
94 | - * delimiter: string, // Separator for CSV results |
|
95 | - * format: string, // Short version of the Accept header, e.g. json, yaml |
|
96 | - * keep_alive: time, // Retention period for the search and its results |
|
97 | - * wait_for_completion_timeout: time, // Duration to wait for complete results |
|
98 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
99 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
100 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
101 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
102 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
103 | - * } $params |
|
104 | - * |
|
105 | - * @throws MissingParameterException if a required parameter is missing |
|
106 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
107 | - * @throws ClientResponseException if the status code of response is 4xx |
|
108 | - * @throws ServerResponseException if the status code of response is 5xx |
|
109 | - * |
|
110 | - * @return Elasticsearch|Promise |
|
111 | - */ |
|
112 | - public function getAsync(array $params = []) |
|
113 | - { |
|
114 | - $this->checkRequiredParameters(['id'], $params); |
|
115 | - $url = '/_sql/async/' . $this->encode($params['id']); |
|
116 | - $method = 'GET'; |
|
117 | - $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
118 | - $headers = ['Accept' => 'application/json']; |
|
119 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
120 | - } |
|
121 | - /** |
|
122 | - * Returns the current status of an async SQL search or a stored synchronous SQL search |
|
123 | - * |
|
124 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html |
|
125 | - * |
|
126 | - * @param array{ |
|
127 | - * id: string, // (REQUIRED) The async search ID |
|
128 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | - * } $params |
|
134 | - * |
|
135 | - * @throws MissingParameterException if a required parameter is missing |
|
136 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
137 | - * @throws ClientResponseException if the status code of response is 4xx |
|
138 | - * @throws ServerResponseException if the status code of response is 5xx |
|
139 | - * |
|
140 | - * @return Elasticsearch|Promise |
|
141 | - */ |
|
142 | - public function getAsyncStatus(array $params = []) |
|
143 | - { |
|
144 | - $this->checkRequiredParameters(['id'], $params); |
|
145 | - $url = '/_sql/async/status/' . $this->encode($params['id']); |
|
146 | - $method = 'GET'; |
|
147 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
148 | - $headers = ['Accept' => 'application/json']; |
|
149 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
150 | - } |
|
151 | - /** |
|
152 | - * Executes a SQL request |
|
153 | - * |
|
154 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html |
|
155 | - * |
|
156 | - * @param array{ |
|
157 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
158 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
159 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
160 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
161 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
162 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
163 | - * body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query. |
|
164 | - * } $params |
|
165 | - * |
|
166 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | - * @throws ClientResponseException if the status code of response is 4xx |
|
168 | - * @throws ServerResponseException if the status code of response is 5xx |
|
169 | - * |
|
170 | - * @return Elasticsearch|Promise |
|
171 | - */ |
|
172 | - public function query(array $params = []) |
|
173 | - { |
|
174 | - $this->checkRequiredParameters(['body'], $params); |
|
175 | - $url = '/_sql'; |
|
176 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
177 | - $url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
180 | - } |
|
181 | - /** |
|
182 | - * Translates SQL into Elasticsearch queries |
|
183 | - * |
|
184 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html |
|
185 | - * |
|
186 | - * @param array{ |
|
187 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
188 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
189 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
190 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
191 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
192 | - * body: array, // (REQUIRED) Specify the query in the `query` element. |
|
193 | - * } $params |
|
194 | - * |
|
195 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
196 | - * @throws ClientResponseException if the status code of response is 4xx |
|
197 | - * @throws ServerResponseException if the status code of response is 5xx |
|
198 | - * |
|
199 | - * @return Elasticsearch|Promise |
|
200 | - */ |
|
201 | - public function translate(array $params = []) |
|
202 | - { |
|
203 | - $this->checkRequiredParameters(['body'], $params); |
|
204 | - $url = '/_sql/translate'; |
|
205 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
206 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
207 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
208 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
209 | - } |
|
28 | + /** |
|
29 | + * Clears the SQL cursor |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | + * body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
45 | + * |
|
46 | + * @return Elasticsearch|Promise |
|
47 | + */ |
|
48 | + public function clearCursor(array $params = []) |
|
49 | + { |
|
50 | + $this->checkRequiredParameters(['body'], $params); |
|
51 | + $url = '/_sql/close'; |
|
52 | + $method = 'POST'; |
|
53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | + } |
|
57 | + /** |
|
58 | + * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. |
|
59 | + * |
|
60 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html |
|
61 | + * |
|
62 | + * @param array{ |
|
63 | + * id: string, // (REQUIRED) The async search ID |
|
64 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
65 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
66 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
67 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
68 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
69 | + * } $params |
|
70 | + * |
|
71 | + * @throws MissingParameterException if a required parameter is missing |
|
72 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
73 | + * @throws ClientResponseException if the status code of response is 4xx |
|
74 | + * @throws ServerResponseException if the status code of response is 5xx |
|
75 | + * |
|
76 | + * @return Elasticsearch|Promise |
|
77 | + */ |
|
78 | + public function deleteAsync(array $params = []) |
|
79 | + { |
|
80 | + $this->checkRequiredParameters(['id'], $params); |
|
81 | + $url = '/_sql/async/delete/' . $this->encode($params['id']); |
|
82 | + $method = 'DELETE'; |
|
83 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
84 | + $headers = ['Accept' => 'application/json']; |
|
85 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
86 | + } |
|
87 | + /** |
|
88 | + * Returns the current status and available results for an async SQL search or stored synchronous SQL search |
|
89 | + * |
|
90 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html |
|
91 | + * |
|
92 | + * @param array{ |
|
93 | + * id: string, // (REQUIRED) The async search ID |
|
94 | + * delimiter: string, // Separator for CSV results |
|
95 | + * format: string, // Short version of the Accept header, e.g. json, yaml |
|
96 | + * keep_alive: time, // Retention period for the search and its results |
|
97 | + * wait_for_completion_timeout: time, // Duration to wait for complete results |
|
98 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
99 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
100 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
101 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
102 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
103 | + * } $params |
|
104 | + * |
|
105 | + * @throws MissingParameterException if a required parameter is missing |
|
106 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
107 | + * @throws ClientResponseException if the status code of response is 4xx |
|
108 | + * @throws ServerResponseException if the status code of response is 5xx |
|
109 | + * |
|
110 | + * @return Elasticsearch|Promise |
|
111 | + */ |
|
112 | + public function getAsync(array $params = []) |
|
113 | + { |
|
114 | + $this->checkRequiredParameters(['id'], $params); |
|
115 | + $url = '/_sql/async/' . $this->encode($params['id']); |
|
116 | + $method = 'GET'; |
|
117 | + $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
118 | + $headers = ['Accept' => 'application/json']; |
|
119 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
120 | + } |
|
121 | + /** |
|
122 | + * Returns the current status of an async SQL search or a stored synchronous SQL search |
|
123 | + * |
|
124 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html |
|
125 | + * |
|
126 | + * @param array{ |
|
127 | + * id: string, // (REQUIRED) The async search ID |
|
128 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | + * } $params |
|
134 | + * |
|
135 | + * @throws MissingParameterException if a required parameter is missing |
|
136 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
137 | + * @throws ClientResponseException if the status code of response is 4xx |
|
138 | + * @throws ServerResponseException if the status code of response is 5xx |
|
139 | + * |
|
140 | + * @return Elasticsearch|Promise |
|
141 | + */ |
|
142 | + public function getAsyncStatus(array $params = []) |
|
143 | + { |
|
144 | + $this->checkRequiredParameters(['id'], $params); |
|
145 | + $url = '/_sql/async/status/' . $this->encode($params['id']); |
|
146 | + $method = 'GET'; |
|
147 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
148 | + $headers = ['Accept' => 'application/json']; |
|
149 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
150 | + } |
|
151 | + /** |
|
152 | + * Executes a SQL request |
|
153 | + * |
|
154 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html |
|
155 | + * |
|
156 | + * @param array{ |
|
157 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
158 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
159 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
160 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
161 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
162 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
163 | + * body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query. |
|
164 | + * } $params |
|
165 | + * |
|
166 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | + * @throws ClientResponseException if the status code of response is 4xx |
|
168 | + * @throws ServerResponseException if the status code of response is 5xx |
|
169 | + * |
|
170 | + * @return Elasticsearch|Promise |
|
171 | + */ |
|
172 | + public function query(array $params = []) |
|
173 | + { |
|
174 | + $this->checkRequiredParameters(['body'], $params); |
|
175 | + $url = '/_sql'; |
|
176 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
177 | + $url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
180 | + } |
|
181 | + /** |
|
182 | + * Translates SQL into Elasticsearch queries |
|
183 | + * |
|
184 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html |
|
185 | + * |
|
186 | + * @param array{ |
|
187 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
188 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
189 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
190 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
191 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
192 | + * body: array, // (REQUIRED) Specify the query in the `query` element. |
|
193 | + * } $params |
|
194 | + * |
|
195 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
196 | + * @throws ClientResponseException if the status code of response is 4xx |
|
197 | + * @throws ServerResponseException if the status code of response is 5xx |
|
198 | + * |
|
199 | + * @return Elasticsearch|Promise |
|
200 | + */ |
|
201 | + public function translate(array $params = []) |
|
202 | + { |
|
203 | + $this->checkRequiredParameters(['body'], $params); |
|
204 | + $url = '/_sql/translate'; |
|
205 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
206 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
207 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
208 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
209 | + } |
|
210 | 210 | } |
@@ -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; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function deleteAsync(array $params = []) |
79 | 79 | { |
80 | 80 | $this->checkRequiredParameters(['id'], $params); |
81 | - $url = '/_sql/async/delete/' . $this->encode($params['id']); |
|
81 | + $url = '/_sql/async/delete/'.$this->encode($params['id']); |
|
82 | 82 | $method = 'DELETE'; |
83 | 83 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
84 | 84 | $headers = ['Accept' => 'application/json']; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function getAsync(array $params = []) |
113 | 113 | { |
114 | 114 | $this->checkRequiredParameters(['id'], $params); |
115 | - $url = '/_sql/async/' . $this->encode($params['id']); |
|
115 | + $url = '/_sql/async/'.$this->encode($params['id']); |
|
116 | 116 | $method = 'GET'; |
117 | 117 | $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
118 | 118 | $headers = ['Accept' => 'application/json']; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | public function getAsyncStatus(array $params = []) |
143 | 143 | { |
144 | 144 | $this->checkRequiredParameters(['id'], $params); |
145 | - $url = '/_sql/async/status/' . $this->encode($params['id']); |
|
145 | + $url = '/_sql/async/status/'.$this->encode($params['id']); |
|
146 | 146 | $method = 'GET'; |
147 | 147 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
148 | 148 | $headers = ['Accept' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Sql extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Sql extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Clears the SQL cursor |
30 | 29 | * |
@@ -25,103 +25,103 @@ |
||
25 | 25 | */ |
26 | 26 | class Esql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Executes an ESQL request asynchronously |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
36 | - * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
37 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
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 asyncQuery(array $params = []) |
|
53 | - { |
|
54 | - $this->checkRequiredParameters(['body'], $params); |
|
55 | - $url = '/_query/async'; |
|
56 | - $method = 'POST'; |
|
57 | - $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
59 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Retrieves the results of a previously submitted async query request given its ID. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * id: string, // (REQUIRED) The async query ID |
|
68 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
69 | - * keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available |
|
70 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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 | - * } $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 asyncQueryGet(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['id'], $params); |
|
88 | - $url = '/_query/async/' . $this->encode($params['id']); |
|
89 | - $method = 'GET'; |
|
90 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | - $headers = ['Accept' => 'application/json']; |
|
92 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
93 | - } |
|
94 | - /** |
|
95 | - * Executes an ESQL request |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html |
|
98 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
99 | - * |
|
100 | - * @param array{ |
|
101 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
102 | - * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
103 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
104 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
105 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
106 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
107 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
108 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
109 | - * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
110 | - * } $params |
|
111 | - * |
|
112 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | - * @throws ClientResponseException if the status code of response is 4xx |
|
114 | - * @throws ServerResponseException if the status code of response is 5xx |
|
115 | - * |
|
116 | - * @return Elasticsearch|Promise |
|
117 | - */ |
|
118 | - public function query(array $params = []) |
|
119 | - { |
|
120 | - $this->checkRequiredParameters(['body'], $params); |
|
121 | - $url = '/_query'; |
|
122 | - $method = 'POST'; |
|
123 | - $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
125 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
126 | - } |
|
28 | + /** |
|
29 | + * Executes an ESQL request asynchronously |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
36 | + * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
37 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
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 asyncQuery(array $params = []) |
|
53 | + { |
|
54 | + $this->checkRequiredParameters(['body'], $params); |
|
55 | + $url = '/_query/async'; |
|
56 | + $method = 'POST'; |
|
57 | + $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
59 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Retrieves the results of a previously submitted async query request given its ID. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * id: string, // (REQUIRED) The async query ID |
|
68 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
69 | + * keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available |
|
70 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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 | + * } $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 asyncQueryGet(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['id'], $params); |
|
88 | + $url = '/_query/async/' . $this->encode($params['id']); |
|
89 | + $method = 'GET'; |
|
90 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | + $headers = ['Accept' => 'application/json']; |
|
92 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
93 | + } |
|
94 | + /** |
|
95 | + * Executes an ESQL request |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html |
|
98 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
99 | + * |
|
100 | + * @param array{ |
|
101 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
102 | + * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
103 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
104 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
105 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
106 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
107 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
108 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
109 | + * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
110 | + * } $params |
|
111 | + * |
|
112 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | + * @throws ClientResponseException if the status code of response is 4xx |
|
114 | + * @throws ServerResponseException if the status code of response is 5xx |
|
115 | + * |
|
116 | + * @return Elasticsearch|Promise |
|
117 | + */ |
|
118 | + public function query(array $params = []) |
|
119 | + { |
|
120 | + $this->checkRequiredParameters(['body'], $params); |
|
121 | + $url = '/_query'; |
|
122 | + $method = 'POST'; |
|
123 | + $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
125 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
126 | + } |
|
127 | 127 | } |
@@ -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; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function asyncQueryGet(array $params = []) |
86 | 86 | { |
87 | 87 | $this->checkRequiredParameters(['id'], $params); |
88 | - $url = '/_query/async/' . $this->encode($params['id']); |
|
88 | + $url = '/_query/async/'.$this->encode($params['id']); |
|
89 | 89 | $method = 'GET'; |
90 | 90 | $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
91 | 91 | $headers = ['Accept' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Esql extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Esql extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Executes an ESQL request asynchronously |
30 | 29 | * |
@@ -25,399 +25,399 @@ |
||
25 | 25 | */ |
26 | 26 | class Ccr extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes auto-follow patterns. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws 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 deleteAutoFollowPattern(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['name'], $params); |
|
52 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | - } |
|
58 | - /** |
|
59 | - * Creates a new follower index configured to follow the referenced leader index. |
|
60 | - * |
|
61 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html |
|
62 | - * |
|
63 | - * @param array{ |
|
64 | - * index: string, // (REQUIRED) The name of the follower index |
|
65 | - * wait_for_active_shards: string, // Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) |
|
66 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
67 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
68 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
69 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
70 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
71 | - * body: array, // (REQUIRED) The name of the leader index and other optional ccr related parameters |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws MissingParameterException if a required parameter is missing |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function follow(array $params = []) |
|
82 | - { |
|
83 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
84 | - $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
85 | - $method = 'PUT'; |
|
86 | - $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
88 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | - } |
|
90 | - /** |
|
91 | - * Retrieves information about all follower indices, including parameters and status for each follower index |
|
92 | - * |
|
93 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html |
|
94 | - * |
|
95 | - * @param array{ |
|
96 | - * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
97 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
98 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
99 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
100 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
101 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
102 | - * } $params |
|
103 | - * |
|
104 | - * @throws MissingParameterException if a required parameter is missing |
|
105 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | - * @throws ClientResponseException if the status code of response is 4xx |
|
107 | - * @throws ServerResponseException if the status code of response is 5xx |
|
108 | - * |
|
109 | - * @return Elasticsearch|Promise |
|
110 | - */ |
|
111 | - public function followInfo(array $params = []) |
|
112 | - { |
|
113 | - $this->checkRequiredParameters(['index'], $params); |
|
114 | - $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
115 | - $method = 'GET'; |
|
116 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | - $headers = ['Accept' => 'application/json']; |
|
118 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | - } |
|
120 | - /** |
|
121 | - * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. |
|
122 | - * |
|
123 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html |
|
124 | - * |
|
125 | - * @param array{ |
|
126 | - * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
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 MissingParameterException if a required parameter is missing |
|
135 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | - * @throws ClientResponseException if the status code of response is 4xx |
|
137 | - * @throws ServerResponseException if the status code of response is 5xx |
|
138 | - * |
|
139 | - * @return Elasticsearch|Promise |
|
140 | - */ |
|
141 | - public function followStats(array $params = []) |
|
142 | - { |
|
143 | - $this->checkRequiredParameters(['index'], $params); |
|
144 | - $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
145 | - $method = 'GET'; |
|
146 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
147 | - $headers = ['Accept' => 'application/json']; |
|
148 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
149 | - } |
|
150 | - /** |
|
151 | - * Removes the follower retention leases from the leader. |
|
152 | - * |
|
153 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html |
|
154 | - * |
|
155 | - * @param array{ |
|
156 | - * index: string, // (REQUIRED) the name of the leader index for which specified follower retention leases should be removed |
|
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, // (REQUIRED) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index |
|
163 | - * } $params |
|
164 | - * |
|
165 | - * @throws MissingParameterException if a required parameter is missing |
|
166 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | - * @throws ClientResponseException if the status code of response is 4xx |
|
168 | - * @throws ServerResponseException if the status code of response is 5xx |
|
169 | - * |
|
170 | - * @return Elasticsearch|Promise |
|
171 | - */ |
|
172 | - public function forgetFollower(array $params = []) |
|
173 | - { |
|
174 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
175 | - $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
176 | - $method = 'POST'; |
|
177 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
180 | - } |
|
181 | - /** |
|
182 | - * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. |
|
183 | - * |
|
184 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html |
|
185 | - * |
|
186 | - * @param array{ |
|
187 | - * name: string, // The name of the auto follow pattern. |
|
188 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
189 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
190 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
191 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
192 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
193 | - * } $params |
|
194 | - * |
|
195 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
196 | - * @throws ClientResponseException if the status code of response is 4xx |
|
197 | - * @throws ServerResponseException if the status code of response is 5xx |
|
198 | - * |
|
199 | - * @return Elasticsearch|Promise |
|
200 | - */ |
|
201 | - public function getAutoFollowPattern(array $params = []) |
|
202 | - { |
|
203 | - if (isset($params['name'])) { |
|
204 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
205 | - $method = 'GET'; |
|
206 | - } else { |
|
207 | - $url = '/_ccr/auto_follow'; |
|
208 | - $method = 'GET'; |
|
209 | - } |
|
210 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
211 | - $headers = ['Accept' => 'application/json']; |
|
212 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
213 | - } |
|
214 | - /** |
|
215 | - * Pauses an auto-follow pattern |
|
216 | - * |
|
217 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html |
|
218 | - * |
|
219 | - * @param array{ |
|
220 | - * name: string, // (REQUIRED) The name of the auto follow pattern that should pause discovering new indices to follow. |
|
221 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
222 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
223 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
224 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
225 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
226 | - * } $params |
|
227 | - * |
|
228 | - * @throws MissingParameterException if a required parameter is missing |
|
229 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
230 | - * @throws ClientResponseException if the status code of response is 4xx |
|
231 | - * @throws ServerResponseException if the status code of response is 5xx |
|
232 | - * |
|
233 | - * @return Elasticsearch|Promise |
|
234 | - */ |
|
235 | - public function pauseAutoFollowPattern(array $params = []) |
|
236 | - { |
|
237 | - $this->checkRequiredParameters(['name'], $params); |
|
238 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
239 | - $method = 'POST'; |
|
240 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | - $headers = ['Accept' => 'application/json']; |
|
242 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
243 | - } |
|
244 | - /** |
|
245 | - * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. |
|
246 | - * |
|
247 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html |
|
248 | - * |
|
249 | - * @param array{ |
|
250 | - * index: string, // (REQUIRED) The name of the follower index that should pause following its leader index. |
|
251 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
252 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
253 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
254 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
255 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
256 | - * } $params |
|
257 | - * |
|
258 | - * @throws MissingParameterException if a required parameter is missing |
|
259 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
260 | - * @throws ClientResponseException if the status code of response is 4xx |
|
261 | - * @throws ServerResponseException if the status code of response is 5xx |
|
262 | - * |
|
263 | - * @return Elasticsearch|Promise |
|
264 | - */ |
|
265 | - public function pauseFollow(array $params = []) |
|
266 | - { |
|
267 | - $this->checkRequiredParameters(['index'], $params); |
|
268 | - $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
269 | - $method = 'POST'; |
|
270 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
271 | - $headers = ['Accept' => 'application/json']; |
|
272 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
273 | - } |
|
274 | - /** |
|
275 | - * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. |
|
276 | - * |
|
277 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html |
|
278 | - * |
|
279 | - * @param array{ |
|
280 | - * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
281 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
282 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
283 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
284 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
285 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
286 | - * body: array, // (REQUIRED) The specification of the auto follow pattern |
|
287 | - * } $params |
|
288 | - * |
|
289 | - * @throws MissingParameterException if a required parameter is missing |
|
290 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
291 | - * @throws ClientResponseException if the status code of response is 4xx |
|
292 | - * @throws ServerResponseException if the status code of response is 5xx |
|
293 | - * |
|
294 | - * @return Elasticsearch|Promise |
|
295 | - */ |
|
296 | - public function putAutoFollowPattern(array $params = []) |
|
297 | - { |
|
298 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
299 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
300 | - $method = 'PUT'; |
|
301 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
302 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
303 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
304 | - } |
|
305 | - /** |
|
306 | - * Resumes an auto-follow pattern that has been paused |
|
307 | - * |
|
308 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html |
|
309 | - * |
|
310 | - * @param array{ |
|
311 | - * name: string, // (REQUIRED) The name of the auto follow pattern to resume discovering new indices to follow. |
|
312 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
313 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
314 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
315 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
316 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
317 | - * } $params |
|
318 | - * |
|
319 | - * @throws MissingParameterException if a required parameter is missing |
|
320 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
321 | - * @throws ClientResponseException if the status code of response is 4xx |
|
322 | - * @throws ServerResponseException if the status code of response is 5xx |
|
323 | - * |
|
324 | - * @return Elasticsearch|Promise |
|
325 | - */ |
|
326 | - public function resumeAutoFollowPattern(array $params = []) |
|
327 | - { |
|
328 | - $this->checkRequiredParameters(['name'], $params); |
|
329 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
330 | - $method = 'POST'; |
|
331 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
332 | - $headers = ['Accept' => 'application/json']; |
|
333 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
334 | - } |
|
335 | - /** |
|
336 | - * Resumes a follower index that has been paused |
|
337 | - * |
|
338 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html |
|
339 | - * |
|
340 | - * @param array{ |
|
341 | - * index: string, // (REQUIRED) The name of the follow index to resume following. |
|
342 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
343 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
344 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
345 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
346 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
347 | - * body: array, // The name of the leader index and other optional ccr related parameters |
|
348 | - * } $params |
|
349 | - * |
|
350 | - * @throws MissingParameterException if a required parameter is missing |
|
351 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
352 | - * @throws ClientResponseException if the status code of response is 4xx |
|
353 | - * @throws ServerResponseException if the status code of response is 5xx |
|
354 | - * |
|
355 | - * @return Elasticsearch|Promise |
|
356 | - */ |
|
357 | - public function resumeFollow(array $params = []) |
|
358 | - { |
|
359 | - $this->checkRequiredParameters(['index'], $params); |
|
360 | - $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
361 | - $method = 'POST'; |
|
362 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
363 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
364 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
365 | - } |
|
366 | - /** |
|
367 | - * Gets all stats related to cross-cluster replication. |
|
368 | - * |
|
369 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html |
|
370 | - * |
|
371 | - * @param array{ |
|
372 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
373 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
374 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
375 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
376 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
377 | - * } $params |
|
378 | - * |
|
379 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
380 | - * @throws ClientResponseException if the status code of response is 4xx |
|
381 | - * @throws ServerResponseException if the status code of response is 5xx |
|
382 | - * |
|
383 | - * @return Elasticsearch|Promise |
|
384 | - */ |
|
385 | - public function stats(array $params = []) |
|
386 | - { |
|
387 | - $url = '/_ccr/stats'; |
|
388 | - $method = 'GET'; |
|
389 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
390 | - $headers = ['Accept' => 'application/json']; |
|
391 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
392 | - } |
|
393 | - /** |
|
394 | - * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. |
|
395 | - * |
|
396 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html |
|
397 | - * |
|
398 | - * @param array{ |
|
399 | - * index: string, // (REQUIRED) The name of the follower index that should be turned into a regular index. |
|
400 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
401 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
402 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
403 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
404 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
405 | - * } $params |
|
406 | - * |
|
407 | - * @throws MissingParameterException if a required parameter is missing |
|
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 unfollow(array $params = []) |
|
415 | - { |
|
416 | - $this->checkRequiredParameters(['index'], $params); |
|
417 | - $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
418 | - $method = 'POST'; |
|
419 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
420 | - $headers = ['Accept' => 'application/json']; |
|
421 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
422 | - } |
|
28 | + /** |
|
29 | + * Deletes auto-follow patterns. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws 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 deleteAutoFollowPattern(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['name'], $params); |
|
52 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | + } |
|
58 | + /** |
|
59 | + * Creates a new follower index configured to follow the referenced leader index. |
|
60 | + * |
|
61 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html |
|
62 | + * |
|
63 | + * @param array{ |
|
64 | + * index: string, // (REQUIRED) The name of the follower index |
|
65 | + * wait_for_active_shards: string, // Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) |
|
66 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
67 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
68 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
69 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
70 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
71 | + * body: array, // (REQUIRED) The name of the leader index and other optional ccr related parameters |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws MissingParameterException if a required parameter is missing |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function follow(array $params = []) |
|
82 | + { |
|
83 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
84 | + $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
85 | + $method = 'PUT'; |
|
86 | + $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
88 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | + } |
|
90 | + /** |
|
91 | + * Retrieves information about all follower indices, including parameters and status for each follower index |
|
92 | + * |
|
93 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html |
|
94 | + * |
|
95 | + * @param array{ |
|
96 | + * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
97 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
98 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
99 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
100 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
101 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
102 | + * } $params |
|
103 | + * |
|
104 | + * @throws MissingParameterException if a required parameter is missing |
|
105 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | + * @throws ClientResponseException if the status code of response is 4xx |
|
107 | + * @throws ServerResponseException if the status code of response is 5xx |
|
108 | + * |
|
109 | + * @return Elasticsearch|Promise |
|
110 | + */ |
|
111 | + public function followInfo(array $params = []) |
|
112 | + { |
|
113 | + $this->checkRequiredParameters(['index'], $params); |
|
114 | + $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
115 | + $method = 'GET'; |
|
116 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | + $headers = ['Accept' => 'application/json']; |
|
118 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | + } |
|
120 | + /** |
|
121 | + * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. |
|
122 | + * |
|
123 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html |
|
124 | + * |
|
125 | + * @param array{ |
|
126 | + * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
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 MissingParameterException if a required parameter is missing |
|
135 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | + * @throws ClientResponseException if the status code of response is 4xx |
|
137 | + * @throws ServerResponseException if the status code of response is 5xx |
|
138 | + * |
|
139 | + * @return Elasticsearch|Promise |
|
140 | + */ |
|
141 | + public function followStats(array $params = []) |
|
142 | + { |
|
143 | + $this->checkRequiredParameters(['index'], $params); |
|
144 | + $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
145 | + $method = 'GET'; |
|
146 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
147 | + $headers = ['Accept' => 'application/json']; |
|
148 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
149 | + } |
|
150 | + /** |
|
151 | + * Removes the follower retention leases from the leader. |
|
152 | + * |
|
153 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html |
|
154 | + * |
|
155 | + * @param array{ |
|
156 | + * index: string, // (REQUIRED) the name of the leader index for which specified follower retention leases should be removed |
|
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, // (REQUIRED) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index |
|
163 | + * } $params |
|
164 | + * |
|
165 | + * @throws MissingParameterException if a required parameter is missing |
|
166 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | + * @throws ClientResponseException if the status code of response is 4xx |
|
168 | + * @throws ServerResponseException if the status code of response is 5xx |
|
169 | + * |
|
170 | + * @return Elasticsearch|Promise |
|
171 | + */ |
|
172 | + public function forgetFollower(array $params = []) |
|
173 | + { |
|
174 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
175 | + $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
176 | + $method = 'POST'; |
|
177 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
180 | + } |
|
181 | + /** |
|
182 | + * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. |
|
183 | + * |
|
184 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html |
|
185 | + * |
|
186 | + * @param array{ |
|
187 | + * name: string, // The name of the auto follow pattern. |
|
188 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
189 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
190 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
191 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
192 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
193 | + * } $params |
|
194 | + * |
|
195 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
196 | + * @throws ClientResponseException if the status code of response is 4xx |
|
197 | + * @throws ServerResponseException if the status code of response is 5xx |
|
198 | + * |
|
199 | + * @return Elasticsearch|Promise |
|
200 | + */ |
|
201 | + public function getAutoFollowPattern(array $params = []) |
|
202 | + { |
|
203 | + if (isset($params['name'])) { |
|
204 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
205 | + $method = 'GET'; |
|
206 | + } else { |
|
207 | + $url = '/_ccr/auto_follow'; |
|
208 | + $method = 'GET'; |
|
209 | + } |
|
210 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
211 | + $headers = ['Accept' => 'application/json']; |
|
212 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
213 | + } |
|
214 | + /** |
|
215 | + * Pauses an auto-follow pattern |
|
216 | + * |
|
217 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html |
|
218 | + * |
|
219 | + * @param array{ |
|
220 | + * name: string, // (REQUIRED) The name of the auto follow pattern that should pause discovering new indices to follow. |
|
221 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
222 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
223 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
224 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
225 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
226 | + * } $params |
|
227 | + * |
|
228 | + * @throws MissingParameterException if a required parameter is missing |
|
229 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
230 | + * @throws ClientResponseException if the status code of response is 4xx |
|
231 | + * @throws ServerResponseException if the status code of response is 5xx |
|
232 | + * |
|
233 | + * @return Elasticsearch|Promise |
|
234 | + */ |
|
235 | + public function pauseAutoFollowPattern(array $params = []) |
|
236 | + { |
|
237 | + $this->checkRequiredParameters(['name'], $params); |
|
238 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
239 | + $method = 'POST'; |
|
240 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | + $headers = ['Accept' => 'application/json']; |
|
242 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
243 | + } |
|
244 | + /** |
|
245 | + * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. |
|
246 | + * |
|
247 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html |
|
248 | + * |
|
249 | + * @param array{ |
|
250 | + * index: string, // (REQUIRED) The name of the follower index that should pause following its leader index. |
|
251 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
252 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
253 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
254 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
255 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
256 | + * } $params |
|
257 | + * |
|
258 | + * @throws MissingParameterException if a required parameter is missing |
|
259 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
260 | + * @throws ClientResponseException if the status code of response is 4xx |
|
261 | + * @throws ServerResponseException if the status code of response is 5xx |
|
262 | + * |
|
263 | + * @return Elasticsearch|Promise |
|
264 | + */ |
|
265 | + public function pauseFollow(array $params = []) |
|
266 | + { |
|
267 | + $this->checkRequiredParameters(['index'], $params); |
|
268 | + $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
269 | + $method = 'POST'; |
|
270 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
271 | + $headers = ['Accept' => 'application/json']; |
|
272 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
273 | + } |
|
274 | + /** |
|
275 | + * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. |
|
276 | + * |
|
277 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html |
|
278 | + * |
|
279 | + * @param array{ |
|
280 | + * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
281 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
282 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
283 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
284 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
285 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
286 | + * body: array, // (REQUIRED) The specification of the auto follow pattern |
|
287 | + * } $params |
|
288 | + * |
|
289 | + * @throws MissingParameterException if a required parameter is missing |
|
290 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
291 | + * @throws ClientResponseException if the status code of response is 4xx |
|
292 | + * @throws ServerResponseException if the status code of response is 5xx |
|
293 | + * |
|
294 | + * @return Elasticsearch|Promise |
|
295 | + */ |
|
296 | + public function putAutoFollowPattern(array $params = []) |
|
297 | + { |
|
298 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
299 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
300 | + $method = 'PUT'; |
|
301 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
302 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
303 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
304 | + } |
|
305 | + /** |
|
306 | + * Resumes an auto-follow pattern that has been paused |
|
307 | + * |
|
308 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html |
|
309 | + * |
|
310 | + * @param array{ |
|
311 | + * name: string, // (REQUIRED) The name of the auto follow pattern to resume discovering new indices to follow. |
|
312 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
313 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
314 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
315 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
316 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
317 | + * } $params |
|
318 | + * |
|
319 | + * @throws MissingParameterException if a required parameter is missing |
|
320 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
321 | + * @throws ClientResponseException if the status code of response is 4xx |
|
322 | + * @throws ServerResponseException if the status code of response is 5xx |
|
323 | + * |
|
324 | + * @return Elasticsearch|Promise |
|
325 | + */ |
|
326 | + public function resumeAutoFollowPattern(array $params = []) |
|
327 | + { |
|
328 | + $this->checkRequiredParameters(['name'], $params); |
|
329 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
330 | + $method = 'POST'; |
|
331 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
332 | + $headers = ['Accept' => 'application/json']; |
|
333 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
334 | + } |
|
335 | + /** |
|
336 | + * Resumes a follower index that has been paused |
|
337 | + * |
|
338 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html |
|
339 | + * |
|
340 | + * @param array{ |
|
341 | + * index: string, // (REQUIRED) The name of the follow index to resume following. |
|
342 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
343 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
344 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
345 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
346 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
347 | + * body: array, // The name of the leader index and other optional ccr related parameters |
|
348 | + * } $params |
|
349 | + * |
|
350 | + * @throws MissingParameterException if a required parameter is missing |
|
351 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
352 | + * @throws ClientResponseException if the status code of response is 4xx |
|
353 | + * @throws ServerResponseException if the status code of response is 5xx |
|
354 | + * |
|
355 | + * @return Elasticsearch|Promise |
|
356 | + */ |
|
357 | + public function resumeFollow(array $params = []) |
|
358 | + { |
|
359 | + $this->checkRequiredParameters(['index'], $params); |
|
360 | + $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
361 | + $method = 'POST'; |
|
362 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
363 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
364 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
365 | + } |
|
366 | + /** |
|
367 | + * Gets all stats related to cross-cluster replication. |
|
368 | + * |
|
369 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html |
|
370 | + * |
|
371 | + * @param array{ |
|
372 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
373 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
374 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
375 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
376 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
377 | + * } $params |
|
378 | + * |
|
379 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
380 | + * @throws ClientResponseException if the status code of response is 4xx |
|
381 | + * @throws ServerResponseException if the status code of response is 5xx |
|
382 | + * |
|
383 | + * @return Elasticsearch|Promise |
|
384 | + */ |
|
385 | + public function stats(array $params = []) |
|
386 | + { |
|
387 | + $url = '/_ccr/stats'; |
|
388 | + $method = 'GET'; |
|
389 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
390 | + $headers = ['Accept' => 'application/json']; |
|
391 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
392 | + } |
|
393 | + /** |
|
394 | + * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. |
|
395 | + * |
|
396 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html |
|
397 | + * |
|
398 | + * @param array{ |
|
399 | + * index: string, // (REQUIRED) The name of the follower index that should be turned into a regular index. |
|
400 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
401 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
402 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
403 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
404 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
405 | + * } $params |
|
406 | + * |
|
407 | + * @throws MissingParameterException if a required parameter is missing |
|
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 unfollow(array $params = []) |
|
415 | + { |
|
416 | + $this->checkRequiredParameters(['index'], $params); |
|
417 | + $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
418 | + $method = 'POST'; |
|
419 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
420 | + $headers = ['Accept' => 'application/json']; |
|
421 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
422 | + } |
|
423 | 423 | } |
@@ -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 deleteAutoFollowPattern(array $params = []) |
50 | 50 | { |
51 | 51 | $this->checkRequiredParameters(['name'], $params); |
52 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
52 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
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 follow(array $params = []) |
82 | 82 | { |
83 | 83 | $this->checkRequiredParameters(['index', 'body'], $params); |
84 | - $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
84 | + $url = '/'.$this->encode($params['index']).'/_ccr/follow'; |
|
85 | 85 | $method = 'PUT'; |
86 | 86 | $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
87 | 87 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function followInfo(array $params = []) |
112 | 112 | { |
113 | 113 | $this->checkRequiredParameters(['index'], $params); |
114 | - $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
114 | + $url = '/'.$this->encode($params['index']).'/_ccr/info'; |
|
115 | 115 | $method = 'GET'; |
116 | 116 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
117 | 117 | $headers = ['Accept' => 'application/json']; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function followStats(array $params = []) |
142 | 142 | { |
143 | 143 | $this->checkRequiredParameters(['index'], $params); |
144 | - $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
144 | + $url = '/'.$this->encode($params['index']).'/_ccr/stats'; |
|
145 | 145 | $method = 'GET'; |
146 | 146 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
147 | 147 | $headers = ['Accept' => 'application/json']; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | public function forgetFollower(array $params = []) |
173 | 173 | { |
174 | 174 | $this->checkRequiredParameters(['index', 'body'], $params); |
175 | - $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
175 | + $url = '/'.$this->encode($params['index']).'/_ccr/forget_follower'; |
|
176 | 176 | $method = 'POST'; |
177 | 177 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
178 | 178 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function getAutoFollowPattern(array $params = []) |
202 | 202 | { |
203 | 203 | if (isset($params['name'])) { |
204 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
204 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
205 | 205 | $method = 'GET'; |
206 | 206 | } else { |
207 | 207 | $url = '/_ccr/auto_follow'; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | public function pauseAutoFollowPattern(array $params = []) |
236 | 236 | { |
237 | 237 | $this->checkRequiredParameters(['name'], $params); |
238 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
238 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']).'/pause'; |
|
239 | 239 | $method = 'POST'; |
240 | 240 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
241 | 241 | $headers = ['Accept' => 'application/json']; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | public function pauseFollow(array $params = []) |
266 | 266 | { |
267 | 267 | $this->checkRequiredParameters(['index'], $params); |
268 | - $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
268 | + $url = '/'.$this->encode($params['index']).'/_ccr/pause_follow'; |
|
269 | 269 | $method = 'POST'; |
270 | 270 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
271 | 271 | $headers = ['Accept' => 'application/json']; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | public function putAutoFollowPattern(array $params = []) |
297 | 297 | { |
298 | 298 | $this->checkRequiredParameters(['name', 'body'], $params); |
299 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
299 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
300 | 300 | $method = 'PUT'; |
301 | 301 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
302 | 302 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | public function resumeAutoFollowPattern(array $params = []) |
327 | 327 | { |
328 | 328 | $this->checkRequiredParameters(['name'], $params); |
329 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
329 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']).'/resume'; |
|
330 | 330 | $method = 'POST'; |
331 | 331 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
332 | 332 | $headers = ['Accept' => 'application/json']; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | public function resumeFollow(array $params = []) |
358 | 358 | { |
359 | 359 | $this->checkRequiredParameters(['index'], $params); |
360 | - $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
360 | + $url = '/'.$this->encode($params['index']).'/_ccr/resume_follow'; |
|
361 | 361 | $method = 'POST'; |
362 | 362 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
363 | 363 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | public function unfollow(array $params = []) |
415 | 415 | { |
416 | 416 | $this->checkRequiredParameters(['index'], $params); |
417 | - $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
417 | + $url = '/'.$this->encode($params['index']).'/_ccr/unfollow'; |
|
418 | 418 | $method = 'POST'; |
419 | 419 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
420 | 420 | $headers = ['Accept' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Ccr extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Ccr extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes auto-follow patterns. |
30 | 29 | * |
@@ -25,130 +25,130 @@ |
||
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 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | - } |
|
58 | - /** |
|
59 | - * Returns async results from previously executed Event Query Language (EQL) search |
|
60 | - * |
|
61 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
62 | - * |
|
63 | - * @param array{ |
|
64 | - * id: string, // (REQUIRED) The async search ID |
|
65 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
66 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 MissingParameterException if a required parameter is missing |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function get(array $params = []) |
|
82 | - { |
|
83 | - $this->checkRequiredParameters(['id'], $params); |
|
84 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
85 | - $method = 'GET'; |
|
86 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json']; |
|
88 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | - } |
|
90 | - /** |
|
91 | - * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
92 | - * |
|
93 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
94 | - * |
|
95 | - * @param array{ |
|
96 | - * id: string, // (REQUIRED) The async search ID |
|
97 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
98 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
99 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
100 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
101 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
102 | - * } $params |
|
103 | - * |
|
104 | - * @throws MissingParameterException if a required parameter is missing |
|
105 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | - * @throws ClientResponseException if the status code of response is 4xx |
|
107 | - * @throws ServerResponseException if the status code of response is 5xx |
|
108 | - * |
|
109 | - * @return Elasticsearch|Promise |
|
110 | - */ |
|
111 | - public function getStatus(array $params = []) |
|
112 | - { |
|
113 | - $this->checkRequiredParameters(['id'], $params); |
|
114 | - $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
115 | - $method = 'GET'; |
|
116 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | - $headers = ['Accept' => 'application/json']; |
|
118 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | - } |
|
120 | - /** |
|
121 | - * Returns results matching a query expressed in Event Query Language (EQL) |
|
122 | - * |
|
123 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
124 | - * |
|
125 | - * @param array{ |
|
126 | - * index: string, // (REQUIRED) The name of the index to scope the operation |
|
127 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
128 | - * 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) |
|
129 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
130 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
131 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
132 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
133 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
134 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
135 | - * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
136 | - * } $params |
|
137 | - * |
|
138 | - * @throws MissingParameterException if a required parameter is missing |
|
139 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
140 | - * @throws ClientResponseException if the status code of response is 4xx |
|
141 | - * @throws ServerResponseException if the status code of response is 5xx |
|
142 | - * |
|
143 | - * @return Elasticsearch|Promise |
|
144 | - */ |
|
145 | - public function search(array $params = []) |
|
146 | - { |
|
147 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
148 | - $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
149 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
150 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
152 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
153 | - } |
|
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 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | + } |
|
58 | + /** |
|
59 | + * Returns async results from previously executed Event Query Language (EQL) search |
|
60 | + * |
|
61 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
62 | + * |
|
63 | + * @param array{ |
|
64 | + * id: string, // (REQUIRED) The async search ID |
|
65 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
66 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
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 MissingParameterException if a required parameter is missing |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function get(array $params = []) |
|
82 | + { |
|
83 | + $this->checkRequiredParameters(['id'], $params); |
|
84 | + $url = '/_eql/search/' . $this->encode($params['id']); |
|
85 | + $method = 'GET'; |
|
86 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json']; |
|
88 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | + } |
|
90 | + /** |
|
91 | + * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
92 | + * |
|
93 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
94 | + * |
|
95 | + * @param array{ |
|
96 | + * id: string, // (REQUIRED) The async search ID |
|
97 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
98 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
99 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
100 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
101 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
102 | + * } $params |
|
103 | + * |
|
104 | + * @throws MissingParameterException if a required parameter is missing |
|
105 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | + * @throws ClientResponseException if the status code of response is 4xx |
|
107 | + * @throws ServerResponseException if the status code of response is 5xx |
|
108 | + * |
|
109 | + * @return Elasticsearch|Promise |
|
110 | + */ |
|
111 | + public function getStatus(array $params = []) |
|
112 | + { |
|
113 | + $this->checkRequiredParameters(['id'], $params); |
|
114 | + $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
115 | + $method = 'GET'; |
|
116 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | + $headers = ['Accept' => 'application/json']; |
|
118 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | + } |
|
120 | + /** |
|
121 | + * Returns results matching a query expressed in Event Query Language (EQL) |
|
122 | + * |
|
123 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
124 | + * |
|
125 | + * @param array{ |
|
126 | + * index: string, // (REQUIRED) The name of the index to scope the operation |
|
127 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
128 | + * 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) |
|
129 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
130 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
131 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
132 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
133 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
134 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
135 | + * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
136 | + * } $params |
|
137 | + * |
|
138 | + * @throws MissingParameterException if a required parameter is missing |
|
139 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
140 | + * @throws ClientResponseException if the status code of response is 4xx |
|
141 | + * @throws ServerResponseException if the status code of response is 5xx |
|
142 | + * |
|
143 | + * @return Elasticsearch|Promise |
|
144 | + */ |
|
145 | + public function search(array $params = []) |
|
146 | + { |
|
147 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
148 | + $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
149 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
150 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
152 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
153 | + } |
|
154 | 154 | } |
@@ -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,42 +25,42 @@ |
||
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 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
65 | - } |
|
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 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
65 | + } |
|
66 | 66 | } |
@@ -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,2451 +25,2451 @@ |
||
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 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | - } |
|
58 | - /** |
|
59 | - * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. |
|
60 | - * |
|
61 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html |
|
62 | - * |
|
63 | - * @param array{ |
|
64 | - * job_id: string, // (REQUIRED) The name of the job to close |
|
65 | - * 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) |
|
66 | - * force: boolean, // True if the job should be forcefully closed |
|
67 | - * timeout: time, // Controls the time to wait until a job has closed. Default to 30 minutes |
|
68 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | - * body: array, // The URL params optionally sent in the body |
|
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 closeJob(array $params = []) |
|
84 | - { |
|
85 | - $this->checkRequiredParameters(['job_id'], $params); |
|
86 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
87 | - $method = 'POST'; |
|
88 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
90 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
91 | - } |
|
92 | - /** |
|
93 | - * Deletes a calendar. |
|
94 | - * |
|
95 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html |
|
96 | - * |
|
97 | - * @param array{ |
|
98 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to delete |
|
99 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
100 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
101 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
102 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
103 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
104 | - * } $params |
|
105 | - * |
|
106 | - * @throws MissingParameterException if a required parameter is missing |
|
107 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
108 | - * @throws ClientResponseException if the status code of response is 4xx |
|
109 | - * @throws ServerResponseException if the status code of response is 5xx |
|
110 | - * |
|
111 | - * @return Elasticsearch|Promise |
|
112 | - */ |
|
113 | - public function deleteCalendar(array $params = []) |
|
114 | - { |
|
115 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
116 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
117 | - $method = 'DELETE'; |
|
118 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
119 | - $headers = ['Accept' => 'application/json']; |
|
120 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
121 | - } |
|
122 | - /** |
|
123 | - * Deletes scheduled events from a calendar. |
|
124 | - * |
|
125 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html |
|
126 | - * |
|
127 | - * @param array{ |
|
128 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
129 | - * event_id: string, // (REQUIRED) The ID of the event to remove from the calendar |
|
130 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
131 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
132 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
133 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
134 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
135 | - * } $params |
|
136 | - * |
|
137 | - * @throws MissingParameterException if a required parameter is missing |
|
138 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
139 | - * @throws ClientResponseException if the status code of response is 4xx |
|
140 | - * @throws ServerResponseException if the status code of response is 5xx |
|
141 | - * |
|
142 | - * @return Elasticsearch|Promise |
|
143 | - */ |
|
144 | - public function deleteCalendarEvent(array $params = []) |
|
145 | - { |
|
146 | - $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
|
147 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
148 | - $method = 'DELETE'; |
|
149 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | - $headers = ['Accept' => 'application/json']; |
|
151 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
152 | - } |
|
153 | - /** |
|
154 | - * Deletes anomaly detection jobs from a calendar. |
|
155 | - * |
|
156 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html |
|
157 | - * |
|
158 | - * @param array{ |
|
159 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
160 | - * job_id: string, // (REQUIRED) The ID of the job to remove from the calendar |
|
161 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
162 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
163 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
164 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
165 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
166 | - * } $params |
|
167 | - * |
|
168 | - * @throws MissingParameterException if a required parameter is missing |
|
169 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | - * @throws ClientResponseException if the status code of response is 4xx |
|
171 | - * @throws ServerResponseException if the status code of response is 5xx |
|
172 | - * |
|
173 | - * @return Elasticsearch|Promise |
|
174 | - */ |
|
175 | - public function deleteCalendarJob(array $params = []) |
|
176 | - { |
|
177 | - $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
178 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
179 | - $method = 'DELETE'; |
|
180 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
181 | - $headers = ['Accept' => 'application/json']; |
|
182 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
183 | - } |
|
184 | - /** |
|
185 | - * Deletes an existing data frame analytics job. |
|
186 | - * |
|
187 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html |
|
188 | - * |
|
189 | - * @param array{ |
|
190 | - * id: string, // (REQUIRED) The ID of the data frame analytics to delete |
|
191 | - * force: boolean, // True if the job should be forcefully deleted |
|
192 | - * timeout: time, // Controls the time to wait until a job is deleted. Defaults to 1 minute |
|
193 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
194 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
195 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
196 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
197 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
198 | - * } $params |
|
199 | - * |
|
200 | - * @throws MissingParameterException if a required parameter is missing |
|
201 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
202 | - * @throws ClientResponseException if the status code of response is 4xx |
|
203 | - * @throws ServerResponseException if the status code of response is 5xx |
|
204 | - * |
|
205 | - * @return Elasticsearch|Promise |
|
206 | - */ |
|
207 | - public function deleteDataFrameAnalytics(array $params = []) |
|
208 | - { |
|
209 | - $this->checkRequiredParameters(['id'], $params); |
|
210 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
211 | - $method = 'DELETE'; |
|
212 | - $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
213 | - $headers = ['Accept' => 'application/json']; |
|
214 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
215 | - } |
|
216 | - /** |
|
217 | - * Deletes an existing datafeed. |
|
218 | - * |
|
219 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html |
|
220 | - * |
|
221 | - * @param array{ |
|
222 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to delete |
|
223 | - * force: boolean, // True if the datafeed should be forcefully deleted |
|
224 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
225 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
226 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
227 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
228 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
229 | - * } $params |
|
230 | - * |
|
231 | - * @throws MissingParameterException if a required parameter is missing |
|
232 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
233 | - * @throws ClientResponseException if the status code of response is 4xx |
|
234 | - * @throws ServerResponseException if the status code of response is 5xx |
|
235 | - * |
|
236 | - * @return Elasticsearch|Promise |
|
237 | - */ |
|
238 | - public function deleteDatafeed(array $params = []) |
|
239 | - { |
|
240 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
241 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
242 | - $method = 'DELETE'; |
|
243 | - $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
244 | - $headers = ['Accept' => 'application/json']; |
|
245 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
246 | - } |
|
247 | - /** |
|
248 | - * Deletes expired and unused machine learning data. |
|
249 | - * |
|
250 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html |
|
251 | - * |
|
252 | - * @param array{ |
|
253 | - * job_id: string, // The ID of the job(s) to perform expired data hygiene for |
|
254 | - * requests_per_second: number, // The desired requests per second for the deletion processes. |
|
255 | - * timeout: time, // How long can the underlying delete processes run until they are canceled |
|
256 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
257 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
258 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
259 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
260 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
261 | - * body: array, // deleting expired data parameters |
|
262 | - * } $params |
|
263 | - * |
|
264 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
265 | - * @throws ClientResponseException if the status code of response is 4xx |
|
266 | - * @throws ServerResponseException if the status code of response is 5xx |
|
267 | - * |
|
268 | - * @return Elasticsearch|Promise |
|
269 | - */ |
|
270 | - public function deleteExpiredData(array $params = []) |
|
271 | - { |
|
272 | - if (isset($params['job_id'])) { |
|
273 | - $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
274 | - $method = 'DELETE'; |
|
275 | - } else { |
|
276 | - $url = '/_ml/_delete_expired_data'; |
|
277 | - $method = 'DELETE'; |
|
278 | - } |
|
279 | - $url = $this->addQueryString($url, $params, ['requests_per_second', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
281 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
282 | - } |
|
283 | - /** |
|
284 | - * Deletes a filter. |
|
285 | - * |
|
286 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html |
|
287 | - * |
|
288 | - * @param array{ |
|
289 | - * filter_id: string, // (REQUIRED) The ID of the filter to delete |
|
290 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
291 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
292 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
293 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
294 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
295 | - * } $params |
|
296 | - * |
|
297 | - * @throws MissingParameterException if a required parameter is missing |
|
298 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
299 | - * @throws ClientResponseException if the status code of response is 4xx |
|
300 | - * @throws ServerResponseException if the status code of response is 5xx |
|
301 | - * |
|
302 | - * @return Elasticsearch|Promise |
|
303 | - */ |
|
304 | - public function deleteFilter(array $params = []) |
|
305 | - { |
|
306 | - $this->checkRequiredParameters(['filter_id'], $params); |
|
307 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
308 | - $method = 'DELETE'; |
|
309 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
310 | - $headers = ['Accept' => 'application/json']; |
|
311 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
312 | - } |
|
313 | - /** |
|
314 | - * Deletes forecasts from a machine learning job. |
|
315 | - * |
|
316 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html |
|
317 | - * |
|
318 | - * @param array{ |
|
319 | - * job_id: string, // (REQUIRED) The ID of the job from which to delete forecasts |
|
320 | - * forecast_id: string, // The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` |
|
321 | - * allow_no_forecasts: boolean, // Whether to ignore if `_all` matches no forecasts |
|
322 | - * timeout: time, // Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds |
|
323 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
324 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
325 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
326 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
327 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
328 | - * } $params |
|
329 | - * |
|
330 | - * @throws MissingParameterException if a required parameter is missing |
|
331 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
332 | - * @throws ClientResponseException if the status code of response is 4xx |
|
333 | - * @throws ServerResponseException if the status code of response is 5xx |
|
334 | - * |
|
335 | - * @return Elasticsearch|Promise |
|
336 | - */ |
|
337 | - public function deleteForecast(array $params = []) |
|
338 | - { |
|
339 | - $this->checkRequiredParameters(['job_id'], $params); |
|
340 | - if (isset($params['forecast_id'])) { |
|
341 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
342 | - $method = 'DELETE'; |
|
343 | - } else { |
|
344 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
345 | - $method = 'DELETE'; |
|
346 | - } |
|
347 | - $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
348 | - $headers = ['Accept' => 'application/json']; |
|
349 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
350 | - } |
|
351 | - /** |
|
352 | - * Deletes an existing anomaly detection job. |
|
353 | - * |
|
354 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html |
|
355 | - * |
|
356 | - * @param array{ |
|
357 | - * job_id: string, // (REQUIRED) The ID of the job to delete |
|
358 | - * force: boolean, // True if the job should be forcefully deleted |
|
359 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
360 | - * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
361 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
362 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
363 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
364 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
365 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
366 | - * } $params |
|
367 | - * |
|
368 | - * @throws MissingParameterException if a required parameter is missing |
|
369 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
370 | - * @throws ClientResponseException if the status code of response is 4xx |
|
371 | - * @throws ServerResponseException if the status code of response is 5xx |
|
372 | - * |
|
373 | - * @return Elasticsearch|Promise |
|
374 | - */ |
|
375 | - public function deleteJob(array $params = []) |
|
376 | - { |
|
377 | - $this->checkRequiredParameters(['job_id'], $params); |
|
378 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
379 | - $method = 'DELETE'; |
|
380 | - $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
381 | - $headers = ['Accept' => 'application/json']; |
|
382 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
383 | - } |
|
384 | - /** |
|
385 | - * Deletes an existing model snapshot. |
|
386 | - * |
|
387 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html |
|
388 | - * |
|
389 | - * @param array{ |
|
390 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
391 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to delete |
|
392 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
393 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
394 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
395 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
396 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
397 | - * } $params |
|
398 | - * |
|
399 | - * @throws MissingParameterException if a required parameter is missing |
|
400 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
401 | - * @throws ClientResponseException if the status code of response is 4xx |
|
402 | - * @throws ServerResponseException if the status code of response is 5xx |
|
403 | - * |
|
404 | - * @return Elasticsearch|Promise |
|
405 | - */ |
|
406 | - public function deleteModelSnapshot(array $params = []) |
|
407 | - { |
|
408 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
409 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
410 | - $method = 'DELETE'; |
|
411 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
412 | - $headers = ['Accept' => 'application/json']; |
|
413 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
414 | - } |
|
415 | - /** |
|
416 | - * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. |
|
417 | - * |
|
418 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html |
|
419 | - * |
|
420 | - * @param array{ |
|
421 | - * model_id: string, // (REQUIRED) The ID of the trained model to delete |
|
422 | - * timeout: time, // Controls the amount of time to wait for the model to be deleted. |
|
423 | - * force: boolean, // True if the model should be forcefully deleted |
|
424 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
425 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
426 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
427 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
428 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
429 | - * } $params |
|
430 | - * |
|
431 | - * @throws MissingParameterException if a required parameter is missing |
|
432 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
433 | - * @throws ClientResponseException if the status code of response is 4xx |
|
434 | - * @throws ServerResponseException if the status code of response is 5xx |
|
435 | - * |
|
436 | - * @return Elasticsearch|Promise |
|
437 | - */ |
|
438 | - public function deleteTrainedModel(array $params = []) |
|
439 | - { |
|
440 | - $this->checkRequiredParameters(['model_id'], $params); |
|
441 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
442 | - $method = 'DELETE'; |
|
443 | - $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
444 | - $headers = ['Accept' => 'application/json']; |
|
445 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
446 | - } |
|
447 | - /** |
|
448 | - * Deletes a model alias that refers to the trained model |
|
449 | - * |
|
450 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html |
|
451 | - * |
|
452 | - * @param array{ |
|
453 | - * model_alias: string, // (REQUIRED) The trained model alias to delete |
|
454 | - * model_id: string, // (REQUIRED) The trained model where the model alias is assigned |
|
455 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
456 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
457 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
458 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
459 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
460 | - * } $params |
|
461 | - * |
|
462 | - * @throws MissingParameterException if a required parameter is missing |
|
463 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
464 | - * @throws ClientResponseException if the status code of response is 4xx |
|
465 | - * @throws ServerResponseException if the status code of response is 5xx |
|
466 | - * |
|
467 | - * @return Elasticsearch|Promise |
|
468 | - */ |
|
469 | - public function deleteTrainedModelAlias(array $params = []) |
|
470 | - { |
|
471 | - $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
472 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
473 | - $method = 'DELETE'; |
|
474 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
475 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
476 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
477 | - } |
|
478 | - /** |
|
479 | - * Estimates the model memory |
|
480 | - * |
|
481 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html |
|
482 | - * |
|
483 | - * @param array{ |
|
484 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
485 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
486 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
487 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
488 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
489 | - * body: array, // (REQUIRED) The analysis config, plus cardinality estimates for fields it references |
|
490 | - * } $params |
|
491 | - * |
|
492 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
493 | - * @throws ClientResponseException if the status code of response is 4xx |
|
494 | - * @throws ServerResponseException if the status code of response is 5xx |
|
495 | - * |
|
496 | - * @return Elasticsearch|Promise |
|
497 | - */ |
|
498 | - public function estimateModelMemory(array $params = []) |
|
499 | - { |
|
500 | - $this->checkRequiredParameters(['body'], $params); |
|
501 | - $url = '/_ml/anomaly_detectors/_estimate_model_memory'; |
|
502 | - $method = 'POST'; |
|
503 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
504 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
505 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
506 | - } |
|
507 | - /** |
|
508 | - * Evaluates the data frame analytics for an annotated index. |
|
509 | - * |
|
510 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html |
|
511 | - * |
|
512 | - * @param array{ |
|
513 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
514 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
515 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
516 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
517 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
518 | - * body: array, // (REQUIRED) The evaluation definition |
|
519 | - * } $params |
|
520 | - * |
|
521 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
522 | - * @throws ClientResponseException if the status code of response is 4xx |
|
523 | - * @throws ServerResponseException if the status code of response is 5xx |
|
524 | - * |
|
525 | - * @return Elasticsearch|Promise |
|
526 | - */ |
|
527 | - public function evaluateDataFrame(array $params = []) |
|
528 | - { |
|
529 | - $this->checkRequiredParameters(['body'], $params); |
|
530 | - $url = '/_ml/data_frame/_evaluate'; |
|
531 | - $method = 'POST'; |
|
532 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
533 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
534 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
535 | - } |
|
536 | - /** |
|
537 | - * Explains a data frame analytics config. |
|
538 | - * |
|
539 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html |
|
540 | - * |
|
541 | - * @param array{ |
|
542 | - * id: string, // The ID of the data frame analytics to explain |
|
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, // The data frame analytics config to explain |
|
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 explainDataFrameAnalytics(array $params = []) |
|
558 | - { |
|
559 | - if (isset($params['id'])) { |
|
560 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
561 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
562 | - } else { |
|
563 | - $url = '/_ml/data_frame/analytics/_explain'; |
|
564 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
565 | - } |
|
566 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
567 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
568 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
569 | - } |
|
570 | - /** |
|
571 | - * Forces any buffered data to be processed by the job. |
|
572 | - * |
|
573 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html |
|
574 | - * |
|
575 | - * @param array{ |
|
576 | - * job_id: string, // (REQUIRED) The name of the job to flush |
|
577 | - * calc_interim: boolean, // Calculates interim results for the most recent bucket or all buckets within the latency period |
|
578 | - * start: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
579 | - * end: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
580 | - * advance_time: string, // Advances time to the given value generating results and updating the model for the advanced interval |
|
581 | - * skip_time: string, // Skips time to the given value without generating results or updating the model for the skipped interval |
|
582 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
583 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
584 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
585 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
586 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
587 | - * body: array, // Flush parameters |
|
588 | - * } $params |
|
589 | - * |
|
590 | - * @throws MissingParameterException if a required parameter is missing |
|
591 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
592 | - * @throws ClientResponseException if the status code of response is 4xx |
|
593 | - * @throws ServerResponseException if the status code of response is 5xx |
|
594 | - * |
|
595 | - * @return Elasticsearch|Promise |
|
596 | - */ |
|
597 | - public function flushJob(array $params = []) |
|
598 | - { |
|
599 | - $this->checkRequiredParameters(['job_id'], $params); |
|
600 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
601 | - $method = 'POST'; |
|
602 | - $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
603 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
604 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
605 | - } |
|
606 | - /** |
|
607 | - * Predicts the future behavior of a time series by using its historical behavior. |
|
608 | - * |
|
609 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html |
|
610 | - * |
|
611 | - * @param array{ |
|
612 | - * job_id: string, // (REQUIRED) The ID of the job to forecast for |
|
613 | - * duration: time, // The duration of the forecast |
|
614 | - * expires_in: time, // The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. |
|
615 | - * max_model_memory: string, // The max memory able to be used by the forecast. Default is 20mb. |
|
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, // Query parameters can be specified in the body |
|
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 forecast(array $params = []) |
|
632 | - { |
|
633 | - $this->checkRequiredParameters(['job_id'], $params); |
|
634 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
635 | - $method = 'POST'; |
|
636 | - $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
637 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
638 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
639 | - } |
|
640 | - /** |
|
641 | - * Retrieves anomaly detection job results for one or more buckets. |
|
642 | - * |
|
643 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html |
|
644 | - * |
|
645 | - * @param array{ |
|
646 | - * job_id: string, // (REQUIRED) ID of the job to get bucket results from |
|
647 | - * timestamp: string, // The timestamp of the desired single bucket result |
|
648 | - * expand: boolean, // Include anomaly records |
|
649 | - * exclude_interim: boolean, // Exclude interim results |
|
650 | - * from: int, // skips a number of buckets |
|
651 | - * size: int, // specifies a max number of buckets to get |
|
652 | - * start: string, // Start time filter for buckets |
|
653 | - * end: string, // End time filter for buckets |
|
654 | - * anomaly_score: double, // Filter for the most anomalous buckets |
|
655 | - * sort: string, // Sort buckets by a particular field |
|
656 | - * desc: boolean, // Set the sort direction |
|
657 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
658 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
659 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
660 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
661 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
662 | - * body: array, // Bucket selection details if not provided in URI |
|
663 | - * } $params |
|
664 | - * |
|
665 | - * @throws MissingParameterException if a required parameter is missing |
|
666 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
667 | - * @throws ClientResponseException if the status code of response is 4xx |
|
668 | - * @throws ServerResponseException if the status code of response is 5xx |
|
669 | - * |
|
670 | - * @return Elasticsearch|Promise |
|
671 | - */ |
|
672 | - public function getBuckets(array $params = []) |
|
673 | - { |
|
674 | - $this->checkRequiredParameters(['job_id'], $params); |
|
675 | - if (isset($params['timestamp'])) { |
|
676 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
677 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
678 | - } else { |
|
679 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
680 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
681 | - } |
|
682 | - $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
683 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
684 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
685 | - } |
|
686 | - /** |
|
687 | - * Retrieves information about the scheduled events in calendars. |
|
688 | - * |
|
689 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html |
|
690 | - * |
|
691 | - * @param array{ |
|
692 | - * calendar_id: string, // (REQUIRED) The ID of the calendar containing the events |
|
693 | - * job_id: string, // Get events for the job. When this option is used calendar_id must be '_all' |
|
694 | - * start: string, // Get events after this time |
|
695 | - * end: date, // Get events before this time |
|
696 | - * from: int, // Skips a number of events |
|
697 | - * size: int, // Specifies a max number of events to get |
|
698 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
699 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
700 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
701 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
702 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
703 | - * } $params |
|
704 | - * |
|
705 | - * @throws MissingParameterException if a required parameter is missing |
|
706 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
707 | - * @throws ClientResponseException if the status code of response is 4xx |
|
708 | - * @throws ServerResponseException if the status code of response is 5xx |
|
709 | - * |
|
710 | - * @return Elasticsearch|Promise |
|
711 | - */ |
|
712 | - public function getCalendarEvents(array $params = []) |
|
713 | - { |
|
714 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
715 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
716 | - $method = 'GET'; |
|
717 | - $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
718 | - $headers = ['Accept' => 'application/json']; |
|
719 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
720 | - } |
|
721 | - /** |
|
722 | - * Retrieves configuration information for calendars. |
|
723 | - * |
|
724 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html |
|
725 | - * |
|
726 | - * @param array{ |
|
727 | - * calendar_id: string, // The ID of the calendar to fetch |
|
728 | - * from: int, // skips a number of calendars |
|
729 | - * size: int, // specifies a max number of calendars to get |
|
730 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
731 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
732 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
733 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
734 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
735 | - * body: array, // The from and size parameters optionally sent in the body |
|
736 | - * } $params |
|
737 | - * |
|
738 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
739 | - * @throws ClientResponseException if the status code of response is 4xx |
|
740 | - * @throws ServerResponseException if the status code of response is 5xx |
|
741 | - * |
|
742 | - * @return Elasticsearch|Promise |
|
743 | - */ |
|
744 | - public function getCalendars(array $params = []) |
|
745 | - { |
|
746 | - if (isset($params['calendar_id'])) { |
|
747 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
748 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
749 | - } else { |
|
750 | - $url = '/_ml/calendars'; |
|
751 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
752 | - } |
|
753 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
754 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
755 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
756 | - } |
|
757 | - /** |
|
758 | - * Retrieves anomaly detection job results for one or more categories. |
|
759 | - * |
|
760 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html |
|
761 | - * |
|
762 | - * @param array{ |
|
763 | - * job_id: string, // (REQUIRED) The name of the job |
|
764 | - * category_id: long, // The identifier of the category definition of interest |
|
765 | - * from: int, // skips a number of categories |
|
766 | - * size: int, // specifies a max number of categories to get |
|
767 | - * 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. |
|
768 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
769 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
770 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
771 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
772 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
773 | - * body: array, // Category selection details if not provided in URI |
|
774 | - * } $params |
|
775 | - * |
|
776 | - * @throws MissingParameterException if a required parameter is missing |
|
777 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
778 | - * @throws ClientResponseException if the status code of response is 4xx |
|
779 | - * @throws ServerResponseException if the status code of response is 5xx |
|
780 | - * |
|
781 | - * @return Elasticsearch|Promise |
|
782 | - */ |
|
783 | - public function getCategories(array $params = []) |
|
784 | - { |
|
785 | - $this->checkRequiredParameters(['job_id'], $params); |
|
786 | - if (isset($params['category_id'])) { |
|
787 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
788 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
789 | - } else { |
|
790 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/'; |
|
791 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
792 | - } |
|
793 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
794 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
795 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
796 | - } |
|
797 | - /** |
|
798 | - * Retrieves configuration information for data frame analytics jobs. |
|
799 | - * |
|
800 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html |
|
801 | - * |
|
802 | - * @param array{ |
|
803 | - * id: string, // The ID of the data frame analytics to fetch |
|
804 | - * 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) |
|
805 | - * from: int, // skips a number of analytics |
|
806 | - * size: int, // specifies a max number of analytics to get |
|
807 | - * exclude_generated: boolean, // Omits fields that are illegal to set on data frame analytics PUT |
|
808 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
809 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
810 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
811 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
812 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
813 | - * } $params |
|
814 | - * |
|
815 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
816 | - * @throws ClientResponseException if the status code of response is 4xx |
|
817 | - * @throws ServerResponseException if the status code of response is 5xx |
|
818 | - * |
|
819 | - * @return Elasticsearch|Promise |
|
820 | - */ |
|
821 | - public function getDataFrameAnalytics(array $params = []) |
|
822 | - { |
|
823 | - if (isset($params['id'])) { |
|
824 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
825 | - $method = 'GET'; |
|
826 | - } else { |
|
827 | - $url = '/_ml/data_frame/analytics'; |
|
828 | - $method = 'GET'; |
|
829 | - } |
|
830 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
831 | - $headers = ['Accept' => 'application/json']; |
|
832 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
833 | - } |
|
834 | - /** |
|
835 | - * Retrieves usage information for data frame analytics jobs. |
|
836 | - * |
|
837 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html |
|
838 | - * |
|
839 | - * @param array{ |
|
840 | - * id: string, // The ID of the data frame analytics stats to fetch |
|
841 | - * 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) |
|
842 | - * from: int, // skips a number of analytics |
|
843 | - * size: int, // specifies a max number of analytics to get |
|
844 | - * verbose: boolean, // whether the stats response should be verbose |
|
845 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
846 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
847 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
848 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
849 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
850 | - * } $params |
|
851 | - * |
|
852 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
853 | - * @throws ClientResponseException if the status code of response is 4xx |
|
854 | - * @throws ServerResponseException if the status code of response is 5xx |
|
855 | - * |
|
856 | - * @return Elasticsearch|Promise |
|
857 | - */ |
|
858 | - public function getDataFrameAnalyticsStats(array $params = []) |
|
859 | - { |
|
860 | - if (isset($params['id'])) { |
|
861 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
862 | - $method = 'GET'; |
|
863 | - } else { |
|
864 | - $url = '/_ml/data_frame/analytics/_stats'; |
|
865 | - $method = 'GET'; |
|
866 | - } |
|
867 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
868 | - $headers = ['Accept' => 'application/json']; |
|
869 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
870 | - } |
|
871 | - /** |
|
872 | - * Retrieves usage information for datafeeds. |
|
873 | - * |
|
874 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html |
|
875 | - * |
|
876 | - * @param array{ |
|
877 | - * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
878 | - * 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) |
|
879 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
880 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
881 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
882 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
883 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
884 | - * } $params |
|
885 | - * |
|
886 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
887 | - * @throws ClientResponseException if the status code of response is 4xx |
|
888 | - * @throws ServerResponseException if the status code of response is 5xx |
|
889 | - * |
|
890 | - * @return Elasticsearch|Promise |
|
891 | - */ |
|
892 | - public function getDatafeedStats(array $params = []) |
|
893 | - { |
|
894 | - if (isset($params['datafeed_id'])) { |
|
895 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
896 | - $method = 'GET'; |
|
897 | - } else { |
|
898 | - $url = '/_ml/datafeeds/_stats'; |
|
899 | - $method = 'GET'; |
|
900 | - } |
|
901 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
902 | - $headers = ['Accept' => 'application/json']; |
|
903 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
904 | - } |
|
905 | - /** |
|
906 | - * Retrieves configuration information for datafeeds. |
|
907 | - * |
|
908 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html |
|
909 | - * |
|
910 | - * @param array{ |
|
911 | - * datafeed_id: string, // The ID of the datafeeds to fetch |
|
912 | - * 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) |
|
913 | - * exclude_generated: boolean, // Omits fields that are illegal to set on datafeed PUT |
|
914 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
915 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
916 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
917 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
918 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
919 | - * } $params |
|
920 | - * |
|
921 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
922 | - * @throws ClientResponseException if the status code of response is 4xx |
|
923 | - * @throws ServerResponseException if the status code of response is 5xx |
|
924 | - * |
|
925 | - * @return Elasticsearch|Promise |
|
926 | - */ |
|
927 | - public function getDatafeeds(array $params = []) |
|
928 | - { |
|
929 | - if (isset($params['datafeed_id'])) { |
|
930 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
931 | - $method = 'GET'; |
|
932 | - } else { |
|
933 | - $url = '/_ml/datafeeds'; |
|
934 | - $method = 'GET'; |
|
935 | - } |
|
936 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
937 | - $headers = ['Accept' => 'application/json']; |
|
938 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
939 | - } |
|
940 | - /** |
|
941 | - * Retrieves filters. |
|
942 | - * |
|
943 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html |
|
944 | - * |
|
945 | - * @param array{ |
|
946 | - * filter_id: string, // The ID of the filter to fetch |
|
947 | - * from: int, // skips a number of filters |
|
948 | - * size: int, // specifies a max number of filters to get |
|
949 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
950 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
951 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
952 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
953 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
954 | - * } $params |
|
955 | - * |
|
956 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
957 | - * @throws ClientResponseException if the status code of response is 4xx |
|
958 | - * @throws ServerResponseException if the status code of response is 5xx |
|
959 | - * |
|
960 | - * @return Elasticsearch|Promise |
|
961 | - */ |
|
962 | - public function getFilters(array $params = []) |
|
963 | - { |
|
964 | - if (isset($params['filter_id'])) { |
|
965 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
966 | - $method = 'GET'; |
|
967 | - } else { |
|
968 | - $url = '/_ml/filters'; |
|
969 | - $method = 'GET'; |
|
970 | - } |
|
971 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
972 | - $headers = ['Accept' => 'application/json']; |
|
973 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
974 | - } |
|
975 | - /** |
|
976 | - * Retrieves anomaly detection job results for one or more influencers. |
|
977 | - * |
|
978 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html |
|
979 | - * |
|
980 | - * @param array{ |
|
981 | - * job_id: string, // (REQUIRED) Identifier for the anomaly detection job |
|
982 | - * exclude_interim: boolean, // Exclude interim results |
|
983 | - * from: int, // skips a number of influencers |
|
984 | - * size: int, // specifies a max number of influencers to get |
|
985 | - * start: string, // start timestamp for the requested influencers |
|
986 | - * end: string, // end timestamp for the requested influencers |
|
987 | - * influencer_score: double, // influencer score threshold for the requested influencers |
|
988 | - * sort: string, // sort field for the requested influencers |
|
989 | - * desc: boolean, // whether the results should be sorted in decending order |
|
990 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
991 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
992 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
993 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
994 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
995 | - * body: array, // Influencer selection criteria |
|
996 | - * } $params |
|
997 | - * |
|
998 | - * @throws MissingParameterException if a required parameter is missing |
|
999 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1000 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1001 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1002 | - * |
|
1003 | - * @return Elasticsearch|Promise |
|
1004 | - */ |
|
1005 | - public function getInfluencers(array $params = []) |
|
1006 | - { |
|
1007 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1008 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
1009 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1010 | - $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1011 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1012 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1013 | - } |
|
1014 | - /** |
|
1015 | - * Retrieves usage information for anomaly detection jobs. |
|
1016 | - * |
|
1017 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html |
|
1018 | - * |
|
1019 | - * @param array{ |
|
1020 | - * job_id: string, // The ID of the jobs stats to fetch |
|
1021 | - * 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) |
|
1022 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1023 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1024 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1025 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1026 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1027 | - * } $params |
|
1028 | - * |
|
1029 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1030 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1031 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1032 | - * |
|
1033 | - * @return Elasticsearch|Promise |
|
1034 | - */ |
|
1035 | - public function getJobStats(array $params = []) |
|
1036 | - { |
|
1037 | - if (isset($params['job_id'])) { |
|
1038 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
1039 | - $method = 'GET'; |
|
1040 | - } else { |
|
1041 | - $url = '/_ml/anomaly_detectors/_stats'; |
|
1042 | - $method = 'GET'; |
|
1043 | - } |
|
1044 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1045 | - $headers = ['Accept' => 'application/json']; |
|
1046 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1047 | - } |
|
1048 | - /** |
|
1049 | - * Retrieves configuration information for anomaly detection jobs. |
|
1050 | - * |
|
1051 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html |
|
1052 | - * |
|
1053 | - * @param array{ |
|
1054 | - * job_id: string, // The ID of the jobs to fetch |
|
1055 | - * 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) |
|
1056 | - * exclude_generated: boolean, // Omits fields that are illegal to set on job PUT |
|
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 getJobs(array $params = []) |
|
1071 | - { |
|
1072 | - if (isset($params['job_id'])) { |
|
1073 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1074 | - $method = 'GET'; |
|
1075 | - } else { |
|
1076 | - $url = '/_ml/anomaly_detectors'; |
|
1077 | - $method = 'GET'; |
|
1078 | - } |
|
1079 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1080 | - $headers = ['Accept' => 'application/json']; |
|
1081 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1082 | - } |
|
1083 | - /** |
|
1084 | - * Returns information on how ML is using memory. |
|
1085 | - * |
|
1086 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html |
|
1087 | - * |
|
1088 | - * @param array{ |
|
1089 | - * node_id: string, // Specifies the node or nodes to retrieve stats for. |
|
1090 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
1091 | - * timeout: time, // Explicit operation timeout |
|
1092 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1093 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1094 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1095 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1096 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1097 | - * } $params |
|
1098 | - * |
|
1099 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1100 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1101 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1102 | - * |
|
1103 | - * @return Elasticsearch|Promise |
|
1104 | - */ |
|
1105 | - public function getMemoryStats(array $params = []) |
|
1106 | - { |
|
1107 | - if (isset($params['node_id'])) { |
|
1108 | - $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
1109 | - $method = 'GET'; |
|
1110 | - } else { |
|
1111 | - $url = '/_ml/memory/_stats'; |
|
1112 | - $method = 'GET'; |
|
1113 | - } |
|
1114 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1115 | - $headers = ['Accept' => 'application/json']; |
|
1116 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1117 | - } |
|
1118 | - /** |
|
1119 | - * Gets stats for anomaly detection job model snapshot upgrades that are in progress. |
|
1120 | - * |
|
1121 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html |
|
1122 | - * |
|
1123 | - * @param array{ |
|
1124 | - * job_id: string, // (REQUIRED) The ID of the job. May be a wildcard, comma separated list or `_all`. |
|
1125 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot. May be a wildcard, comma separated list or `_all`. |
|
1126 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) |
|
1127 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1128 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1129 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1130 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1131 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1132 | - * } $params |
|
1133 | - * |
|
1134 | - * @throws MissingParameterException if a required parameter is missing |
|
1135 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1136 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1137 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1138 | - * |
|
1139 | - * @return Elasticsearch|Promise |
|
1140 | - */ |
|
1141 | - public function getModelSnapshotUpgradeStats(array $params = []) |
|
1142 | - { |
|
1143 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
1144 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
1145 | - $method = 'GET'; |
|
1146 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1147 | - $headers = ['Accept' => 'application/json']; |
|
1148 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1149 | - } |
|
1150 | - /** |
|
1151 | - * Retrieves information about model snapshots. |
|
1152 | - * |
|
1153 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html |
|
1154 | - * |
|
1155 | - * @param array{ |
|
1156 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
1157 | - * snapshot_id: string, // The ID of the snapshot to fetch |
|
1158 | - * from: int, // Skips a number of documents |
|
1159 | - * size: int, // The default number of documents returned in queries as a string. |
|
1160 | - * start: date, // The filter 'start' query parameter |
|
1161 | - * end: date, // The filter 'end' query parameter |
|
1162 | - * sort: string, // Name of the field to sort on |
|
1163 | - * desc: boolean, // True if the results should be sorted in descending order |
|
1164 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1165 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1166 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1167 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1168 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1169 | - * body: array, // Model snapshot selection criteria |
|
1170 | - * } $params |
|
1171 | - * |
|
1172 | - * @throws MissingParameterException if a required parameter is missing |
|
1173 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1174 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1175 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1176 | - * |
|
1177 | - * @return Elasticsearch|Promise |
|
1178 | - */ |
|
1179 | - public function getModelSnapshots(array $params = []) |
|
1180 | - { |
|
1181 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1182 | - if (isset($params['snapshot_id'])) { |
|
1183 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
1184 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1185 | - } else { |
|
1186 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
1187 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1188 | - } |
|
1189 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1190 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1191 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1192 | - } |
|
1193 | - /** |
|
1194 | - * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. |
|
1195 | - * |
|
1196 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html |
|
1197 | - * |
|
1198 | - * @param array{ |
|
1199 | - * job_id: string, // (REQUIRED) The job IDs for which to calculate overall bucket results |
|
1200 | - * top_n: int, // The number of top job bucket scores to be used in the overall_score calculation |
|
1201 | - * bucket_span: string, // The span of the overall buckets. Defaults to the longest job bucket_span |
|
1202 | - * overall_score: double, // Returns overall buckets with overall scores higher than this value |
|
1203 | - * exclude_interim: boolean, // If true overall buckets that include interim buckets will be excluded |
|
1204 | - * start: string, // Returns overall buckets with timestamps after this time |
|
1205 | - * end: string, // Returns overall buckets with timestamps earlier than this time |
|
1206 | - * 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) |
|
1207 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1208 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1209 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1210 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1211 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1212 | - * body: array, // Overall bucket selection details if not provided in URI |
|
1213 | - * } $params |
|
1214 | - * |
|
1215 | - * @throws MissingParameterException if a required parameter is missing |
|
1216 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1217 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1218 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1219 | - * |
|
1220 | - * @return Elasticsearch|Promise |
|
1221 | - */ |
|
1222 | - public function getOverallBuckets(array $params = []) |
|
1223 | - { |
|
1224 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1225 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
1226 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1227 | - $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']); |
|
1228 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1229 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1230 | - } |
|
1231 | - /** |
|
1232 | - * Retrieves anomaly records for an anomaly detection job. |
|
1233 | - * |
|
1234 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html |
|
1235 | - * |
|
1236 | - * @param array{ |
|
1237 | - * job_id: string, // (REQUIRED) The ID of the job |
|
1238 | - * exclude_interim: boolean, // Exclude interim results |
|
1239 | - * from: int, // skips a number of records |
|
1240 | - * size: int, // specifies a max number of records to get |
|
1241 | - * start: string, // Start time filter for records |
|
1242 | - * end: string, // End time filter for records |
|
1243 | - * record_score: double, // Returns records with anomaly scores greater or equal than this value |
|
1244 | - * sort: string, // Sort records by a particular field |
|
1245 | - * desc: boolean, // Set the sort direction |
|
1246 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1247 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1248 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1249 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1250 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1251 | - * body: array, // Record selection criteria |
|
1252 | - * } $params |
|
1253 | - * |
|
1254 | - * @throws MissingParameterException if a required parameter is missing |
|
1255 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1256 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1257 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1258 | - * |
|
1259 | - * @return Elasticsearch|Promise |
|
1260 | - */ |
|
1261 | - public function getRecords(array $params = []) |
|
1262 | - { |
|
1263 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1264 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
1265 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1266 | - $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1267 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1268 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1269 | - } |
|
1270 | - /** |
|
1271 | - * Retrieves configuration information for a trained inference model. |
|
1272 | - * |
|
1273 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html |
|
1274 | - * |
|
1275 | - * @param array{ |
|
1276 | - * model_id: string, // The ID of the trained models to fetch |
|
1277 | - * 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) |
|
1278 | - * include: string, // A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. |
|
1279 | - * 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. |
|
1280 | - * decompress_definition: boolean, // Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. |
|
1281 | - * from: int, // skips a number of trained models |
|
1282 | - * size: int, // specifies a max number of trained models to get |
|
1283 | - * tags: list, // A comma-separated list of tags that the model must have. |
|
1284 | - * exclude_generated: boolean, // Omits fields that are illegal to set on model PUT |
|
1285 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1286 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1287 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1288 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1289 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1290 | - * } $params |
|
1291 | - * |
|
1292 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1293 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1294 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1295 | - * |
|
1296 | - * @return Elasticsearch|Promise |
|
1297 | - */ |
|
1298 | - public function getTrainedModels(array $params = []) |
|
1299 | - { |
|
1300 | - if (isset($params['model_id'])) { |
|
1301 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1302 | - $method = 'GET'; |
|
1303 | - } else { |
|
1304 | - $url = '/_ml/trained_models'; |
|
1305 | - $method = 'GET'; |
|
1306 | - } |
|
1307 | - $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']); |
|
1308 | - $headers = ['Accept' => 'application/json']; |
|
1309 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1310 | - } |
|
1311 | - /** |
|
1312 | - * Retrieves usage information for trained inference models. |
|
1313 | - * |
|
1314 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html |
|
1315 | - * |
|
1316 | - * @param array{ |
|
1317 | - * model_id: string, // The ID of the trained models stats to fetch |
|
1318 | - * 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) |
|
1319 | - * from: int, // skips a number of trained models |
|
1320 | - * size: int, // specifies a max number of trained models to get |
|
1321 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1322 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1323 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1324 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1325 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1326 | - * } $params |
|
1327 | - * |
|
1328 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1329 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1330 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1331 | - * |
|
1332 | - * @return Elasticsearch|Promise |
|
1333 | - */ |
|
1334 | - public function getTrainedModelsStats(array $params = []) |
|
1335 | - { |
|
1336 | - if (isset($params['model_id'])) { |
|
1337 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
1338 | - $method = 'GET'; |
|
1339 | - } else { |
|
1340 | - $url = '/_ml/trained_models/_stats'; |
|
1341 | - $method = 'GET'; |
|
1342 | - } |
|
1343 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1344 | - $headers = ['Accept' => 'application/json']; |
|
1345 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1346 | - } |
|
1347 | - /** |
|
1348 | - * Evaluate a trained model. |
|
1349 | - * |
|
1350 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html |
|
1351 | - * |
|
1352 | - * @param array{ |
|
1353 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
1354 | - * timeout: time, // Controls the amount of time to wait for inference results. |
|
1355 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1356 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1357 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1358 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1359 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1360 | - * body: array, // (REQUIRED) The docs to apply inference on and inference configuration overrides |
|
1361 | - * } $params |
|
1362 | - * |
|
1363 | - * @throws MissingParameterException if a required parameter is missing |
|
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 inferTrainedModel(array $params = []) |
|
1371 | - { |
|
1372 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1373 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
1374 | - $method = 'POST'; |
|
1375 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1376 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1377 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1378 | - } |
|
1379 | - /** |
|
1380 | - * Returns defaults and limits used by machine learning. |
|
1381 | - * |
|
1382 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html |
|
1383 | - * |
|
1384 | - * @param array{ |
|
1385 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1386 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1387 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1388 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1389 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1390 | - * } $params |
|
1391 | - * |
|
1392 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1393 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1394 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1395 | - * |
|
1396 | - * @return Elasticsearch|Promise |
|
1397 | - */ |
|
1398 | - public function info(array $params = []) |
|
1399 | - { |
|
1400 | - $url = '/_ml/info'; |
|
1401 | - $method = 'GET'; |
|
1402 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1403 | - $headers = ['Accept' => 'application/json']; |
|
1404 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1405 | - } |
|
1406 | - /** |
|
1407 | - * Opens one or more anomaly detection jobs. |
|
1408 | - * |
|
1409 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html |
|
1410 | - * |
|
1411 | - * @param array{ |
|
1412 | - * job_id: string, // (REQUIRED) The ID of the job to open |
|
1413 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1414 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1415 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1416 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1417 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1418 | - * body: array, // Query parameters can be specified in the body |
|
1419 | - * } $params |
|
1420 | - * |
|
1421 | - * @throws MissingParameterException if a required parameter is missing |
|
1422 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1423 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1424 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1425 | - * |
|
1426 | - * @return Elasticsearch|Promise |
|
1427 | - */ |
|
1428 | - public function openJob(array $params = []) |
|
1429 | - { |
|
1430 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1431 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
1432 | - $method = 'POST'; |
|
1433 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1434 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1435 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1436 | - } |
|
1437 | - /** |
|
1438 | - * Posts scheduled events in a calendar. |
|
1439 | - * |
|
1440 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html |
|
1441 | - * |
|
1442 | - * @param array{ |
|
1443 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
1444 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1445 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1446 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1447 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1448 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1449 | - * body: array, // (REQUIRED) A list of events |
|
1450 | - * } $params |
|
1451 | - * |
|
1452 | - * @throws MissingParameterException if a required parameter is missing |
|
1453 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1454 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1455 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1456 | - * |
|
1457 | - * @return Elasticsearch|Promise |
|
1458 | - */ |
|
1459 | - public function postCalendarEvents(array $params = []) |
|
1460 | - { |
|
1461 | - $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
|
1462 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
1463 | - $method = 'POST'; |
|
1464 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1465 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1466 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1467 | - } |
|
1468 | - /** |
|
1469 | - * Sends data to an anomaly detection job for analysis. |
|
1470 | - * |
|
1471 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html |
|
1472 | - * |
|
1473 | - * @param array{ |
|
1474 | - * job_id: string, // (REQUIRED) The name of the job receiving the data |
|
1475 | - * reset_start: string, // Optional parameter to specify the start of the bucket resetting range |
|
1476 | - * reset_end: string, // Optional parameter to specify the end of the bucket resetting range |
|
1477 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1478 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1479 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1480 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1481 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1482 | - * body: array, // (REQUIRED) The data to process |
|
1483 | - * } $params |
|
1484 | - * |
|
1485 | - * @throws MissingParameterException if a required parameter is missing |
|
1486 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1487 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1488 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1489 | - * |
|
1490 | - * @return Elasticsearch|Promise |
|
1491 | - */ |
|
1492 | - public function postData(array $params = []) |
|
1493 | - { |
|
1494 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
1495 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
1496 | - $method = 'POST'; |
|
1497 | - $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1498 | - $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
|
1499 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1500 | - } |
|
1501 | - /** |
|
1502 | - * Previews that will be analyzed given a data frame analytics config. |
|
1503 | - * |
|
1504 | - * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html |
|
1505 | - * |
|
1506 | - * @param array{ |
|
1507 | - * id: string, // The ID of the data frame analytics to preview |
|
1508 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1509 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1510 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1511 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1512 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1513 | - * body: array, // The data frame analytics config to preview |
|
1514 | - * } $params |
|
1515 | - * |
|
1516 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1517 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1518 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1519 | - * |
|
1520 | - * @return Elasticsearch|Promise |
|
1521 | - */ |
|
1522 | - public function previewDataFrameAnalytics(array $params = []) |
|
1523 | - { |
|
1524 | - if (isset($params['id'])) { |
|
1525 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
1526 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1527 | - } else { |
|
1528 | - $url = '/_ml/data_frame/analytics/_preview'; |
|
1529 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1530 | - } |
|
1531 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1532 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1533 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1534 | - } |
|
1535 | - /** |
|
1536 | - * Previews a datafeed. |
|
1537 | - * |
|
1538 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html |
|
1539 | - * |
|
1540 | - * @param array{ |
|
1541 | - * datafeed_id: string, // The ID of the datafeed to preview |
|
1542 | - * start: string, // The start time from where the datafeed preview should begin |
|
1543 | - * end: string, // The end time when the datafeed preview should stop |
|
1544 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1545 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1546 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1547 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1548 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1549 | - * body: array, // The datafeed config and job config with which to execute the preview |
|
1550 | - * } $params |
|
1551 | - * |
|
1552 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1553 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1554 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1555 | - * |
|
1556 | - * @return Elasticsearch|Promise |
|
1557 | - */ |
|
1558 | - public function previewDatafeed(array $params = []) |
|
1559 | - { |
|
1560 | - if (isset($params['datafeed_id'])) { |
|
1561 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
1562 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1563 | - } else { |
|
1564 | - $url = '/_ml/datafeeds/_preview'; |
|
1565 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1566 | - } |
|
1567 | - $url = $this->addQueryString($url, $params, ['start', 'end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1568 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1569 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1570 | - } |
|
1571 | - /** |
|
1572 | - * Instantiates a calendar. |
|
1573 | - * |
|
1574 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html |
|
1575 | - * |
|
1576 | - * @param array{ |
|
1577 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to create |
|
1578 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1579 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1580 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1581 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1582 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1583 | - * body: array, // The calendar details |
|
1584 | - * } $params |
|
1585 | - * |
|
1586 | - * @throws MissingParameterException if a required parameter is missing |
|
1587 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1588 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1589 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1590 | - * |
|
1591 | - * @return Elasticsearch|Promise |
|
1592 | - */ |
|
1593 | - public function putCalendar(array $params = []) |
|
1594 | - { |
|
1595 | - $this->checkRequiredParameters(['calendar_id'], $params); |
|
1596 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
1597 | - $method = 'PUT'; |
|
1598 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1599 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1600 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1601 | - } |
|
1602 | - /** |
|
1603 | - * Adds an anomaly detection job to a calendar. |
|
1604 | - * |
|
1605 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html |
|
1606 | - * |
|
1607 | - * @param array{ |
|
1608 | - * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
1609 | - * job_id: string, // (REQUIRED) The ID of the job to add to the calendar |
|
1610 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1611 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1612 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1613 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1614 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1615 | - * } $params |
|
1616 | - * |
|
1617 | - * @throws MissingParameterException if a required parameter is missing |
|
1618 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1619 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1620 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1621 | - * |
|
1622 | - * @return Elasticsearch|Promise |
|
1623 | - */ |
|
1624 | - public function putCalendarJob(array $params = []) |
|
1625 | - { |
|
1626 | - $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
1627 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
1628 | - $method = 'PUT'; |
|
1629 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1630 | - $headers = ['Accept' => 'application/json']; |
|
1631 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1632 | - } |
|
1633 | - /** |
|
1634 | - * Instantiates a data frame analytics job. |
|
1635 | - * |
|
1636 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html |
|
1637 | - * |
|
1638 | - * @param array{ |
|
1639 | - * id: string, // (REQUIRED) The ID of the data frame analytics to create |
|
1640 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1641 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1642 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1643 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1644 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1645 | - * body: array, // (REQUIRED) The data frame analytics configuration |
|
1646 | - * } $params |
|
1647 | - * |
|
1648 | - * @throws MissingParameterException if a required parameter is missing |
|
1649 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1650 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1651 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1652 | - * |
|
1653 | - * @return Elasticsearch|Promise |
|
1654 | - */ |
|
1655 | - public function putDataFrameAnalytics(array $params = []) |
|
1656 | - { |
|
1657 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
1658 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
1659 | - $method = 'PUT'; |
|
1660 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1661 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1662 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1663 | - } |
|
1664 | - /** |
|
1665 | - * Instantiates a datafeed. |
|
1666 | - * |
|
1667 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html |
|
1668 | - * |
|
1669 | - * @param array{ |
|
1670 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to create |
|
1671 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
1672 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
1673 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
1674 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
1675 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1676 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1677 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1678 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1679 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1680 | - * body: array, // (REQUIRED) The datafeed config |
|
1681 | - * } $params |
|
1682 | - * |
|
1683 | - * @throws MissingParameterException if a required parameter is missing |
|
1684 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1685 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1686 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1687 | - * |
|
1688 | - * @return Elasticsearch|Promise |
|
1689 | - */ |
|
1690 | - public function putDatafeed(array $params = []) |
|
1691 | - { |
|
1692 | - $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
1693 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
1694 | - $method = 'PUT'; |
|
1695 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1696 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1697 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1698 | - } |
|
1699 | - /** |
|
1700 | - * Instantiates a filter. |
|
1701 | - * |
|
1702 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html |
|
1703 | - * |
|
1704 | - * @param array{ |
|
1705 | - * filter_id: string, // (REQUIRED) The ID of the filter to create |
|
1706 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1707 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1708 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1709 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1710 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1711 | - * body: array, // (REQUIRED) The filter details |
|
1712 | - * } $params |
|
1713 | - * |
|
1714 | - * @throws MissingParameterException if a required parameter is missing |
|
1715 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1716 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1717 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1718 | - * |
|
1719 | - * @return Elasticsearch|Promise |
|
1720 | - */ |
|
1721 | - public function putFilter(array $params = []) |
|
1722 | - { |
|
1723 | - $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
1724 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
1725 | - $method = 'PUT'; |
|
1726 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1727 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1728 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1729 | - } |
|
1730 | - /** |
|
1731 | - * Instantiates an anomaly detection job. |
|
1732 | - * |
|
1733 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html |
|
1734 | - * |
|
1735 | - * @param array{ |
|
1736 | - * job_id: string, // (REQUIRED) The ID of the job to create |
|
1737 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. |
|
1738 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. |
|
1739 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. |
|
1740 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. |
|
1741 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1742 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1743 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1744 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1745 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1746 | - * body: array, // (REQUIRED) The job |
|
1747 | - * } $params |
|
1748 | - * |
|
1749 | - * @throws MissingParameterException if a required parameter is missing |
|
1750 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1751 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1752 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1753 | - * |
|
1754 | - * @return Elasticsearch|Promise |
|
1755 | - */ |
|
1756 | - public function putJob(array $params = []) |
|
1757 | - { |
|
1758 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
1759 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1760 | - $method = 'PUT'; |
|
1761 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1762 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1763 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1764 | - } |
|
1765 | - /** |
|
1766 | - * Creates an inference trained model. |
|
1767 | - * |
|
1768 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html |
|
1769 | - * |
|
1770 | - * @param array{ |
|
1771 | - * model_id: string, // (REQUIRED) The ID of the trained models to store |
|
1772 | - * defer_definition_decompression: boolean, // If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. |
|
1773 | - * wait_for_completion: boolean, // Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false |
|
1774 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1775 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1776 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1777 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1778 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1779 | - * body: array, // (REQUIRED) The trained model configuration |
|
1780 | - * } $params |
|
1781 | - * |
|
1782 | - * @throws MissingParameterException if a required parameter is missing |
|
1783 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1784 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1785 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1786 | - * |
|
1787 | - * @return Elasticsearch|Promise |
|
1788 | - */ |
|
1789 | - public function putTrainedModel(array $params = []) |
|
1790 | - { |
|
1791 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1792 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1793 | - $method = 'PUT'; |
|
1794 | - $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1795 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1796 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1797 | - } |
|
1798 | - /** |
|
1799 | - * Creates a new model alias (or reassigns an existing one) to refer to the trained model |
|
1800 | - * |
|
1801 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html |
|
1802 | - * |
|
1803 | - * @param array{ |
|
1804 | - * model_alias: string, // (REQUIRED) The trained model alias to update |
|
1805 | - * model_id: string, // (REQUIRED) The trained model where the model alias should be assigned |
|
1806 | - * reassign: boolean, // If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. |
|
1807 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1808 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1809 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1810 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1811 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1812 | - * } $params |
|
1813 | - * |
|
1814 | - * @throws MissingParameterException if a required parameter is missing |
|
1815 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1816 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1817 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1818 | - * |
|
1819 | - * @return Elasticsearch|Promise |
|
1820 | - */ |
|
1821 | - public function putTrainedModelAlias(array $params = []) |
|
1822 | - { |
|
1823 | - $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
1824 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
1825 | - $method = 'PUT'; |
|
1826 | - $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1827 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1828 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1829 | - } |
|
1830 | - /** |
|
1831 | - * Creates part of a trained model definition |
|
1832 | - * |
|
1833 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html |
|
1834 | - * |
|
1835 | - * @param array{ |
|
1836 | - * model_id: string, // (REQUIRED) The ID of the trained model for this definition part |
|
1837 | - * part: int, // (REQUIRED) The part number |
|
1838 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1839 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1840 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1841 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1842 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1843 | - * body: array, // (REQUIRED) The trained model definition part |
|
1844 | - * } $params |
|
1845 | - * |
|
1846 | - * @throws MissingParameterException if a required parameter is missing |
|
1847 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1848 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1849 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1850 | - * |
|
1851 | - * @return Elasticsearch|Promise |
|
1852 | - */ |
|
1853 | - public function putTrainedModelDefinitionPart(array $params = []) |
|
1854 | - { |
|
1855 | - $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
|
1856 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
1857 | - $method = 'PUT'; |
|
1858 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1859 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1860 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1861 | - } |
|
1862 | - /** |
|
1863 | - * Creates a trained model vocabulary |
|
1864 | - * |
|
1865 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html |
|
1866 | - * |
|
1867 | - * @param array{ |
|
1868 | - * model_id: string, // (REQUIRED) The ID of the trained model for this vocabulary |
|
1869 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1870 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1871 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1872 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1873 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1874 | - * body: array, // (REQUIRED) The trained model vocabulary |
|
1875 | - * } $params |
|
1876 | - * |
|
1877 | - * @throws MissingParameterException if a required parameter is missing |
|
1878 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1879 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1880 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1881 | - * |
|
1882 | - * @return Elasticsearch|Promise |
|
1883 | - */ |
|
1884 | - public function putTrainedModelVocabulary(array $params = []) |
|
1885 | - { |
|
1886 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1887 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
1888 | - $method = 'PUT'; |
|
1889 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1890 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1891 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1892 | - } |
|
1893 | - /** |
|
1894 | - * Resets an existing anomaly detection job. |
|
1895 | - * |
|
1896 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html |
|
1897 | - * |
|
1898 | - * @param array{ |
|
1899 | - * job_id: string, // (REQUIRED) The ID of the job to reset |
|
1900 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
1901 | - * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
1902 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1903 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1904 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1905 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1906 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1907 | - * } $params |
|
1908 | - * |
|
1909 | - * @throws MissingParameterException if a required parameter is missing |
|
1910 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1911 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1912 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1913 | - * |
|
1914 | - * @return Elasticsearch|Promise |
|
1915 | - */ |
|
1916 | - public function resetJob(array $params = []) |
|
1917 | - { |
|
1918 | - $this->checkRequiredParameters(['job_id'], $params); |
|
1919 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
1920 | - $method = 'POST'; |
|
1921 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1922 | - $headers = ['Accept' => 'application/json']; |
|
1923 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1924 | - } |
|
1925 | - /** |
|
1926 | - * Reverts to a specific snapshot. |
|
1927 | - * |
|
1928 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html |
|
1929 | - * |
|
1930 | - * @param array{ |
|
1931 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
1932 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to revert to |
|
1933 | - * delete_intervening_results: boolean, // Should we reset the results back to the time of the snapshot? |
|
1934 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1935 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1936 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1937 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1938 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1939 | - * body: array, // Reversion options |
|
1940 | - * } $params |
|
1941 | - * |
|
1942 | - * @throws MissingParameterException if a required parameter is missing |
|
1943 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1944 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1945 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1946 | - * |
|
1947 | - * @return Elasticsearch|Promise |
|
1948 | - */ |
|
1949 | - public function revertModelSnapshot(array $params = []) |
|
1950 | - { |
|
1951 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
1952 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
1953 | - $method = 'POST'; |
|
1954 | - $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1955 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1956 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1957 | - } |
|
1958 | - /** |
|
1959 | - * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. |
|
1960 | - * |
|
1961 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html |
|
1962 | - * |
|
1963 | - * @param array{ |
|
1964 | - * enabled: boolean, // Whether to enable upgrade_mode ML setting or not. Defaults to false. |
|
1965 | - * timeout: time, // Controls the time to wait before action times out. Defaults to 30 seconds |
|
1966 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1967 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1968 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1969 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1970 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1971 | - * } $params |
|
1972 | - * |
|
1973 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1974 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1975 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1976 | - * |
|
1977 | - * @return Elasticsearch|Promise |
|
1978 | - */ |
|
1979 | - public function setUpgradeMode(array $params = []) |
|
1980 | - { |
|
1981 | - $url = '/_ml/set_upgrade_mode'; |
|
1982 | - $method = 'POST'; |
|
1983 | - $url = $this->addQueryString($url, $params, ['enabled', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1984 | - $headers = ['Accept' => 'application/json']; |
|
1985 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1986 | - } |
|
1987 | - /** |
|
1988 | - * Starts a data frame analytics job. |
|
1989 | - * |
|
1990 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html |
|
1991 | - * |
|
1992 | - * @param array{ |
|
1993 | - * id: string, // (REQUIRED) The ID of the data frame analytics to start |
|
1994 | - * timeout: time, // Controls the time to wait until the task has started. Defaults to 20 seconds |
|
1995 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1996 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1997 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1998 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1999 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2000 | - * body: array, // The start data frame analytics parameters |
|
2001 | - * } $params |
|
2002 | - * |
|
2003 | - * @throws MissingParameterException if a required parameter is missing |
|
2004 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2005 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2006 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2007 | - * |
|
2008 | - * @return Elasticsearch|Promise |
|
2009 | - */ |
|
2010 | - public function startDataFrameAnalytics(array $params = []) |
|
2011 | - { |
|
2012 | - $this->checkRequiredParameters(['id'], $params); |
|
2013 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
2014 | - $method = 'POST'; |
|
2015 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2016 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2017 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2018 | - } |
|
2019 | - /** |
|
2020 | - * Starts one or more datafeeds. |
|
2021 | - * |
|
2022 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html |
|
2023 | - * |
|
2024 | - * @param array{ |
|
2025 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to start |
|
2026 | - * start: string, // The start time from where the datafeed should begin |
|
2027 | - * end: string, // The end time when the datafeed should stop. When not set, the datafeed continues in real time |
|
2028 | - * timeout: time, // Controls the time to wait until a datafeed has started. Default to 20 seconds |
|
2029 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2030 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2031 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2032 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2033 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2034 | - * body: array, // The start datafeed parameters |
|
2035 | - * } $params |
|
2036 | - * |
|
2037 | - * @throws MissingParameterException if a required parameter is missing |
|
2038 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2039 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2040 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2041 | - * |
|
2042 | - * @return Elasticsearch|Promise |
|
2043 | - */ |
|
2044 | - public function startDatafeed(array $params = []) |
|
2045 | - { |
|
2046 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
2047 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
2048 | - $method = 'POST'; |
|
2049 | - $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2050 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2051 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2052 | - } |
|
2053 | - /** |
|
2054 | - * Start a trained model deployment. |
|
2055 | - * |
|
2056 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html |
|
2057 | - * |
|
2058 | - * @param array{ |
|
2059 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2060 | - * cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb. |
|
2061 | - * deployment_id: string, // The Id of the new deployment. Defaults to the model_id if not set. |
|
2062 | - * number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes. |
|
2063 | - * threads_per_allocation: int, // The number of threads used by each model allocation during inference. |
|
2064 | - * priority: string, // The deployment priority. |
|
2065 | - * queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time. |
|
2066 | - * timeout: time, // Controls the amount of time to wait for the model to deploy. |
|
2067 | - * wait_for: string, // The allocation status for which to wait |
|
2068 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2069 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2070 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2071 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2072 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2073 | - * } $params |
|
2074 | - * |
|
2075 | - * @throws MissingParameterException if a required parameter is missing |
|
2076 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2077 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2078 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2079 | - * |
|
2080 | - * @return Elasticsearch|Promise |
|
2081 | - */ |
|
2082 | - public function startTrainedModelDeployment(array $params = []) |
|
2083 | - { |
|
2084 | - $this->checkRequiredParameters(['model_id'], $params); |
|
2085 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
2086 | - $method = 'POST'; |
|
2087 | - $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']); |
|
2088 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2089 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2090 | - } |
|
2091 | - /** |
|
2092 | - * Stops one or more data frame analytics jobs. |
|
2093 | - * |
|
2094 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html |
|
2095 | - * |
|
2096 | - * @param array{ |
|
2097 | - * id: string, // (REQUIRED) The ID of the data frame analytics to stop |
|
2098 | - * 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) |
|
2099 | - * force: boolean, // True if the data frame analytics should be forcefully stopped |
|
2100 | - * timeout: time, // Controls the time to wait until the task has stopped. Defaults to 20 seconds |
|
2101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2106 | - * body: array, // The stop data frame analytics parameters |
|
2107 | - * } $params |
|
2108 | - * |
|
2109 | - * @throws MissingParameterException if a required parameter is missing |
|
2110 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2111 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2112 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2113 | - * |
|
2114 | - * @return Elasticsearch|Promise |
|
2115 | - */ |
|
2116 | - public function stopDataFrameAnalytics(array $params = []) |
|
2117 | - { |
|
2118 | - $this->checkRequiredParameters(['id'], $params); |
|
2119 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
2120 | - $method = 'POST'; |
|
2121 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2122 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2123 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2124 | - } |
|
2125 | - /** |
|
2126 | - * Stops one or more datafeeds. |
|
2127 | - * |
|
2128 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html |
|
2129 | - * |
|
2130 | - * @param array{ |
|
2131 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to stop |
|
2132 | - * 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) |
|
2133 | - * 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) |
|
2134 | - * force: boolean, // True if the datafeed should be forcefully stopped. |
|
2135 | - * timeout: time, // Controls the time to wait until a datafeed has stopped. Default to 20 seconds |
|
2136 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2137 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2138 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2139 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2140 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2141 | - * body: array, // The URL params optionally sent in the body |
|
2142 | - * } $params |
|
2143 | - * |
|
2144 | - * @throws MissingParameterException if a required parameter is missing |
|
2145 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2146 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2147 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2148 | - * |
|
2149 | - * @return Elasticsearch|Promise |
|
2150 | - */ |
|
2151 | - public function stopDatafeed(array $params = []) |
|
2152 | - { |
|
2153 | - $this->checkRequiredParameters(['datafeed_id'], $params); |
|
2154 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
2155 | - $method = 'POST'; |
|
2156 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2157 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2158 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2159 | - } |
|
2160 | - /** |
|
2161 | - * Stop a trained model deployment. |
|
2162 | - * |
|
2163 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html |
|
2164 | - * |
|
2165 | - * @param array{ |
|
2166 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2167 | - * 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) |
|
2168 | - * force: boolean, // True if the deployment should be forcefully stopped |
|
2169 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2170 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2171 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2172 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2173 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2174 | - * body: array, // The stop deployment parameters |
|
2175 | - * } $params |
|
2176 | - * |
|
2177 | - * @throws MissingParameterException if a required parameter is missing |
|
2178 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2179 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2180 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2181 | - * |
|
2182 | - * @return Elasticsearch|Promise |
|
2183 | - */ |
|
2184 | - public function stopTrainedModelDeployment(array $params = []) |
|
2185 | - { |
|
2186 | - $this->checkRequiredParameters(['model_id'], $params); |
|
2187 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
2188 | - $method = 'POST'; |
|
2189 | - $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2190 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2191 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2192 | - } |
|
2193 | - /** |
|
2194 | - * Updates certain properties of a data frame analytics job. |
|
2195 | - * |
|
2196 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html |
|
2197 | - * |
|
2198 | - * @param array{ |
|
2199 | - * id: string, // (REQUIRED) The ID of the data frame analytics to update |
|
2200 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2201 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2202 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2203 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2204 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2205 | - * body: array, // (REQUIRED) The data frame analytics settings to update |
|
2206 | - * } $params |
|
2207 | - * |
|
2208 | - * @throws MissingParameterException if a required parameter is missing |
|
2209 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2210 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2211 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2212 | - * |
|
2213 | - * @return Elasticsearch|Promise |
|
2214 | - */ |
|
2215 | - public function updateDataFrameAnalytics(array $params = []) |
|
2216 | - { |
|
2217 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
2218 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
2219 | - $method = 'POST'; |
|
2220 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2221 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2222 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2223 | - } |
|
2224 | - /** |
|
2225 | - * Updates certain properties of a datafeed. |
|
2226 | - * |
|
2227 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html |
|
2228 | - * |
|
2229 | - * @param array{ |
|
2230 | - * datafeed_id: string, // (REQUIRED) The ID of the datafeed to update |
|
2231 | - * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
2232 | - * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
2233 | - * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
2234 | - * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
2235 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2236 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2237 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2238 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2239 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2240 | - * body: array, // (REQUIRED) The datafeed update settings |
|
2241 | - * } $params |
|
2242 | - * |
|
2243 | - * @throws MissingParameterException if a required parameter is missing |
|
2244 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2245 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2246 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2247 | - * |
|
2248 | - * @return Elasticsearch|Promise |
|
2249 | - */ |
|
2250 | - public function updateDatafeed(array $params = []) |
|
2251 | - { |
|
2252 | - $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
2253 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
2254 | - $method = 'POST'; |
|
2255 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2256 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2257 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2258 | - } |
|
2259 | - /** |
|
2260 | - * Updates the description of a filter, adds items, or removes items. |
|
2261 | - * |
|
2262 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html |
|
2263 | - * |
|
2264 | - * @param array{ |
|
2265 | - * filter_id: string, // (REQUIRED) The ID of the filter to update |
|
2266 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2267 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2268 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2269 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2270 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2271 | - * body: array, // (REQUIRED) The filter update |
|
2272 | - * } $params |
|
2273 | - * |
|
2274 | - * @throws MissingParameterException if a required parameter is missing |
|
2275 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2276 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2277 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2278 | - * |
|
2279 | - * @return Elasticsearch|Promise |
|
2280 | - */ |
|
2281 | - public function updateFilter(array $params = []) |
|
2282 | - { |
|
2283 | - $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
2284 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
2285 | - $method = 'POST'; |
|
2286 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2287 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2288 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2289 | - } |
|
2290 | - /** |
|
2291 | - * Updates certain properties of an anomaly detection job. |
|
2292 | - * |
|
2293 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html |
|
2294 | - * |
|
2295 | - * @param array{ |
|
2296 | - * job_id: string, // (REQUIRED) The ID of the job to create |
|
2297 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2298 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2299 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2300 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2301 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2302 | - * body: array, // (REQUIRED) The job update settings |
|
2303 | - * } $params |
|
2304 | - * |
|
2305 | - * @throws MissingParameterException if a required parameter is missing |
|
2306 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2307 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2308 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2309 | - * |
|
2310 | - * @return Elasticsearch|Promise |
|
2311 | - */ |
|
2312 | - public function updateJob(array $params = []) |
|
2313 | - { |
|
2314 | - $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
2315 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
2316 | - $method = 'POST'; |
|
2317 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2318 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2319 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2320 | - } |
|
2321 | - /** |
|
2322 | - * Updates certain properties of a snapshot. |
|
2323 | - * |
|
2324 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html |
|
2325 | - * |
|
2326 | - * @param array{ |
|
2327 | - * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
2328 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot to update |
|
2329 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2330 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2331 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2332 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2333 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2334 | - * body: array, // (REQUIRED) The model snapshot properties to update |
|
2335 | - * } $params |
|
2336 | - * |
|
2337 | - * @throws MissingParameterException if a required parameter is missing |
|
2338 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2339 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2340 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2341 | - * |
|
2342 | - * @return Elasticsearch|Promise |
|
2343 | - */ |
|
2344 | - public function updateModelSnapshot(array $params = []) |
|
2345 | - { |
|
2346 | - $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
|
2347 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
2348 | - $method = 'POST'; |
|
2349 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2350 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2351 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2352 | - } |
|
2353 | - /** |
|
2354 | - * Updates certain properties of trained model deployment. |
|
2355 | - * |
|
2356 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html |
|
2357 | - * |
|
2358 | - * @param array{ |
|
2359 | - * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2360 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2361 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2362 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2363 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2364 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2365 | - * body: array, // (REQUIRED) The updated trained model deployment settings |
|
2366 | - * } $params |
|
2367 | - * |
|
2368 | - * @throws MissingParameterException if a required parameter is missing |
|
2369 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2370 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2371 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2372 | - * |
|
2373 | - * @return Elasticsearch|Promise |
|
2374 | - */ |
|
2375 | - public function updateTrainedModelDeployment(array $params = []) |
|
2376 | - { |
|
2377 | - $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
2378 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
2379 | - $method = 'POST'; |
|
2380 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2381 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2382 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2383 | - } |
|
2384 | - /** |
|
2385 | - * Upgrades a given job snapshot to the current major version. |
|
2386 | - * |
|
2387 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html |
|
2388 | - * |
|
2389 | - * @param array{ |
|
2390 | - * job_id: string, // (REQUIRED) The ID of the job |
|
2391 | - * snapshot_id: string, // (REQUIRED) The ID of the snapshot |
|
2392 | - * timeout: time, // How long should the API wait for the job to be opened and the old snapshot to be loaded. |
|
2393 | - * wait_for_completion: boolean, // Should the request wait until the task is complete before responding to the caller. Default is false. |
|
2394 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2395 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2396 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2397 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2398 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2399 | - * } $params |
|
2400 | - * |
|
2401 | - * @throws MissingParameterException if a required parameter is missing |
|
2402 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2403 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2404 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2405 | - * |
|
2406 | - * @return Elasticsearch|Promise |
|
2407 | - */ |
|
2408 | - public function upgradeJobSnapshot(array $params = []) |
|
2409 | - { |
|
2410 | - $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
2411 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
2412 | - $method = 'POST'; |
|
2413 | - $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2414 | - $headers = ['Accept' => 'application/json']; |
|
2415 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2416 | - } |
|
2417 | - /** |
|
2418 | - * Validates an anomaly detection job. |
|
2419 | - * |
|
2420 | - * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
2421 | - * |
|
2422 | - * @param array{ |
|
2423 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2424 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2425 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2426 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2427 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2428 | - * body: array, // (REQUIRED) The job config |
|
2429 | - * } $params |
|
2430 | - * |
|
2431 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2432 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2433 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2434 | - * |
|
2435 | - * @return Elasticsearch|Promise |
|
2436 | - */ |
|
2437 | - public function validate(array $params = []) |
|
2438 | - { |
|
2439 | - $this->checkRequiredParameters(['body'], $params); |
|
2440 | - $url = '/_ml/anomaly_detectors/_validate'; |
|
2441 | - $method = 'POST'; |
|
2442 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2443 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2444 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2445 | - } |
|
2446 | - /** |
|
2447 | - * Validates an anomaly detection detector. |
|
2448 | - * |
|
2449 | - * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
2450 | - * |
|
2451 | - * @param array{ |
|
2452 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2453 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2454 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2455 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2456 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2457 | - * body: array, // (REQUIRED) The detector |
|
2458 | - * } $params |
|
2459 | - * |
|
2460 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2461 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2462 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2463 | - * |
|
2464 | - * @return Elasticsearch|Promise |
|
2465 | - */ |
|
2466 | - public function validateDetector(array $params = []) |
|
2467 | - { |
|
2468 | - $this->checkRequiredParameters(['body'], $params); |
|
2469 | - $url = '/_ml/anomaly_detectors/_validate/detector'; |
|
2470 | - $method = 'POST'; |
|
2471 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2472 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2473 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2474 | - } |
|
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 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
57 | + } |
|
58 | + /** |
|
59 | + * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. |
|
60 | + * |
|
61 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html |
|
62 | + * |
|
63 | + * @param array{ |
|
64 | + * job_id: string, // (REQUIRED) The name of the job to close |
|
65 | + * 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) |
|
66 | + * force: boolean, // True if the job should be forcefully closed |
|
67 | + * timeout: time, // Controls the time to wait until a job has closed. Default to 30 minutes |
|
68 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | + * body: array, // The URL params optionally sent in the body |
|
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 closeJob(array $params = []) |
|
84 | + { |
|
85 | + $this->checkRequiredParameters(['job_id'], $params); |
|
86 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
87 | + $method = 'POST'; |
|
88 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
90 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
91 | + } |
|
92 | + /** |
|
93 | + * Deletes a calendar. |
|
94 | + * |
|
95 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html |
|
96 | + * |
|
97 | + * @param array{ |
|
98 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to delete |
|
99 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
100 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
101 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
102 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
103 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
104 | + * } $params |
|
105 | + * |
|
106 | + * @throws MissingParameterException if a required parameter is missing |
|
107 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
108 | + * @throws ClientResponseException if the status code of response is 4xx |
|
109 | + * @throws ServerResponseException if the status code of response is 5xx |
|
110 | + * |
|
111 | + * @return Elasticsearch|Promise |
|
112 | + */ |
|
113 | + public function deleteCalendar(array $params = []) |
|
114 | + { |
|
115 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
116 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
117 | + $method = 'DELETE'; |
|
118 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
119 | + $headers = ['Accept' => 'application/json']; |
|
120 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
121 | + } |
|
122 | + /** |
|
123 | + * Deletes scheduled events from a calendar. |
|
124 | + * |
|
125 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html |
|
126 | + * |
|
127 | + * @param array{ |
|
128 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
129 | + * event_id: string, // (REQUIRED) The ID of the event to remove from the calendar |
|
130 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
131 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
132 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
133 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
134 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
135 | + * } $params |
|
136 | + * |
|
137 | + * @throws MissingParameterException if a required parameter is missing |
|
138 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
139 | + * @throws ClientResponseException if the status code of response is 4xx |
|
140 | + * @throws ServerResponseException if the status code of response is 5xx |
|
141 | + * |
|
142 | + * @return Elasticsearch|Promise |
|
143 | + */ |
|
144 | + public function deleteCalendarEvent(array $params = []) |
|
145 | + { |
|
146 | + $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
|
147 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
148 | + $method = 'DELETE'; |
|
149 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | + $headers = ['Accept' => 'application/json']; |
|
151 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
152 | + } |
|
153 | + /** |
|
154 | + * Deletes anomaly detection jobs from a calendar. |
|
155 | + * |
|
156 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html |
|
157 | + * |
|
158 | + * @param array{ |
|
159 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
160 | + * job_id: string, // (REQUIRED) The ID of the job to remove from the calendar |
|
161 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
162 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
163 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
164 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
165 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
166 | + * } $params |
|
167 | + * |
|
168 | + * @throws MissingParameterException if a required parameter is missing |
|
169 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | + * @throws ClientResponseException if the status code of response is 4xx |
|
171 | + * @throws ServerResponseException if the status code of response is 5xx |
|
172 | + * |
|
173 | + * @return Elasticsearch|Promise |
|
174 | + */ |
|
175 | + public function deleteCalendarJob(array $params = []) |
|
176 | + { |
|
177 | + $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
178 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
179 | + $method = 'DELETE'; |
|
180 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
181 | + $headers = ['Accept' => 'application/json']; |
|
182 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
183 | + } |
|
184 | + /** |
|
185 | + * Deletes an existing data frame analytics job. |
|
186 | + * |
|
187 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html |
|
188 | + * |
|
189 | + * @param array{ |
|
190 | + * id: string, // (REQUIRED) The ID of the data frame analytics to delete |
|
191 | + * force: boolean, // True if the job should be forcefully deleted |
|
192 | + * timeout: time, // Controls the time to wait until a job is deleted. Defaults to 1 minute |
|
193 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
194 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
195 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
196 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
197 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
198 | + * } $params |
|
199 | + * |
|
200 | + * @throws MissingParameterException if a required parameter is missing |
|
201 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
202 | + * @throws ClientResponseException if the status code of response is 4xx |
|
203 | + * @throws ServerResponseException if the status code of response is 5xx |
|
204 | + * |
|
205 | + * @return Elasticsearch|Promise |
|
206 | + */ |
|
207 | + public function deleteDataFrameAnalytics(array $params = []) |
|
208 | + { |
|
209 | + $this->checkRequiredParameters(['id'], $params); |
|
210 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
211 | + $method = 'DELETE'; |
|
212 | + $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
213 | + $headers = ['Accept' => 'application/json']; |
|
214 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
215 | + } |
|
216 | + /** |
|
217 | + * Deletes an existing datafeed. |
|
218 | + * |
|
219 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html |
|
220 | + * |
|
221 | + * @param array{ |
|
222 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to delete |
|
223 | + * force: boolean, // True if the datafeed should be forcefully deleted |
|
224 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
225 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
226 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
227 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
228 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
229 | + * } $params |
|
230 | + * |
|
231 | + * @throws MissingParameterException if a required parameter is missing |
|
232 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
233 | + * @throws ClientResponseException if the status code of response is 4xx |
|
234 | + * @throws ServerResponseException if the status code of response is 5xx |
|
235 | + * |
|
236 | + * @return Elasticsearch|Promise |
|
237 | + */ |
|
238 | + public function deleteDatafeed(array $params = []) |
|
239 | + { |
|
240 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
241 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
242 | + $method = 'DELETE'; |
|
243 | + $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
244 | + $headers = ['Accept' => 'application/json']; |
|
245 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
246 | + } |
|
247 | + /** |
|
248 | + * Deletes expired and unused machine learning data. |
|
249 | + * |
|
250 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html |
|
251 | + * |
|
252 | + * @param array{ |
|
253 | + * job_id: string, // The ID of the job(s) to perform expired data hygiene for |
|
254 | + * requests_per_second: number, // The desired requests per second for the deletion processes. |
|
255 | + * timeout: time, // How long can the underlying delete processes run until they are canceled |
|
256 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
257 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
258 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
259 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
260 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
261 | + * body: array, // deleting expired data parameters |
|
262 | + * } $params |
|
263 | + * |
|
264 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
265 | + * @throws ClientResponseException if the status code of response is 4xx |
|
266 | + * @throws ServerResponseException if the status code of response is 5xx |
|
267 | + * |
|
268 | + * @return Elasticsearch|Promise |
|
269 | + */ |
|
270 | + public function deleteExpiredData(array $params = []) |
|
271 | + { |
|
272 | + if (isset($params['job_id'])) { |
|
273 | + $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
274 | + $method = 'DELETE'; |
|
275 | + } else { |
|
276 | + $url = '/_ml/_delete_expired_data'; |
|
277 | + $method = 'DELETE'; |
|
278 | + } |
|
279 | + $url = $this->addQueryString($url, $params, ['requests_per_second', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
281 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
282 | + } |
|
283 | + /** |
|
284 | + * Deletes a filter. |
|
285 | + * |
|
286 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html |
|
287 | + * |
|
288 | + * @param array{ |
|
289 | + * filter_id: string, // (REQUIRED) The ID of the filter to delete |
|
290 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
291 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
292 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
293 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
294 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
295 | + * } $params |
|
296 | + * |
|
297 | + * @throws MissingParameterException if a required parameter is missing |
|
298 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
299 | + * @throws ClientResponseException if the status code of response is 4xx |
|
300 | + * @throws ServerResponseException if the status code of response is 5xx |
|
301 | + * |
|
302 | + * @return Elasticsearch|Promise |
|
303 | + */ |
|
304 | + public function deleteFilter(array $params = []) |
|
305 | + { |
|
306 | + $this->checkRequiredParameters(['filter_id'], $params); |
|
307 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
308 | + $method = 'DELETE'; |
|
309 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
310 | + $headers = ['Accept' => 'application/json']; |
|
311 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
312 | + } |
|
313 | + /** |
|
314 | + * Deletes forecasts from a machine learning job. |
|
315 | + * |
|
316 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html |
|
317 | + * |
|
318 | + * @param array{ |
|
319 | + * job_id: string, // (REQUIRED) The ID of the job from which to delete forecasts |
|
320 | + * forecast_id: string, // The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` |
|
321 | + * allow_no_forecasts: boolean, // Whether to ignore if `_all` matches no forecasts |
|
322 | + * timeout: time, // Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds |
|
323 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
324 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
325 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
326 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
327 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
328 | + * } $params |
|
329 | + * |
|
330 | + * @throws MissingParameterException if a required parameter is missing |
|
331 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
332 | + * @throws ClientResponseException if the status code of response is 4xx |
|
333 | + * @throws ServerResponseException if the status code of response is 5xx |
|
334 | + * |
|
335 | + * @return Elasticsearch|Promise |
|
336 | + */ |
|
337 | + public function deleteForecast(array $params = []) |
|
338 | + { |
|
339 | + $this->checkRequiredParameters(['job_id'], $params); |
|
340 | + if (isset($params['forecast_id'])) { |
|
341 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
342 | + $method = 'DELETE'; |
|
343 | + } else { |
|
344 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
345 | + $method = 'DELETE'; |
|
346 | + } |
|
347 | + $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
348 | + $headers = ['Accept' => 'application/json']; |
|
349 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
350 | + } |
|
351 | + /** |
|
352 | + * Deletes an existing anomaly detection job. |
|
353 | + * |
|
354 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html |
|
355 | + * |
|
356 | + * @param array{ |
|
357 | + * job_id: string, // (REQUIRED) The ID of the job to delete |
|
358 | + * force: boolean, // True if the job should be forcefully deleted |
|
359 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
360 | + * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
361 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
362 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
363 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
364 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
365 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
366 | + * } $params |
|
367 | + * |
|
368 | + * @throws MissingParameterException if a required parameter is missing |
|
369 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
370 | + * @throws ClientResponseException if the status code of response is 4xx |
|
371 | + * @throws ServerResponseException if the status code of response is 5xx |
|
372 | + * |
|
373 | + * @return Elasticsearch|Promise |
|
374 | + */ |
|
375 | + public function deleteJob(array $params = []) |
|
376 | + { |
|
377 | + $this->checkRequiredParameters(['job_id'], $params); |
|
378 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
379 | + $method = 'DELETE'; |
|
380 | + $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
381 | + $headers = ['Accept' => 'application/json']; |
|
382 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
383 | + } |
|
384 | + /** |
|
385 | + * Deletes an existing model snapshot. |
|
386 | + * |
|
387 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html |
|
388 | + * |
|
389 | + * @param array{ |
|
390 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
391 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to delete |
|
392 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
393 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
394 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
395 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
396 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
397 | + * } $params |
|
398 | + * |
|
399 | + * @throws MissingParameterException if a required parameter is missing |
|
400 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
401 | + * @throws ClientResponseException if the status code of response is 4xx |
|
402 | + * @throws ServerResponseException if the status code of response is 5xx |
|
403 | + * |
|
404 | + * @return Elasticsearch|Promise |
|
405 | + */ |
|
406 | + public function deleteModelSnapshot(array $params = []) |
|
407 | + { |
|
408 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
409 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
410 | + $method = 'DELETE'; |
|
411 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
412 | + $headers = ['Accept' => 'application/json']; |
|
413 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
414 | + } |
|
415 | + /** |
|
416 | + * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. |
|
417 | + * |
|
418 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html |
|
419 | + * |
|
420 | + * @param array{ |
|
421 | + * model_id: string, // (REQUIRED) The ID of the trained model to delete |
|
422 | + * timeout: time, // Controls the amount of time to wait for the model to be deleted. |
|
423 | + * force: boolean, // True if the model should be forcefully deleted |
|
424 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
425 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
426 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
427 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
428 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
429 | + * } $params |
|
430 | + * |
|
431 | + * @throws MissingParameterException if a required parameter is missing |
|
432 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
433 | + * @throws ClientResponseException if the status code of response is 4xx |
|
434 | + * @throws ServerResponseException if the status code of response is 5xx |
|
435 | + * |
|
436 | + * @return Elasticsearch|Promise |
|
437 | + */ |
|
438 | + public function deleteTrainedModel(array $params = []) |
|
439 | + { |
|
440 | + $this->checkRequiredParameters(['model_id'], $params); |
|
441 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
442 | + $method = 'DELETE'; |
|
443 | + $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
444 | + $headers = ['Accept' => 'application/json']; |
|
445 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
446 | + } |
|
447 | + /** |
|
448 | + * Deletes a model alias that refers to the trained model |
|
449 | + * |
|
450 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html |
|
451 | + * |
|
452 | + * @param array{ |
|
453 | + * model_alias: string, // (REQUIRED) The trained model alias to delete |
|
454 | + * model_id: string, // (REQUIRED) The trained model where the model alias is assigned |
|
455 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
456 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
457 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
458 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
459 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
460 | + * } $params |
|
461 | + * |
|
462 | + * @throws MissingParameterException if a required parameter is missing |
|
463 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
464 | + * @throws ClientResponseException if the status code of response is 4xx |
|
465 | + * @throws ServerResponseException if the status code of response is 5xx |
|
466 | + * |
|
467 | + * @return Elasticsearch|Promise |
|
468 | + */ |
|
469 | + public function deleteTrainedModelAlias(array $params = []) |
|
470 | + { |
|
471 | + $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
472 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
473 | + $method = 'DELETE'; |
|
474 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
475 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
476 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
477 | + } |
|
478 | + /** |
|
479 | + * Estimates the model memory |
|
480 | + * |
|
481 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html |
|
482 | + * |
|
483 | + * @param array{ |
|
484 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
485 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
486 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
487 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
488 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
489 | + * body: array, // (REQUIRED) The analysis config, plus cardinality estimates for fields it references |
|
490 | + * } $params |
|
491 | + * |
|
492 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
493 | + * @throws ClientResponseException if the status code of response is 4xx |
|
494 | + * @throws ServerResponseException if the status code of response is 5xx |
|
495 | + * |
|
496 | + * @return Elasticsearch|Promise |
|
497 | + */ |
|
498 | + public function estimateModelMemory(array $params = []) |
|
499 | + { |
|
500 | + $this->checkRequiredParameters(['body'], $params); |
|
501 | + $url = '/_ml/anomaly_detectors/_estimate_model_memory'; |
|
502 | + $method = 'POST'; |
|
503 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
504 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
505 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
506 | + } |
|
507 | + /** |
|
508 | + * Evaluates the data frame analytics for an annotated index. |
|
509 | + * |
|
510 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html |
|
511 | + * |
|
512 | + * @param array{ |
|
513 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
514 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
515 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
516 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
517 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
518 | + * body: array, // (REQUIRED) The evaluation definition |
|
519 | + * } $params |
|
520 | + * |
|
521 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
522 | + * @throws ClientResponseException if the status code of response is 4xx |
|
523 | + * @throws ServerResponseException if the status code of response is 5xx |
|
524 | + * |
|
525 | + * @return Elasticsearch|Promise |
|
526 | + */ |
|
527 | + public function evaluateDataFrame(array $params = []) |
|
528 | + { |
|
529 | + $this->checkRequiredParameters(['body'], $params); |
|
530 | + $url = '/_ml/data_frame/_evaluate'; |
|
531 | + $method = 'POST'; |
|
532 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
533 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
534 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
535 | + } |
|
536 | + /** |
|
537 | + * Explains a data frame analytics config. |
|
538 | + * |
|
539 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html |
|
540 | + * |
|
541 | + * @param array{ |
|
542 | + * id: string, // The ID of the data frame analytics to explain |
|
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, // The data frame analytics config to explain |
|
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 explainDataFrameAnalytics(array $params = []) |
|
558 | + { |
|
559 | + if (isset($params['id'])) { |
|
560 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
561 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
562 | + } else { |
|
563 | + $url = '/_ml/data_frame/analytics/_explain'; |
|
564 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
565 | + } |
|
566 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
567 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
568 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
569 | + } |
|
570 | + /** |
|
571 | + * Forces any buffered data to be processed by the job. |
|
572 | + * |
|
573 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html |
|
574 | + * |
|
575 | + * @param array{ |
|
576 | + * job_id: string, // (REQUIRED) The name of the job to flush |
|
577 | + * calc_interim: boolean, // Calculates interim results for the most recent bucket or all buckets within the latency period |
|
578 | + * start: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
579 | + * end: string, // When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results |
|
580 | + * advance_time: string, // Advances time to the given value generating results and updating the model for the advanced interval |
|
581 | + * skip_time: string, // Skips time to the given value without generating results or updating the model for the skipped interval |
|
582 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
583 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
584 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
585 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
586 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
587 | + * body: array, // Flush parameters |
|
588 | + * } $params |
|
589 | + * |
|
590 | + * @throws MissingParameterException if a required parameter is missing |
|
591 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
592 | + * @throws ClientResponseException if the status code of response is 4xx |
|
593 | + * @throws ServerResponseException if the status code of response is 5xx |
|
594 | + * |
|
595 | + * @return Elasticsearch|Promise |
|
596 | + */ |
|
597 | + public function flushJob(array $params = []) |
|
598 | + { |
|
599 | + $this->checkRequiredParameters(['job_id'], $params); |
|
600 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
601 | + $method = 'POST'; |
|
602 | + $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
603 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
604 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
605 | + } |
|
606 | + /** |
|
607 | + * Predicts the future behavior of a time series by using its historical behavior. |
|
608 | + * |
|
609 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html |
|
610 | + * |
|
611 | + * @param array{ |
|
612 | + * job_id: string, // (REQUIRED) The ID of the job to forecast for |
|
613 | + * duration: time, // The duration of the forecast |
|
614 | + * expires_in: time, // The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. |
|
615 | + * max_model_memory: string, // The max memory able to be used by the forecast. Default is 20mb. |
|
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, // Query parameters can be specified in the body |
|
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 forecast(array $params = []) |
|
632 | + { |
|
633 | + $this->checkRequiredParameters(['job_id'], $params); |
|
634 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
635 | + $method = 'POST'; |
|
636 | + $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
637 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
638 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
639 | + } |
|
640 | + /** |
|
641 | + * Retrieves anomaly detection job results for one or more buckets. |
|
642 | + * |
|
643 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html |
|
644 | + * |
|
645 | + * @param array{ |
|
646 | + * job_id: string, // (REQUIRED) ID of the job to get bucket results from |
|
647 | + * timestamp: string, // The timestamp of the desired single bucket result |
|
648 | + * expand: boolean, // Include anomaly records |
|
649 | + * exclude_interim: boolean, // Exclude interim results |
|
650 | + * from: int, // skips a number of buckets |
|
651 | + * size: int, // specifies a max number of buckets to get |
|
652 | + * start: string, // Start time filter for buckets |
|
653 | + * end: string, // End time filter for buckets |
|
654 | + * anomaly_score: double, // Filter for the most anomalous buckets |
|
655 | + * sort: string, // Sort buckets by a particular field |
|
656 | + * desc: boolean, // Set the sort direction |
|
657 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
658 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
659 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
660 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
661 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
662 | + * body: array, // Bucket selection details if not provided in URI |
|
663 | + * } $params |
|
664 | + * |
|
665 | + * @throws MissingParameterException if a required parameter is missing |
|
666 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
667 | + * @throws ClientResponseException if the status code of response is 4xx |
|
668 | + * @throws ServerResponseException if the status code of response is 5xx |
|
669 | + * |
|
670 | + * @return Elasticsearch|Promise |
|
671 | + */ |
|
672 | + public function getBuckets(array $params = []) |
|
673 | + { |
|
674 | + $this->checkRequiredParameters(['job_id'], $params); |
|
675 | + if (isset($params['timestamp'])) { |
|
676 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
677 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
678 | + } else { |
|
679 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
680 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
681 | + } |
|
682 | + $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
683 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
684 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
685 | + } |
|
686 | + /** |
|
687 | + * Retrieves information about the scheduled events in calendars. |
|
688 | + * |
|
689 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html |
|
690 | + * |
|
691 | + * @param array{ |
|
692 | + * calendar_id: string, // (REQUIRED) The ID of the calendar containing the events |
|
693 | + * job_id: string, // Get events for the job. When this option is used calendar_id must be '_all' |
|
694 | + * start: string, // Get events after this time |
|
695 | + * end: date, // Get events before this time |
|
696 | + * from: int, // Skips a number of events |
|
697 | + * size: int, // Specifies a max number of events to get |
|
698 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
699 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
700 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
701 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
702 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
703 | + * } $params |
|
704 | + * |
|
705 | + * @throws MissingParameterException if a required parameter is missing |
|
706 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
707 | + * @throws ClientResponseException if the status code of response is 4xx |
|
708 | + * @throws ServerResponseException if the status code of response is 5xx |
|
709 | + * |
|
710 | + * @return Elasticsearch|Promise |
|
711 | + */ |
|
712 | + public function getCalendarEvents(array $params = []) |
|
713 | + { |
|
714 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
715 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
716 | + $method = 'GET'; |
|
717 | + $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
718 | + $headers = ['Accept' => 'application/json']; |
|
719 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
720 | + } |
|
721 | + /** |
|
722 | + * Retrieves configuration information for calendars. |
|
723 | + * |
|
724 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html |
|
725 | + * |
|
726 | + * @param array{ |
|
727 | + * calendar_id: string, // The ID of the calendar to fetch |
|
728 | + * from: int, // skips a number of calendars |
|
729 | + * size: int, // specifies a max number of calendars to get |
|
730 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
731 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
732 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
733 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
734 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
735 | + * body: array, // The from and size parameters optionally sent in the body |
|
736 | + * } $params |
|
737 | + * |
|
738 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
739 | + * @throws ClientResponseException if the status code of response is 4xx |
|
740 | + * @throws ServerResponseException if the status code of response is 5xx |
|
741 | + * |
|
742 | + * @return Elasticsearch|Promise |
|
743 | + */ |
|
744 | + public function getCalendars(array $params = []) |
|
745 | + { |
|
746 | + if (isset($params['calendar_id'])) { |
|
747 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
748 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
749 | + } else { |
|
750 | + $url = '/_ml/calendars'; |
|
751 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
752 | + } |
|
753 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
754 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
755 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
756 | + } |
|
757 | + /** |
|
758 | + * Retrieves anomaly detection job results for one or more categories. |
|
759 | + * |
|
760 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html |
|
761 | + * |
|
762 | + * @param array{ |
|
763 | + * job_id: string, // (REQUIRED) The name of the job |
|
764 | + * category_id: long, // The identifier of the category definition of interest |
|
765 | + * from: int, // skips a number of categories |
|
766 | + * size: int, // specifies a max number of categories to get |
|
767 | + * 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. |
|
768 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
769 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
770 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
771 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
772 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
773 | + * body: array, // Category selection details if not provided in URI |
|
774 | + * } $params |
|
775 | + * |
|
776 | + * @throws MissingParameterException if a required parameter is missing |
|
777 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
778 | + * @throws ClientResponseException if the status code of response is 4xx |
|
779 | + * @throws ServerResponseException if the status code of response is 5xx |
|
780 | + * |
|
781 | + * @return Elasticsearch|Promise |
|
782 | + */ |
|
783 | + public function getCategories(array $params = []) |
|
784 | + { |
|
785 | + $this->checkRequiredParameters(['job_id'], $params); |
|
786 | + if (isset($params['category_id'])) { |
|
787 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
788 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
789 | + } else { |
|
790 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/'; |
|
791 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
792 | + } |
|
793 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
794 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
795 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
796 | + } |
|
797 | + /** |
|
798 | + * Retrieves configuration information for data frame analytics jobs. |
|
799 | + * |
|
800 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html |
|
801 | + * |
|
802 | + * @param array{ |
|
803 | + * id: string, // The ID of the data frame analytics to fetch |
|
804 | + * 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) |
|
805 | + * from: int, // skips a number of analytics |
|
806 | + * size: int, // specifies a max number of analytics to get |
|
807 | + * exclude_generated: boolean, // Omits fields that are illegal to set on data frame analytics PUT |
|
808 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
809 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
810 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
811 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
812 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
813 | + * } $params |
|
814 | + * |
|
815 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
816 | + * @throws ClientResponseException if the status code of response is 4xx |
|
817 | + * @throws ServerResponseException if the status code of response is 5xx |
|
818 | + * |
|
819 | + * @return Elasticsearch|Promise |
|
820 | + */ |
|
821 | + public function getDataFrameAnalytics(array $params = []) |
|
822 | + { |
|
823 | + if (isset($params['id'])) { |
|
824 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
825 | + $method = 'GET'; |
|
826 | + } else { |
|
827 | + $url = '/_ml/data_frame/analytics'; |
|
828 | + $method = 'GET'; |
|
829 | + } |
|
830 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
831 | + $headers = ['Accept' => 'application/json']; |
|
832 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
833 | + } |
|
834 | + /** |
|
835 | + * Retrieves usage information for data frame analytics jobs. |
|
836 | + * |
|
837 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html |
|
838 | + * |
|
839 | + * @param array{ |
|
840 | + * id: string, // The ID of the data frame analytics stats to fetch |
|
841 | + * 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) |
|
842 | + * from: int, // skips a number of analytics |
|
843 | + * size: int, // specifies a max number of analytics to get |
|
844 | + * verbose: boolean, // whether the stats response should be verbose |
|
845 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
846 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
847 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
848 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
849 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
850 | + * } $params |
|
851 | + * |
|
852 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
853 | + * @throws ClientResponseException if the status code of response is 4xx |
|
854 | + * @throws ServerResponseException if the status code of response is 5xx |
|
855 | + * |
|
856 | + * @return Elasticsearch|Promise |
|
857 | + */ |
|
858 | + public function getDataFrameAnalyticsStats(array $params = []) |
|
859 | + { |
|
860 | + if (isset($params['id'])) { |
|
861 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
862 | + $method = 'GET'; |
|
863 | + } else { |
|
864 | + $url = '/_ml/data_frame/analytics/_stats'; |
|
865 | + $method = 'GET'; |
|
866 | + } |
|
867 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
868 | + $headers = ['Accept' => 'application/json']; |
|
869 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
870 | + } |
|
871 | + /** |
|
872 | + * Retrieves usage information for datafeeds. |
|
873 | + * |
|
874 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html |
|
875 | + * |
|
876 | + * @param array{ |
|
877 | + * datafeed_id: string, // The ID of the datafeeds stats to fetch |
|
878 | + * 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) |
|
879 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
880 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
881 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
882 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
883 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
884 | + * } $params |
|
885 | + * |
|
886 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
887 | + * @throws ClientResponseException if the status code of response is 4xx |
|
888 | + * @throws ServerResponseException if the status code of response is 5xx |
|
889 | + * |
|
890 | + * @return Elasticsearch|Promise |
|
891 | + */ |
|
892 | + public function getDatafeedStats(array $params = []) |
|
893 | + { |
|
894 | + if (isset($params['datafeed_id'])) { |
|
895 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
896 | + $method = 'GET'; |
|
897 | + } else { |
|
898 | + $url = '/_ml/datafeeds/_stats'; |
|
899 | + $method = 'GET'; |
|
900 | + } |
|
901 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
902 | + $headers = ['Accept' => 'application/json']; |
|
903 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
904 | + } |
|
905 | + /** |
|
906 | + * Retrieves configuration information for datafeeds. |
|
907 | + * |
|
908 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html |
|
909 | + * |
|
910 | + * @param array{ |
|
911 | + * datafeed_id: string, // The ID of the datafeeds to fetch |
|
912 | + * 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) |
|
913 | + * exclude_generated: boolean, // Omits fields that are illegal to set on datafeed PUT |
|
914 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
915 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
916 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
917 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
918 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
919 | + * } $params |
|
920 | + * |
|
921 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
922 | + * @throws ClientResponseException if the status code of response is 4xx |
|
923 | + * @throws ServerResponseException if the status code of response is 5xx |
|
924 | + * |
|
925 | + * @return Elasticsearch|Promise |
|
926 | + */ |
|
927 | + public function getDatafeeds(array $params = []) |
|
928 | + { |
|
929 | + if (isset($params['datafeed_id'])) { |
|
930 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
931 | + $method = 'GET'; |
|
932 | + } else { |
|
933 | + $url = '/_ml/datafeeds'; |
|
934 | + $method = 'GET'; |
|
935 | + } |
|
936 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
937 | + $headers = ['Accept' => 'application/json']; |
|
938 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
939 | + } |
|
940 | + /** |
|
941 | + * Retrieves filters. |
|
942 | + * |
|
943 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html |
|
944 | + * |
|
945 | + * @param array{ |
|
946 | + * filter_id: string, // The ID of the filter to fetch |
|
947 | + * from: int, // skips a number of filters |
|
948 | + * size: int, // specifies a max number of filters to get |
|
949 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
950 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
951 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
952 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
953 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
954 | + * } $params |
|
955 | + * |
|
956 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
957 | + * @throws ClientResponseException if the status code of response is 4xx |
|
958 | + * @throws ServerResponseException if the status code of response is 5xx |
|
959 | + * |
|
960 | + * @return Elasticsearch|Promise |
|
961 | + */ |
|
962 | + public function getFilters(array $params = []) |
|
963 | + { |
|
964 | + if (isset($params['filter_id'])) { |
|
965 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
966 | + $method = 'GET'; |
|
967 | + } else { |
|
968 | + $url = '/_ml/filters'; |
|
969 | + $method = 'GET'; |
|
970 | + } |
|
971 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
972 | + $headers = ['Accept' => 'application/json']; |
|
973 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
974 | + } |
|
975 | + /** |
|
976 | + * Retrieves anomaly detection job results for one or more influencers. |
|
977 | + * |
|
978 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html |
|
979 | + * |
|
980 | + * @param array{ |
|
981 | + * job_id: string, // (REQUIRED) Identifier for the anomaly detection job |
|
982 | + * exclude_interim: boolean, // Exclude interim results |
|
983 | + * from: int, // skips a number of influencers |
|
984 | + * size: int, // specifies a max number of influencers to get |
|
985 | + * start: string, // start timestamp for the requested influencers |
|
986 | + * end: string, // end timestamp for the requested influencers |
|
987 | + * influencer_score: double, // influencer score threshold for the requested influencers |
|
988 | + * sort: string, // sort field for the requested influencers |
|
989 | + * desc: boolean, // whether the results should be sorted in decending order |
|
990 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
991 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
992 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
993 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
994 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
995 | + * body: array, // Influencer selection criteria |
|
996 | + * } $params |
|
997 | + * |
|
998 | + * @throws MissingParameterException if a required parameter is missing |
|
999 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1000 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1001 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1002 | + * |
|
1003 | + * @return Elasticsearch|Promise |
|
1004 | + */ |
|
1005 | + public function getInfluencers(array $params = []) |
|
1006 | + { |
|
1007 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1008 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
1009 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1010 | + $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1011 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1012 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1013 | + } |
|
1014 | + /** |
|
1015 | + * Retrieves usage information for anomaly detection jobs. |
|
1016 | + * |
|
1017 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html |
|
1018 | + * |
|
1019 | + * @param array{ |
|
1020 | + * job_id: string, // The ID of the jobs stats to fetch |
|
1021 | + * 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) |
|
1022 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1023 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1024 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1025 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1026 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1027 | + * } $params |
|
1028 | + * |
|
1029 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1030 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1031 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1032 | + * |
|
1033 | + * @return Elasticsearch|Promise |
|
1034 | + */ |
|
1035 | + public function getJobStats(array $params = []) |
|
1036 | + { |
|
1037 | + if (isset($params['job_id'])) { |
|
1038 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
1039 | + $method = 'GET'; |
|
1040 | + } else { |
|
1041 | + $url = '/_ml/anomaly_detectors/_stats'; |
|
1042 | + $method = 'GET'; |
|
1043 | + } |
|
1044 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1045 | + $headers = ['Accept' => 'application/json']; |
|
1046 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1047 | + } |
|
1048 | + /** |
|
1049 | + * Retrieves configuration information for anomaly detection jobs. |
|
1050 | + * |
|
1051 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html |
|
1052 | + * |
|
1053 | + * @param array{ |
|
1054 | + * job_id: string, // The ID of the jobs to fetch |
|
1055 | + * 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) |
|
1056 | + * exclude_generated: boolean, // Omits fields that are illegal to set on job PUT |
|
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 getJobs(array $params = []) |
|
1071 | + { |
|
1072 | + if (isset($params['job_id'])) { |
|
1073 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1074 | + $method = 'GET'; |
|
1075 | + } else { |
|
1076 | + $url = '/_ml/anomaly_detectors'; |
|
1077 | + $method = 'GET'; |
|
1078 | + } |
|
1079 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1080 | + $headers = ['Accept' => 'application/json']; |
|
1081 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1082 | + } |
|
1083 | + /** |
|
1084 | + * Returns information on how ML is using memory. |
|
1085 | + * |
|
1086 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html |
|
1087 | + * |
|
1088 | + * @param array{ |
|
1089 | + * node_id: string, // Specifies the node or nodes to retrieve stats for. |
|
1090 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
1091 | + * timeout: time, // Explicit operation timeout |
|
1092 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1093 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1094 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1095 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1096 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1097 | + * } $params |
|
1098 | + * |
|
1099 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1100 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1101 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1102 | + * |
|
1103 | + * @return Elasticsearch|Promise |
|
1104 | + */ |
|
1105 | + public function getMemoryStats(array $params = []) |
|
1106 | + { |
|
1107 | + if (isset($params['node_id'])) { |
|
1108 | + $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
1109 | + $method = 'GET'; |
|
1110 | + } else { |
|
1111 | + $url = '/_ml/memory/_stats'; |
|
1112 | + $method = 'GET'; |
|
1113 | + } |
|
1114 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1115 | + $headers = ['Accept' => 'application/json']; |
|
1116 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1117 | + } |
|
1118 | + /** |
|
1119 | + * Gets stats for anomaly detection job model snapshot upgrades that are in progress. |
|
1120 | + * |
|
1121 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html |
|
1122 | + * |
|
1123 | + * @param array{ |
|
1124 | + * job_id: string, // (REQUIRED) The ID of the job. May be a wildcard, comma separated list or `_all`. |
|
1125 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot. May be a wildcard, comma separated list or `_all`. |
|
1126 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) |
|
1127 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1128 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1129 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1130 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1131 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1132 | + * } $params |
|
1133 | + * |
|
1134 | + * @throws MissingParameterException if a required parameter is missing |
|
1135 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1136 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1137 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1138 | + * |
|
1139 | + * @return Elasticsearch|Promise |
|
1140 | + */ |
|
1141 | + public function getModelSnapshotUpgradeStats(array $params = []) |
|
1142 | + { |
|
1143 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
1144 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
1145 | + $method = 'GET'; |
|
1146 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1147 | + $headers = ['Accept' => 'application/json']; |
|
1148 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1149 | + } |
|
1150 | + /** |
|
1151 | + * Retrieves information about model snapshots. |
|
1152 | + * |
|
1153 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html |
|
1154 | + * |
|
1155 | + * @param array{ |
|
1156 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
1157 | + * snapshot_id: string, // The ID of the snapshot to fetch |
|
1158 | + * from: int, // Skips a number of documents |
|
1159 | + * size: int, // The default number of documents returned in queries as a string. |
|
1160 | + * start: date, // The filter 'start' query parameter |
|
1161 | + * end: date, // The filter 'end' query parameter |
|
1162 | + * sort: string, // Name of the field to sort on |
|
1163 | + * desc: boolean, // True if the results should be sorted in descending order |
|
1164 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1165 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1166 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1167 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1168 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1169 | + * body: array, // Model snapshot selection criteria |
|
1170 | + * } $params |
|
1171 | + * |
|
1172 | + * @throws MissingParameterException if a required parameter is missing |
|
1173 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1174 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1175 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1176 | + * |
|
1177 | + * @return Elasticsearch|Promise |
|
1178 | + */ |
|
1179 | + public function getModelSnapshots(array $params = []) |
|
1180 | + { |
|
1181 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1182 | + if (isset($params['snapshot_id'])) { |
|
1183 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
1184 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1185 | + } else { |
|
1186 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
1187 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1188 | + } |
|
1189 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1190 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1191 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1192 | + } |
|
1193 | + /** |
|
1194 | + * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. |
|
1195 | + * |
|
1196 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html |
|
1197 | + * |
|
1198 | + * @param array{ |
|
1199 | + * job_id: string, // (REQUIRED) The job IDs for which to calculate overall bucket results |
|
1200 | + * top_n: int, // The number of top job bucket scores to be used in the overall_score calculation |
|
1201 | + * bucket_span: string, // The span of the overall buckets. Defaults to the longest job bucket_span |
|
1202 | + * overall_score: double, // Returns overall buckets with overall scores higher than this value |
|
1203 | + * exclude_interim: boolean, // If true overall buckets that include interim buckets will be excluded |
|
1204 | + * start: string, // Returns overall buckets with timestamps after this time |
|
1205 | + * end: string, // Returns overall buckets with timestamps earlier than this time |
|
1206 | + * 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) |
|
1207 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1208 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1209 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1210 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1211 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1212 | + * body: array, // Overall bucket selection details if not provided in URI |
|
1213 | + * } $params |
|
1214 | + * |
|
1215 | + * @throws MissingParameterException if a required parameter is missing |
|
1216 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1217 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1218 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1219 | + * |
|
1220 | + * @return Elasticsearch|Promise |
|
1221 | + */ |
|
1222 | + public function getOverallBuckets(array $params = []) |
|
1223 | + { |
|
1224 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1225 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
1226 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1227 | + $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']); |
|
1228 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1229 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1230 | + } |
|
1231 | + /** |
|
1232 | + * Retrieves anomaly records for an anomaly detection job. |
|
1233 | + * |
|
1234 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html |
|
1235 | + * |
|
1236 | + * @param array{ |
|
1237 | + * job_id: string, // (REQUIRED) The ID of the job |
|
1238 | + * exclude_interim: boolean, // Exclude interim results |
|
1239 | + * from: int, // skips a number of records |
|
1240 | + * size: int, // specifies a max number of records to get |
|
1241 | + * start: string, // Start time filter for records |
|
1242 | + * end: string, // End time filter for records |
|
1243 | + * record_score: double, // Returns records with anomaly scores greater or equal than this value |
|
1244 | + * sort: string, // Sort records by a particular field |
|
1245 | + * desc: boolean, // Set the sort direction |
|
1246 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1247 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1248 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1249 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1250 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1251 | + * body: array, // Record selection criteria |
|
1252 | + * } $params |
|
1253 | + * |
|
1254 | + * @throws MissingParameterException if a required parameter is missing |
|
1255 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1256 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1257 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1258 | + * |
|
1259 | + * @return Elasticsearch|Promise |
|
1260 | + */ |
|
1261 | + public function getRecords(array $params = []) |
|
1262 | + { |
|
1263 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1264 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
1265 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1266 | + $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1267 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1268 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1269 | + } |
|
1270 | + /** |
|
1271 | + * Retrieves configuration information for a trained inference model. |
|
1272 | + * |
|
1273 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html |
|
1274 | + * |
|
1275 | + * @param array{ |
|
1276 | + * model_id: string, // The ID of the trained models to fetch |
|
1277 | + * 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) |
|
1278 | + * include: string, // A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. |
|
1279 | + * 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. |
|
1280 | + * decompress_definition: boolean, // Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. |
|
1281 | + * from: int, // skips a number of trained models |
|
1282 | + * size: int, // specifies a max number of trained models to get |
|
1283 | + * tags: list, // A comma-separated list of tags that the model must have. |
|
1284 | + * exclude_generated: boolean, // Omits fields that are illegal to set on model PUT |
|
1285 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1286 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1287 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1288 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1289 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1290 | + * } $params |
|
1291 | + * |
|
1292 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1293 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1294 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1295 | + * |
|
1296 | + * @return Elasticsearch|Promise |
|
1297 | + */ |
|
1298 | + public function getTrainedModels(array $params = []) |
|
1299 | + { |
|
1300 | + if (isset($params['model_id'])) { |
|
1301 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1302 | + $method = 'GET'; |
|
1303 | + } else { |
|
1304 | + $url = '/_ml/trained_models'; |
|
1305 | + $method = 'GET'; |
|
1306 | + } |
|
1307 | + $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']); |
|
1308 | + $headers = ['Accept' => 'application/json']; |
|
1309 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1310 | + } |
|
1311 | + /** |
|
1312 | + * Retrieves usage information for trained inference models. |
|
1313 | + * |
|
1314 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html |
|
1315 | + * |
|
1316 | + * @param array{ |
|
1317 | + * model_id: string, // The ID of the trained models stats to fetch |
|
1318 | + * 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) |
|
1319 | + * from: int, // skips a number of trained models |
|
1320 | + * size: int, // specifies a max number of trained models to get |
|
1321 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1322 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1323 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1324 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1325 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1326 | + * } $params |
|
1327 | + * |
|
1328 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1329 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1330 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1331 | + * |
|
1332 | + * @return Elasticsearch|Promise |
|
1333 | + */ |
|
1334 | + public function getTrainedModelsStats(array $params = []) |
|
1335 | + { |
|
1336 | + if (isset($params['model_id'])) { |
|
1337 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
1338 | + $method = 'GET'; |
|
1339 | + } else { |
|
1340 | + $url = '/_ml/trained_models/_stats'; |
|
1341 | + $method = 'GET'; |
|
1342 | + } |
|
1343 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1344 | + $headers = ['Accept' => 'application/json']; |
|
1345 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1346 | + } |
|
1347 | + /** |
|
1348 | + * Evaluate a trained model. |
|
1349 | + * |
|
1350 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html |
|
1351 | + * |
|
1352 | + * @param array{ |
|
1353 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
1354 | + * timeout: time, // Controls the amount of time to wait for inference results. |
|
1355 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1356 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1357 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1358 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1359 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1360 | + * body: array, // (REQUIRED) The docs to apply inference on and inference configuration overrides |
|
1361 | + * } $params |
|
1362 | + * |
|
1363 | + * @throws MissingParameterException if a required parameter is missing |
|
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 inferTrainedModel(array $params = []) |
|
1371 | + { |
|
1372 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1373 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
1374 | + $method = 'POST'; |
|
1375 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1376 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1377 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1378 | + } |
|
1379 | + /** |
|
1380 | + * Returns defaults and limits used by machine learning. |
|
1381 | + * |
|
1382 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html |
|
1383 | + * |
|
1384 | + * @param array{ |
|
1385 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1386 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1387 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1388 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1389 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1390 | + * } $params |
|
1391 | + * |
|
1392 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1393 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1394 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1395 | + * |
|
1396 | + * @return Elasticsearch|Promise |
|
1397 | + */ |
|
1398 | + public function info(array $params = []) |
|
1399 | + { |
|
1400 | + $url = '/_ml/info'; |
|
1401 | + $method = 'GET'; |
|
1402 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1403 | + $headers = ['Accept' => 'application/json']; |
|
1404 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1405 | + } |
|
1406 | + /** |
|
1407 | + * Opens one or more anomaly detection jobs. |
|
1408 | + * |
|
1409 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html |
|
1410 | + * |
|
1411 | + * @param array{ |
|
1412 | + * job_id: string, // (REQUIRED) The ID of the job to open |
|
1413 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1414 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1415 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1416 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1417 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1418 | + * body: array, // Query parameters can be specified in the body |
|
1419 | + * } $params |
|
1420 | + * |
|
1421 | + * @throws MissingParameterException if a required parameter is missing |
|
1422 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1423 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1424 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1425 | + * |
|
1426 | + * @return Elasticsearch|Promise |
|
1427 | + */ |
|
1428 | + public function openJob(array $params = []) |
|
1429 | + { |
|
1430 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1431 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
1432 | + $method = 'POST'; |
|
1433 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1434 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1435 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1436 | + } |
|
1437 | + /** |
|
1438 | + * Posts scheduled events in a calendar. |
|
1439 | + * |
|
1440 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html |
|
1441 | + * |
|
1442 | + * @param array{ |
|
1443 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
1444 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1445 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1446 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1447 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1448 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1449 | + * body: array, // (REQUIRED) A list of events |
|
1450 | + * } $params |
|
1451 | + * |
|
1452 | + * @throws MissingParameterException if a required parameter is missing |
|
1453 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1454 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1455 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1456 | + * |
|
1457 | + * @return Elasticsearch|Promise |
|
1458 | + */ |
|
1459 | + public function postCalendarEvents(array $params = []) |
|
1460 | + { |
|
1461 | + $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
|
1462 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
1463 | + $method = 'POST'; |
|
1464 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1465 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1466 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1467 | + } |
|
1468 | + /** |
|
1469 | + * Sends data to an anomaly detection job for analysis. |
|
1470 | + * |
|
1471 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html |
|
1472 | + * |
|
1473 | + * @param array{ |
|
1474 | + * job_id: string, // (REQUIRED) The name of the job receiving the data |
|
1475 | + * reset_start: string, // Optional parameter to specify the start of the bucket resetting range |
|
1476 | + * reset_end: string, // Optional parameter to specify the end of the bucket resetting range |
|
1477 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1478 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1479 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1480 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1481 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1482 | + * body: array, // (REQUIRED) The data to process |
|
1483 | + * } $params |
|
1484 | + * |
|
1485 | + * @throws MissingParameterException if a required parameter is missing |
|
1486 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1487 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1488 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1489 | + * |
|
1490 | + * @return Elasticsearch|Promise |
|
1491 | + */ |
|
1492 | + public function postData(array $params = []) |
|
1493 | + { |
|
1494 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
1495 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
1496 | + $method = 'POST'; |
|
1497 | + $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1498 | + $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
|
1499 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1500 | + } |
|
1501 | + /** |
|
1502 | + * Previews that will be analyzed given a data frame analytics config. |
|
1503 | + * |
|
1504 | + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html |
|
1505 | + * |
|
1506 | + * @param array{ |
|
1507 | + * id: string, // The ID of the data frame analytics to preview |
|
1508 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1509 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1510 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1511 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1512 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1513 | + * body: array, // The data frame analytics config to preview |
|
1514 | + * } $params |
|
1515 | + * |
|
1516 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1517 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1518 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1519 | + * |
|
1520 | + * @return Elasticsearch|Promise |
|
1521 | + */ |
|
1522 | + public function previewDataFrameAnalytics(array $params = []) |
|
1523 | + { |
|
1524 | + if (isset($params['id'])) { |
|
1525 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
1526 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1527 | + } else { |
|
1528 | + $url = '/_ml/data_frame/analytics/_preview'; |
|
1529 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1530 | + } |
|
1531 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1532 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1533 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1534 | + } |
|
1535 | + /** |
|
1536 | + * Previews a datafeed. |
|
1537 | + * |
|
1538 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html |
|
1539 | + * |
|
1540 | + * @param array{ |
|
1541 | + * datafeed_id: string, // The ID of the datafeed to preview |
|
1542 | + * start: string, // The start time from where the datafeed preview should begin |
|
1543 | + * end: string, // The end time when the datafeed preview should stop |
|
1544 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1545 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1546 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1547 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1548 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1549 | + * body: array, // The datafeed config and job config with which to execute the preview |
|
1550 | + * } $params |
|
1551 | + * |
|
1552 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1553 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1554 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1555 | + * |
|
1556 | + * @return Elasticsearch|Promise |
|
1557 | + */ |
|
1558 | + public function previewDatafeed(array $params = []) |
|
1559 | + { |
|
1560 | + if (isset($params['datafeed_id'])) { |
|
1561 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
1562 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1563 | + } else { |
|
1564 | + $url = '/_ml/datafeeds/_preview'; |
|
1565 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1566 | + } |
|
1567 | + $url = $this->addQueryString($url, $params, ['start', 'end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1568 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1569 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1570 | + } |
|
1571 | + /** |
|
1572 | + * Instantiates a calendar. |
|
1573 | + * |
|
1574 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html |
|
1575 | + * |
|
1576 | + * @param array{ |
|
1577 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to create |
|
1578 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1579 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1580 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1581 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1582 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1583 | + * body: array, // The calendar details |
|
1584 | + * } $params |
|
1585 | + * |
|
1586 | + * @throws MissingParameterException if a required parameter is missing |
|
1587 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1588 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1589 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1590 | + * |
|
1591 | + * @return Elasticsearch|Promise |
|
1592 | + */ |
|
1593 | + public function putCalendar(array $params = []) |
|
1594 | + { |
|
1595 | + $this->checkRequiredParameters(['calendar_id'], $params); |
|
1596 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
1597 | + $method = 'PUT'; |
|
1598 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1599 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1600 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1601 | + } |
|
1602 | + /** |
|
1603 | + * Adds an anomaly detection job to a calendar. |
|
1604 | + * |
|
1605 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html |
|
1606 | + * |
|
1607 | + * @param array{ |
|
1608 | + * calendar_id: string, // (REQUIRED) The ID of the calendar to modify |
|
1609 | + * job_id: string, // (REQUIRED) The ID of the job to add to the calendar |
|
1610 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1611 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1612 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1613 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1614 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1615 | + * } $params |
|
1616 | + * |
|
1617 | + * @throws MissingParameterException if a required parameter is missing |
|
1618 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1619 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1620 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1621 | + * |
|
1622 | + * @return Elasticsearch|Promise |
|
1623 | + */ |
|
1624 | + public function putCalendarJob(array $params = []) |
|
1625 | + { |
|
1626 | + $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
|
1627 | + $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
1628 | + $method = 'PUT'; |
|
1629 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1630 | + $headers = ['Accept' => 'application/json']; |
|
1631 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1632 | + } |
|
1633 | + /** |
|
1634 | + * Instantiates a data frame analytics job. |
|
1635 | + * |
|
1636 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html |
|
1637 | + * |
|
1638 | + * @param array{ |
|
1639 | + * id: string, // (REQUIRED) The ID of the data frame analytics to create |
|
1640 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1641 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1642 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1643 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1644 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1645 | + * body: array, // (REQUIRED) The data frame analytics configuration |
|
1646 | + * } $params |
|
1647 | + * |
|
1648 | + * @throws MissingParameterException if a required parameter is missing |
|
1649 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1650 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1651 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1652 | + * |
|
1653 | + * @return Elasticsearch|Promise |
|
1654 | + */ |
|
1655 | + public function putDataFrameAnalytics(array $params = []) |
|
1656 | + { |
|
1657 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
1658 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
1659 | + $method = 'PUT'; |
|
1660 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1661 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1662 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1663 | + } |
|
1664 | + /** |
|
1665 | + * Instantiates a datafeed. |
|
1666 | + * |
|
1667 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html |
|
1668 | + * |
|
1669 | + * @param array{ |
|
1670 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to create |
|
1671 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
1672 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
1673 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
1674 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
1675 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1676 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1677 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1678 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1679 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1680 | + * body: array, // (REQUIRED) The datafeed config |
|
1681 | + * } $params |
|
1682 | + * |
|
1683 | + * @throws MissingParameterException if a required parameter is missing |
|
1684 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1685 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1686 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1687 | + * |
|
1688 | + * @return Elasticsearch|Promise |
|
1689 | + */ |
|
1690 | + public function putDatafeed(array $params = []) |
|
1691 | + { |
|
1692 | + $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
1693 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
1694 | + $method = 'PUT'; |
|
1695 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1696 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1697 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1698 | + } |
|
1699 | + /** |
|
1700 | + * Instantiates a filter. |
|
1701 | + * |
|
1702 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html |
|
1703 | + * |
|
1704 | + * @param array{ |
|
1705 | + * filter_id: string, // (REQUIRED) The ID of the filter to create |
|
1706 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1707 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1708 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1709 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1710 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1711 | + * body: array, // (REQUIRED) The filter details |
|
1712 | + * } $params |
|
1713 | + * |
|
1714 | + * @throws MissingParameterException if a required parameter is missing |
|
1715 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1716 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1717 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1718 | + * |
|
1719 | + * @return Elasticsearch|Promise |
|
1720 | + */ |
|
1721 | + public function putFilter(array $params = []) |
|
1722 | + { |
|
1723 | + $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
1724 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
1725 | + $method = 'PUT'; |
|
1726 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1727 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1728 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1729 | + } |
|
1730 | + /** |
|
1731 | + * Instantiates an anomaly detection job. |
|
1732 | + * |
|
1733 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html |
|
1734 | + * |
|
1735 | + * @param array{ |
|
1736 | + * job_id: string, // (REQUIRED) The ID of the job to create |
|
1737 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. |
|
1738 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. |
|
1739 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. |
|
1740 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. |
|
1741 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1742 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1743 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1744 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1745 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1746 | + * body: array, // (REQUIRED) The job |
|
1747 | + * } $params |
|
1748 | + * |
|
1749 | + * @throws MissingParameterException if a required parameter is missing |
|
1750 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1751 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1752 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1753 | + * |
|
1754 | + * @return Elasticsearch|Promise |
|
1755 | + */ |
|
1756 | + public function putJob(array $params = []) |
|
1757 | + { |
|
1758 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
1759 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1760 | + $method = 'PUT'; |
|
1761 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1762 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1763 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1764 | + } |
|
1765 | + /** |
|
1766 | + * Creates an inference trained model. |
|
1767 | + * |
|
1768 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html |
|
1769 | + * |
|
1770 | + * @param array{ |
|
1771 | + * model_id: string, // (REQUIRED) The ID of the trained models to store |
|
1772 | + * defer_definition_decompression: boolean, // If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. |
|
1773 | + * wait_for_completion: boolean, // Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false |
|
1774 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1775 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1776 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1777 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1778 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1779 | + * body: array, // (REQUIRED) The trained model configuration |
|
1780 | + * } $params |
|
1781 | + * |
|
1782 | + * @throws MissingParameterException if a required parameter is missing |
|
1783 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1784 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1785 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1786 | + * |
|
1787 | + * @return Elasticsearch|Promise |
|
1788 | + */ |
|
1789 | + public function putTrainedModel(array $params = []) |
|
1790 | + { |
|
1791 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1792 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1793 | + $method = 'PUT'; |
|
1794 | + $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1795 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1796 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1797 | + } |
|
1798 | + /** |
|
1799 | + * Creates a new model alias (or reassigns an existing one) to refer to the trained model |
|
1800 | + * |
|
1801 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html |
|
1802 | + * |
|
1803 | + * @param array{ |
|
1804 | + * model_alias: string, // (REQUIRED) The trained model alias to update |
|
1805 | + * model_id: string, // (REQUIRED) The trained model where the model alias should be assigned |
|
1806 | + * reassign: boolean, // If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. |
|
1807 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1808 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1809 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1810 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1811 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1812 | + * } $params |
|
1813 | + * |
|
1814 | + * @throws MissingParameterException if a required parameter is missing |
|
1815 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1816 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1817 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1818 | + * |
|
1819 | + * @return Elasticsearch|Promise |
|
1820 | + */ |
|
1821 | + public function putTrainedModelAlias(array $params = []) |
|
1822 | + { |
|
1823 | + $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
|
1824 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
1825 | + $method = 'PUT'; |
|
1826 | + $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1827 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1828 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1829 | + } |
|
1830 | + /** |
|
1831 | + * Creates part of a trained model definition |
|
1832 | + * |
|
1833 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html |
|
1834 | + * |
|
1835 | + * @param array{ |
|
1836 | + * model_id: string, // (REQUIRED) The ID of the trained model for this definition part |
|
1837 | + * part: int, // (REQUIRED) The part number |
|
1838 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1839 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1840 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1841 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1842 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1843 | + * body: array, // (REQUIRED) The trained model definition part |
|
1844 | + * } $params |
|
1845 | + * |
|
1846 | + * @throws MissingParameterException if a required parameter is missing |
|
1847 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1848 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1849 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1850 | + * |
|
1851 | + * @return Elasticsearch|Promise |
|
1852 | + */ |
|
1853 | + public function putTrainedModelDefinitionPart(array $params = []) |
|
1854 | + { |
|
1855 | + $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
|
1856 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
1857 | + $method = 'PUT'; |
|
1858 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1859 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1860 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1861 | + } |
|
1862 | + /** |
|
1863 | + * Creates a trained model vocabulary |
|
1864 | + * |
|
1865 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html |
|
1866 | + * |
|
1867 | + * @param array{ |
|
1868 | + * model_id: string, // (REQUIRED) The ID of the trained model for this vocabulary |
|
1869 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1870 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1871 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1872 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1873 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1874 | + * body: array, // (REQUIRED) The trained model vocabulary |
|
1875 | + * } $params |
|
1876 | + * |
|
1877 | + * @throws MissingParameterException if a required parameter is missing |
|
1878 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1879 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1880 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1881 | + * |
|
1882 | + * @return Elasticsearch|Promise |
|
1883 | + */ |
|
1884 | + public function putTrainedModelVocabulary(array $params = []) |
|
1885 | + { |
|
1886 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
1887 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
1888 | + $method = 'PUT'; |
|
1889 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1890 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1891 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1892 | + } |
|
1893 | + /** |
|
1894 | + * Resets an existing anomaly detection job. |
|
1895 | + * |
|
1896 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html |
|
1897 | + * |
|
1898 | + * @param array{ |
|
1899 | + * job_id: string, // (REQUIRED) The ID of the job to reset |
|
1900 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
1901 | + * delete_user_annotations: boolean, // Should annotations added by the user be deleted |
|
1902 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1903 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1904 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1905 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1906 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1907 | + * } $params |
|
1908 | + * |
|
1909 | + * @throws MissingParameterException if a required parameter is missing |
|
1910 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1911 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1912 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1913 | + * |
|
1914 | + * @return Elasticsearch|Promise |
|
1915 | + */ |
|
1916 | + public function resetJob(array $params = []) |
|
1917 | + { |
|
1918 | + $this->checkRequiredParameters(['job_id'], $params); |
|
1919 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
1920 | + $method = 'POST'; |
|
1921 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1922 | + $headers = ['Accept' => 'application/json']; |
|
1923 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1924 | + } |
|
1925 | + /** |
|
1926 | + * Reverts to a specific snapshot. |
|
1927 | + * |
|
1928 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html |
|
1929 | + * |
|
1930 | + * @param array{ |
|
1931 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
1932 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to revert to |
|
1933 | + * delete_intervening_results: boolean, // Should we reset the results back to the time of the snapshot? |
|
1934 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1935 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1936 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1937 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1938 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1939 | + * body: array, // Reversion options |
|
1940 | + * } $params |
|
1941 | + * |
|
1942 | + * @throws MissingParameterException if a required parameter is missing |
|
1943 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1944 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1945 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1946 | + * |
|
1947 | + * @return Elasticsearch|Promise |
|
1948 | + */ |
|
1949 | + public function revertModelSnapshot(array $params = []) |
|
1950 | + { |
|
1951 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
1952 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
1953 | + $method = 'POST'; |
|
1954 | + $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1955 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1956 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1957 | + } |
|
1958 | + /** |
|
1959 | + * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. |
|
1960 | + * |
|
1961 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html |
|
1962 | + * |
|
1963 | + * @param array{ |
|
1964 | + * enabled: boolean, // Whether to enable upgrade_mode ML setting or not. Defaults to false. |
|
1965 | + * timeout: time, // Controls the time to wait before action times out. Defaults to 30 seconds |
|
1966 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1967 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1968 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1969 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1970 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1971 | + * } $params |
|
1972 | + * |
|
1973 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1974 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1975 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1976 | + * |
|
1977 | + * @return Elasticsearch|Promise |
|
1978 | + */ |
|
1979 | + public function setUpgradeMode(array $params = []) |
|
1980 | + { |
|
1981 | + $url = '/_ml/set_upgrade_mode'; |
|
1982 | + $method = 'POST'; |
|
1983 | + $url = $this->addQueryString($url, $params, ['enabled', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1984 | + $headers = ['Accept' => 'application/json']; |
|
1985 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
1986 | + } |
|
1987 | + /** |
|
1988 | + * Starts a data frame analytics job. |
|
1989 | + * |
|
1990 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html |
|
1991 | + * |
|
1992 | + * @param array{ |
|
1993 | + * id: string, // (REQUIRED) The ID of the data frame analytics to start |
|
1994 | + * timeout: time, // Controls the time to wait until the task has started. Defaults to 20 seconds |
|
1995 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1996 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1997 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1998 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1999 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2000 | + * body: array, // The start data frame analytics parameters |
|
2001 | + * } $params |
|
2002 | + * |
|
2003 | + * @throws MissingParameterException if a required parameter is missing |
|
2004 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2005 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2006 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2007 | + * |
|
2008 | + * @return Elasticsearch|Promise |
|
2009 | + */ |
|
2010 | + public function startDataFrameAnalytics(array $params = []) |
|
2011 | + { |
|
2012 | + $this->checkRequiredParameters(['id'], $params); |
|
2013 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
2014 | + $method = 'POST'; |
|
2015 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2016 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2017 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2018 | + } |
|
2019 | + /** |
|
2020 | + * Starts one or more datafeeds. |
|
2021 | + * |
|
2022 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html |
|
2023 | + * |
|
2024 | + * @param array{ |
|
2025 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to start |
|
2026 | + * start: string, // The start time from where the datafeed should begin |
|
2027 | + * end: string, // The end time when the datafeed should stop. When not set, the datafeed continues in real time |
|
2028 | + * timeout: time, // Controls the time to wait until a datafeed has started. Default to 20 seconds |
|
2029 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2030 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2031 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2032 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2033 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2034 | + * body: array, // The start datafeed parameters |
|
2035 | + * } $params |
|
2036 | + * |
|
2037 | + * @throws MissingParameterException if a required parameter is missing |
|
2038 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2039 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2040 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2041 | + * |
|
2042 | + * @return Elasticsearch|Promise |
|
2043 | + */ |
|
2044 | + public function startDatafeed(array $params = []) |
|
2045 | + { |
|
2046 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
2047 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
2048 | + $method = 'POST'; |
|
2049 | + $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2050 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2051 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2052 | + } |
|
2053 | + /** |
|
2054 | + * Start a trained model deployment. |
|
2055 | + * |
|
2056 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html |
|
2057 | + * |
|
2058 | + * @param array{ |
|
2059 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2060 | + * cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb. |
|
2061 | + * deployment_id: string, // The Id of the new deployment. Defaults to the model_id if not set. |
|
2062 | + * number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes. |
|
2063 | + * threads_per_allocation: int, // The number of threads used by each model allocation during inference. |
|
2064 | + * priority: string, // The deployment priority. |
|
2065 | + * queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time. |
|
2066 | + * timeout: time, // Controls the amount of time to wait for the model to deploy. |
|
2067 | + * wait_for: string, // The allocation status for which to wait |
|
2068 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2069 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2070 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2071 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2072 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2073 | + * } $params |
|
2074 | + * |
|
2075 | + * @throws MissingParameterException if a required parameter is missing |
|
2076 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2077 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2078 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2079 | + * |
|
2080 | + * @return Elasticsearch|Promise |
|
2081 | + */ |
|
2082 | + public function startTrainedModelDeployment(array $params = []) |
|
2083 | + { |
|
2084 | + $this->checkRequiredParameters(['model_id'], $params); |
|
2085 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
2086 | + $method = 'POST'; |
|
2087 | + $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']); |
|
2088 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2089 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2090 | + } |
|
2091 | + /** |
|
2092 | + * Stops one or more data frame analytics jobs. |
|
2093 | + * |
|
2094 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html |
|
2095 | + * |
|
2096 | + * @param array{ |
|
2097 | + * id: string, // (REQUIRED) The ID of the data frame analytics to stop |
|
2098 | + * 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) |
|
2099 | + * force: boolean, // True if the data frame analytics should be forcefully stopped |
|
2100 | + * timeout: time, // Controls the time to wait until the task has stopped. Defaults to 20 seconds |
|
2101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2106 | + * body: array, // The stop data frame analytics parameters |
|
2107 | + * } $params |
|
2108 | + * |
|
2109 | + * @throws MissingParameterException if a required parameter is missing |
|
2110 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2111 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2112 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2113 | + * |
|
2114 | + * @return Elasticsearch|Promise |
|
2115 | + */ |
|
2116 | + public function stopDataFrameAnalytics(array $params = []) |
|
2117 | + { |
|
2118 | + $this->checkRequiredParameters(['id'], $params); |
|
2119 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
2120 | + $method = 'POST'; |
|
2121 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2122 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2123 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2124 | + } |
|
2125 | + /** |
|
2126 | + * Stops one or more datafeeds. |
|
2127 | + * |
|
2128 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html |
|
2129 | + * |
|
2130 | + * @param array{ |
|
2131 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to stop |
|
2132 | + * 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) |
|
2133 | + * 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) |
|
2134 | + * force: boolean, // True if the datafeed should be forcefully stopped. |
|
2135 | + * timeout: time, // Controls the time to wait until a datafeed has stopped. Default to 20 seconds |
|
2136 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2137 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2138 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2139 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2140 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2141 | + * body: array, // The URL params optionally sent in the body |
|
2142 | + * } $params |
|
2143 | + * |
|
2144 | + * @throws MissingParameterException if a required parameter is missing |
|
2145 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2146 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2147 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2148 | + * |
|
2149 | + * @return Elasticsearch|Promise |
|
2150 | + */ |
|
2151 | + public function stopDatafeed(array $params = []) |
|
2152 | + { |
|
2153 | + $this->checkRequiredParameters(['datafeed_id'], $params); |
|
2154 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
2155 | + $method = 'POST'; |
|
2156 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2157 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2158 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2159 | + } |
|
2160 | + /** |
|
2161 | + * Stop a trained model deployment. |
|
2162 | + * |
|
2163 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html |
|
2164 | + * |
|
2165 | + * @param array{ |
|
2166 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2167 | + * 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) |
|
2168 | + * force: boolean, // True if the deployment should be forcefully stopped |
|
2169 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2170 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2171 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2172 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2173 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2174 | + * body: array, // The stop deployment parameters |
|
2175 | + * } $params |
|
2176 | + * |
|
2177 | + * @throws MissingParameterException if a required parameter is missing |
|
2178 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2179 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2180 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2181 | + * |
|
2182 | + * @return Elasticsearch|Promise |
|
2183 | + */ |
|
2184 | + public function stopTrainedModelDeployment(array $params = []) |
|
2185 | + { |
|
2186 | + $this->checkRequiredParameters(['model_id'], $params); |
|
2187 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
2188 | + $method = 'POST'; |
|
2189 | + $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2190 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2191 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2192 | + } |
|
2193 | + /** |
|
2194 | + * Updates certain properties of a data frame analytics job. |
|
2195 | + * |
|
2196 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html |
|
2197 | + * |
|
2198 | + * @param array{ |
|
2199 | + * id: string, // (REQUIRED) The ID of the data frame analytics to update |
|
2200 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2201 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2202 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2203 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2204 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2205 | + * body: array, // (REQUIRED) The data frame analytics settings to update |
|
2206 | + * } $params |
|
2207 | + * |
|
2208 | + * @throws MissingParameterException if a required parameter is missing |
|
2209 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2210 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2211 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2212 | + * |
|
2213 | + * @return Elasticsearch|Promise |
|
2214 | + */ |
|
2215 | + public function updateDataFrameAnalytics(array $params = []) |
|
2216 | + { |
|
2217 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
2218 | + $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
2219 | + $method = 'POST'; |
|
2220 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2221 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2222 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2223 | + } |
|
2224 | + /** |
|
2225 | + * Updates certain properties of a datafeed. |
|
2226 | + * |
|
2227 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html |
|
2228 | + * |
|
2229 | + * @param array{ |
|
2230 | + * datafeed_id: string, // (REQUIRED) The ID of the datafeed to update |
|
2231 | + * ignore_unavailable: boolean, // Ignore unavailable indexes (default: false) |
|
2232 | + * allow_no_indices: boolean, // Ignore if the source indices expressions resolves to no concrete indices (default: true) |
|
2233 | + * ignore_throttled: boolean, // Ignore indices that are marked as throttled (default: true) |
|
2234 | + * expand_wildcards: enum, // Whether source index expressions should get expanded to open or closed indices (default: open) |
|
2235 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2236 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2237 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2238 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2239 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2240 | + * body: array, // (REQUIRED) The datafeed update settings |
|
2241 | + * } $params |
|
2242 | + * |
|
2243 | + * @throws MissingParameterException if a required parameter is missing |
|
2244 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2245 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2246 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2247 | + * |
|
2248 | + * @return Elasticsearch|Promise |
|
2249 | + */ |
|
2250 | + public function updateDatafeed(array $params = []) |
|
2251 | + { |
|
2252 | + $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
|
2253 | + $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
2254 | + $method = 'POST'; |
|
2255 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2256 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2257 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2258 | + } |
|
2259 | + /** |
|
2260 | + * Updates the description of a filter, adds items, or removes items. |
|
2261 | + * |
|
2262 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html |
|
2263 | + * |
|
2264 | + * @param array{ |
|
2265 | + * filter_id: string, // (REQUIRED) The ID of the filter to update |
|
2266 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2267 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2268 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2269 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2270 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2271 | + * body: array, // (REQUIRED) The filter update |
|
2272 | + * } $params |
|
2273 | + * |
|
2274 | + * @throws MissingParameterException if a required parameter is missing |
|
2275 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2276 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2277 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2278 | + * |
|
2279 | + * @return Elasticsearch|Promise |
|
2280 | + */ |
|
2281 | + public function updateFilter(array $params = []) |
|
2282 | + { |
|
2283 | + $this->checkRequiredParameters(['filter_id', 'body'], $params); |
|
2284 | + $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
2285 | + $method = 'POST'; |
|
2286 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2287 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2288 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2289 | + } |
|
2290 | + /** |
|
2291 | + * Updates certain properties of an anomaly detection job. |
|
2292 | + * |
|
2293 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html |
|
2294 | + * |
|
2295 | + * @param array{ |
|
2296 | + * job_id: string, // (REQUIRED) The ID of the job to create |
|
2297 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2298 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2299 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2300 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2301 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2302 | + * body: array, // (REQUIRED) The job update settings |
|
2303 | + * } $params |
|
2304 | + * |
|
2305 | + * @throws MissingParameterException if a required parameter is missing |
|
2306 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2307 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2308 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2309 | + * |
|
2310 | + * @return Elasticsearch|Promise |
|
2311 | + */ |
|
2312 | + public function updateJob(array $params = []) |
|
2313 | + { |
|
2314 | + $this->checkRequiredParameters(['job_id', 'body'], $params); |
|
2315 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
2316 | + $method = 'POST'; |
|
2317 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2318 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2319 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2320 | + } |
|
2321 | + /** |
|
2322 | + * Updates certain properties of a snapshot. |
|
2323 | + * |
|
2324 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html |
|
2325 | + * |
|
2326 | + * @param array{ |
|
2327 | + * job_id: string, // (REQUIRED) The ID of the job to fetch |
|
2328 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot to update |
|
2329 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2330 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2331 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2332 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2333 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2334 | + * body: array, // (REQUIRED) The model snapshot properties to update |
|
2335 | + * } $params |
|
2336 | + * |
|
2337 | + * @throws MissingParameterException if a required parameter is missing |
|
2338 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2339 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2340 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2341 | + * |
|
2342 | + * @return Elasticsearch|Promise |
|
2343 | + */ |
|
2344 | + public function updateModelSnapshot(array $params = []) |
|
2345 | + { |
|
2346 | + $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
|
2347 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
2348 | + $method = 'POST'; |
|
2349 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2350 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2351 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2352 | + } |
|
2353 | + /** |
|
2354 | + * Updates certain properties of trained model deployment. |
|
2355 | + * |
|
2356 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html |
|
2357 | + * |
|
2358 | + * @param array{ |
|
2359 | + * model_id: string, // (REQUIRED) The unique identifier of the trained model. |
|
2360 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2361 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2362 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2363 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2364 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2365 | + * body: array, // (REQUIRED) The updated trained model deployment settings |
|
2366 | + * } $params |
|
2367 | + * |
|
2368 | + * @throws MissingParameterException if a required parameter is missing |
|
2369 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2370 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2371 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2372 | + * |
|
2373 | + * @return Elasticsearch|Promise |
|
2374 | + */ |
|
2375 | + public function updateTrainedModelDeployment(array $params = []) |
|
2376 | + { |
|
2377 | + $this->checkRequiredParameters(['model_id', 'body'], $params); |
|
2378 | + $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
2379 | + $method = 'POST'; |
|
2380 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2381 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2382 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2383 | + } |
|
2384 | + /** |
|
2385 | + * Upgrades a given job snapshot to the current major version. |
|
2386 | + * |
|
2387 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html |
|
2388 | + * |
|
2389 | + * @param array{ |
|
2390 | + * job_id: string, // (REQUIRED) The ID of the job |
|
2391 | + * snapshot_id: string, // (REQUIRED) The ID of the snapshot |
|
2392 | + * timeout: time, // How long should the API wait for the job to be opened and the old snapshot to be loaded. |
|
2393 | + * wait_for_completion: boolean, // Should the request wait until the task is complete before responding to the caller. Default is false. |
|
2394 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2395 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2396 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2397 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2398 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2399 | + * } $params |
|
2400 | + * |
|
2401 | + * @throws MissingParameterException if a required parameter is missing |
|
2402 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2403 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2404 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2405 | + * |
|
2406 | + * @return Elasticsearch|Promise |
|
2407 | + */ |
|
2408 | + public function upgradeJobSnapshot(array $params = []) |
|
2409 | + { |
|
2410 | + $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
|
2411 | + $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
2412 | + $method = 'POST'; |
|
2413 | + $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2414 | + $headers = ['Accept' => 'application/json']; |
|
2415 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2416 | + } |
|
2417 | + /** |
|
2418 | + * Validates an anomaly detection job. |
|
2419 | + * |
|
2420 | + * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
2421 | + * |
|
2422 | + * @param array{ |
|
2423 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2424 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2425 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2426 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2427 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2428 | + * body: array, // (REQUIRED) The job config |
|
2429 | + * } $params |
|
2430 | + * |
|
2431 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2432 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2433 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2434 | + * |
|
2435 | + * @return Elasticsearch|Promise |
|
2436 | + */ |
|
2437 | + public function validate(array $params = []) |
|
2438 | + { |
|
2439 | + $this->checkRequiredParameters(['body'], $params); |
|
2440 | + $url = '/_ml/anomaly_detectors/_validate'; |
|
2441 | + $method = 'POST'; |
|
2442 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2443 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2444 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2445 | + } |
|
2446 | + /** |
|
2447 | + * Validates an anomaly detection detector. |
|
2448 | + * |
|
2449 | + * @see https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html |
|
2450 | + * |
|
2451 | + * @param array{ |
|
2452 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2453 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2454 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2455 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2456 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2457 | + * body: array, // (REQUIRED) The detector |
|
2458 | + * } $params |
|
2459 | + * |
|
2460 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2461 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2462 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2463 | + * |
|
2464 | + * @return Elasticsearch|Promise |
|
2465 | + */ |
|
2466 | + public function validateDetector(array $params = []) |
|
2467 | + { |
|
2468 | + $this->checkRequiredParameters(['body'], $params); |
|
2469 | + $url = '/_ml/anomaly_detectors/_validate/detector'; |
|
2470 | + $method = 'POST'; |
|
2471 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2472 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2473 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
2474 | + } |
|
2475 | 2475 | } |
@@ -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']; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | public function closeJob(array $params = []) |
84 | 84 | { |
85 | 85 | $this->checkRequiredParameters(['job_id'], $params); |
86 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_close'; |
|
86 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_close'; |
|
87 | 87 | $method = 'POST'; |
88 | 88 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
89 | 89 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | public function deleteCalendar(array $params = []) |
114 | 114 | { |
115 | 115 | $this->checkRequiredParameters(['calendar_id'], $params); |
116 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
116 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
117 | 117 | $method = 'DELETE'; |
118 | 118 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
119 | 119 | $headers = ['Accept' => 'application/json']; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function deleteCalendarEvent(array $params = []) |
145 | 145 | { |
146 | 146 | $this->checkRequiredParameters(['calendar_id', 'event_id'], $params); |
147 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events/' . $this->encode($params['event_id']); |
|
147 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events/'.$this->encode($params['event_id']); |
|
148 | 148 | $method = 'DELETE'; |
149 | 149 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
150 | 150 | $headers = ['Accept' => 'application/json']; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function deleteCalendarJob(array $params = []) |
176 | 176 | { |
177 | 177 | $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
178 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
178 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/jobs/'.$this->encode($params['job_id']); |
|
179 | 179 | $method = 'DELETE'; |
180 | 180 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
181 | 181 | $headers = ['Accept' => 'application/json']; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | public function deleteDataFrameAnalytics(array $params = []) |
208 | 208 | { |
209 | 209 | $this->checkRequiredParameters(['id'], $params); |
210 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
210 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
211 | 211 | $method = 'DELETE'; |
212 | 212 | $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
213 | 213 | $headers = ['Accept' => 'application/json']; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | public function deleteDatafeed(array $params = []) |
239 | 239 | { |
240 | 240 | $this->checkRequiredParameters(['datafeed_id'], $params); |
241 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
241 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
242 | 242 | $method = 'DELETE'; |
243 | 243 | $url = $this->addQueryString($url, $params, ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
244 | 244 | $headers = ['Accept' => 'application/json']; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | public function deleteExpiredData(array $params = []) |
271 | 271 | { |
272 | 272 | if (isset($params['job_id'])) { |
273 | - $url = '/_ml/_delete_expired_data/' . $this->encode($params['job_id']); |
|
273 | + $url = '/_ml/_delete_expired_data/'.$this->encode($params['job_id']); |
|
274 | 274 | $method = 'DELETE'; |
275 | 275 | } else { |
276 | 276 | $url = '/_ml/_delete_expired_data'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | public function deleteFilter(array $params = []) |
305 | 305 | { |
306 | 306 | $this->checkRequiredParameters(['filter_id'], $params); |
307 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
307 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
308 | 308 | $method = 'DELETE'; |
309 | 309 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
310 | 310 | $headers = ['Accept' => 'application/json']; |
@@ -338,10 +338,10 @@ discard block |
||
338 | 338 | { |
339 | 339 | $this->checkRequiredParameters(['job_id'], $params); |
340 | 340 | if (isset($params['forecast_id'])) { |
341 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast/' . $this->encode($params['forecast_id']); |
|
341 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast/'.$this->encode($params['forecast_id']); |
|
342 | 342 | $method = 'DELETE'; |
343 | 343 | } else { |
344 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
344 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast'; |
|
345 | 345 | $method = 'DELETE'; |
346 | 346 | } |
347 | 347 | $url = $this->addQueryString($url, $params, ['allow_no_forecasts', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | public function deleteJob(array $params = []) |
376 | 376 | { |
377 | 377 | $this->checkRequiredParameters(['job_id'], $params); |
378 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
378 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
379 | 379 | $method = 'DELETE'; |
380 | 380 | $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
381 | 381 | $headers = ['Accept' => 'application/json']; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | public function deleteModelSnapshot(array $params = []) |
407 | 407 | { |
408 | 408 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
409 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
409 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']); |
|
410 | 410 | $method = 'DELETE'; |
411 | 411 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
412 | 412 | $headers = ['Accept' => 'application/json']; |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | public function deleteTrainedModel(array $params = []) |
439 | 439 | { |
440 | 440 | $this->checkRequiredParameters(['model_id'], $params); |
441 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
441 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
442 | 442 | $method = 'DELETE'; |
443 | 443 | $url = $this->addQueryString($url, $params, ['timeout', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
444 | 444 | $headers = ['Accept' => 'application/json']; |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | public function deleteTrainedModelAlias(array $params = []) |
470 | 470 | { |
471 | 471 | $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
472 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
472 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/model_aliases/'.$this->encode($params['model_alias']); |
|
473 | 473 | $method = 'DELETE'; |
474 | 474 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
475 | 475 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | public function explainDataFrameAnalytics(array $params = []) |
558 | 558 | { |
559 | 559 | if (isset($params['id'])) { |
560 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_explain'; |
|
560 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_explain'; |
|
561 | 561 | $method = empty($params['body']) ? 'GET' : 'POST'; |
562 | 562 | } else { |
563 | 563 | $url = '/_ml/data_frame/analytics/_explain'; |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | public function flushJob(array $params = []) |
598 | 598 | { |
599 | 599 | $this->checkRequiredParameters(['job_id'], $params); |
600 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_flush'; |
|
600 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_flush'; |
|
601 | 601 | $method = 'POST'; |
602 | 602 | $url = $this->addQueryString($url, $params, ['calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
603 | 603 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | public function forecast(array $params = []) |
632 | 632 | { |
633 | 633 | $this->checkRequiredParameters(['job_id'], $params); |
634 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_forecast'; |
|
634 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_forecast'; |
|
635 | 635 | $method = 'POST'; |
636 | 636 | $url = $this->addQueryString($url, $params, ['duration', 'expires_in', 'max_model_memory', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
637 | 637 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -673,10 +673,10 @@ discard block |
||
673 | 673 | { |
674 | 674 | $this->checkRequiredParameters(['job_id'], $params); |
675 | 675 | if (isset($params['timestamp'])) { |
676 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets/' . $this->encode($params['timestamp']); |
|
676 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/buckets/'.$this->encode($params['timestamp']); |
|
677 | 677 | $method = empty($params['body']) ? 'GET' : 'POST'; |
678 | 678 | } else { |
679 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/buckets'; |
|
679 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/buckets'; |
|
680 | 680 | $method = empty($params['body']) ? 'GET' : 'POST'; |
681 | 681 | } |
682 | 682 | $url = $this->addQueryString($url, $params, ['expand', 'exclude_interim', 'from', 'size', 'start', 'end', 'anomaly_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | public function getCalendarEvents(array $params = []) |
713 | 713 | { |
714 | 714 | $this->checkRequiredParameters(['calendar_id'], $params); |
715 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
715 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events'; |
|
716 | 716 | $method = 'GET'; |
717 | 717 | $url = $this->addQueryString($url, $params, ['job_id', 'start', 'end', 'from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
718 | 718 | $headers = ['Accept' => 'application/json']; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | public function getCalendars(array $params = []) |
745 | 745 | { |
746 | 746 | if (isset($params['calendar_id'])) { |
747 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
747 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
748 | 748 | $method = empty($params['body']) ? 'GET' : 'POST'; |
749 | 749 | } else { |
750 | 750 | $url = '/_ml/calendars'; |
@@ -784,10 +784,10 @@ discard block |
||
784 | 784 | { |
785 | 785 | $this->checkRequiredParameters(['job_id'], $params); |
786 | 786 | if (isset($params['category_id'])) { |
787 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/' . $this->encode($params['category_id']); |
|
787 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/categories/'.$this->encode($params['category_id']); |
|
788 | 788 | $method = empty($params['body']) ? 'GET' : 'POST'; |
789 | 789 | } else { |
790 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/categories/'; |
|
790 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/categories/'; |
|
791 | 791 | $method = empty($params['body']) ? 'GET' : 'POST'; |
792 | 792 | } |
793 | 793 | $url = $this->addQueryString($url, $params, ['from', 'size', 'partition_field_value', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | public function getDataFrameAnalytics(array $params = []) |
822 | 822 | { |
823 | 823 | if (isset($params['id'])) { |
824 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
824 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
825 | 825 | $method = 'GET'; |
826 | 826 | } else { |
827 | 827 | $url = '/_ml/data_frame/analytics'; |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | public function getDataFrameAnalyticsStats(array $params = []) |
859 | 859 | { |
860 | 860 | if (isset($params['id'])) { |
861 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stats'; |
|
861 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_stats'; |
|
862 | 862 | $method = 'GET'; |
863 | 863 | } else { |
864 | 864 | $url = '/_ml/data_frame/analytics/_stats'; |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | public function getDatafeedStats(array $params = []) |
893 | 893 | { |
894 | 894 | if (isset($params['datafeed_id'])) { |
895 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stats'; |
|
895 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_stats'; |
|
896 | 896 | $method = 'GET'; |
897 | 897 | } else { |
898 | 898 | $url = '/_ml/datafeeds/_stats'; |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | public function getDatafeeds(array $params = []) |
928 | 928 | { |
929 | 929 | if (isset($params['datafeed_id'])) { |
930 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
930 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
931 | 931 | $method = 'GET'; |
932 | 932 | } else { |
933 | 933 | $url = '/_ml/datafeeds'; |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | public function getFilters(array $params = []) |
963 | 963 | { |
964 | 964 | if (isset($params['filter_id'])) { |
965 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
965 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
966 | 966 | $method = 'GET'; |
967 | 967 | } else { |
968 | 968 | $url = '/_ml/filters'; |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | public function getInfluencers(array $params = []) |
1006 | 1006 | { |
1007 | 1007 | $this->checkRequiredParameters(['job_id'], $params); |
1008 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/influencers'; |
|
1008 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/influencers'; |
|
1009 | 1009 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1010 | 1010 | $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'influencer_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1011 | 1011 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | public function getJobStats(array $params = []) |
1036 | 1036 | { |
1037 | 1037 | if (isset($params['job_id'])) { |
1038 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_stats'; |
|
1038 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_stats'; |
|
1039 | 1039 | $method = 'GET'; |
1040 | 1040 | } else { |
1041 | 1041 | $url = '/_ml/anomaly_detectors/_stats'; |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | public function getJobs(array $params = []) |
1071 | 1071 | { |
1072 | 1072 | if (isset($params['job_id'])) { |
1073 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1073 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
1074 | 1074 | $method = 'GET'; |
1075 | 1075 | } else { |
1076 | 1076 | $url = '/_ml/anomaly_detectors'; |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | public function getMemoryStats(array $params = []) |
1106 | 1106 | { |
1107 | 1107 | if (isset($params['node_id'])) { |
1108 | - $url = '/_ml/memory/' . $this->encode($params['node_id']) . '/_stats'; |
|
1108 | + $url = '/_ml/memory/'.$this->encode($params['node_id']).'/_stats'; |
|
1109 | 1109 | $method = 'GET'; |
1110 | 1110 | } else { |
1111 | 1111 | $url = '/_ml/memory/_stats'; |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | public function getModelSnapshotUpgradeStats(array $params = []) |
1142 | 1142 | { |
1143 | 1143 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
1144 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade/_stats'; |
|
1144 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_upgrade/_stats'; |
|
1145 | 1145 | $method = 'GET'; |
1146 | 1146 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1147 | 1147 | $headers = ['Accept' => 'application/json']; |
@@ -1180,10 +1180,10 @@ discard block |
||
1180 | 1180 | { |
1181 | 1181 | $this->checkRequiredParameters(['job_id'], $params); |
1182 | 1182 | if (isset($params['snapshot_id'])) { |
1183 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']); |
|
1183 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']); |
|
1184 | 1184 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1185 | 1185 | } else { |
1186 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots'; |
|
1186 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots'; |
|
1187 | 1187 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1188 | 1188 | } |
1189 | 1189 | $url = $this->addQueryString($url, $params, ['from', 'size', 'start', 'end', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | public function getOverallBuckets(array $params = []) |
1223 | 1223 | { |
1224 | 1224 | $this->checkRequiredParameters(['job_id'], $params); |
1225 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/overall_buckets'; |
|
1225 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/overall_buckets'; |
|
1226 | 1226 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1227 | 1227 | $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']); |
1228 | 1228 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | public function getRecords(array $params = []) |
1262 | 1262 | { |
1263 | 1263 | $this->checkRequiredParameters(['job_id'], $params); |
1264 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/results/records'; |
|
1264 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/results/records'; |
|
1265 | 1265 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1266 | 1266 | $url = $this->addQueryString($url, $params, ['exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1267 | 1267 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1298,7 +1298,7 @@ discard block |
||
1298 | 1298 | public function getTrainedModels(array $params = []) |
1299 | 1299 | { |
1300 | 1300 | if (isset($params['model_id'])) { |
1301 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1301 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
1302 | 1302 | $method = 'GET'; |
1303 | 1303 | } else { |
1304 | 1304 | $url = '/_ml/trained_models'; |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | public function getTrainedModelsStats(array $params = []) |
1335 | 1335 | { |
1336 | 1336 | if (isset($params['model_id'])) { |
1337 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_stats'; |
|
1337 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/_stats'; |
|
1338 | 1338 | $method = 'GET'; |
1339 | 1339 | } else { |
1340 | 1340 | $url = '/_ml/trained_models/_stats'; |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | public function inferTrainedModel(array $params = []) |
1371 | 1371 | { |
1372 | 1372 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
1373 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/_infer'; |
|
1373 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/_infer'; |
|
1374 | 1374 | $method = 'POST'; |
1375 | 1375 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1376 | 1376 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | public function openJob(array $params = []) |
1429 | 1429 | { |
1430 | 1430 | $this->checkRequiredParameters(['job_id'], $params); |
1431 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_open'; |
|
1431 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_open'; |
|
1432 | 1432 | $method = 'POST'; |
1433 | 1433 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1434 | 1434 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1459,7 +1459,7 @@ discard block |
||
1459 | 1459 | public function postCalendarEvents(array $params = []) |
1460 | 1460 | { |
1461 | 1461 | $this->checkRequiredParameters(['calendar_id', 'body'], $params); |
1462 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/events'; |
|
1462 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/events'; |
|
1463 | 1463 | $method = 'POST'; |
1464 | 1464 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1465 | 1465 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1492,7 +1492,7 @@ discard block |
||
1492 | 1492 | public function postData(array $params = []) |
1493 | 1493 | { |
1494 | 1494 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
1495 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_data'; |
|
1495 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_data'; |
|
1496 | 1496 | $method = 'POST'; |
1497 | 1497 | $url = $this->addQueryString($url, $params, ['reset_start', 'reset_end', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1498 | 1498 | $headers = ['Accept' => 'application/json', 'Content-Type' => isset($params['body']) && (\is_string($params['body']) || $this->isAssociativeArray($params['body'])) ? 'application/json' : 'application/x-ndjson']; |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | public function previewDataFrameAnalytics(array $params = []) |
1523 | 1523 | { |
1524 | 1524 | if (isset($params['id'])) { |
1525 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_preview'; |
|
1525 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_preview'; |
|
1526 | 1526 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1527 | 1527 | } else { |
1528 | 1528 | $url = '/_ml/data_frame/analytics/_preview'; |
@@ -1558,7 +1558,7 @@ discard block |
||
1558 | 1558 | public function previewDatafeed(array $params = []) |
1559 | 1559 | { |
1560 | 1560 | if (isset($params['datafeed_id'])) { |
1561 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_preview'; |
|
1561 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_preview'; |
|
1562 | 1562 | $method = empty($params['body']) ? 'GET' : 'POST'; |
1563 | 1563 | } else { |
1564 | 1564 | $url = '/_ml/datafeeds/_preview'; |
@@ -1593,7 +1593,7 @@ discard block |
||
1593 | 1593 | public function putCalendar(array $params = []) |
1594 | 1594 | { |
1595 | 1595 | $this->checkRequiredParameters(['calendar_id'], $params); |
1596 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']); |
|
1596 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']); |
|
1597 | 1597 | $method = 'PUT'; |
1598 | 1598 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1599 | 1599 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1624,7 +1624,7 @@ discard block |
||
1624 | 1624 | public function putCalendarJob(array $params = []) |
1625 | 1625 | { |
1626 | 1626 | $this->checkRequiredParameters(['calendar_id', 'job_id'], $params); |
1627 | - $url = '/_ml/calendars/' . $this->encode($params['calendar_id']) . '/jobs/' . $this->encode($params['job_id']); |
|
1627 | + $url = '/_ml/calendars/'.$this->encode($params['calendar_id']).'/jobs/'.$this->encode($params['job_id']); |
|
1628 | 1628 | $method = 'PUT'; |
1629 | 1629 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1630 | 1630 | $headers = ['Accept' => 'application/json']; |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | public function putDataFrameAnalytics(array $params = []) |
1656 | 1656 | { |
1657 | 1657 | $this->checkRequiredParameters(['id', 'body'], $params); |
1658 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']); |
|
1658 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']); |
|
1659 | 1659 | $method = 'PUT'; |
1660 | 1660 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1661 | 1661 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1690,7 +1690,7 @@ discard block |
||
1690 | 1690 | public function putDatafeed(array $params = []) |
1691 | 1691 | { |
1692 | 1692 | $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
1693 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']); |
|
1693 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']); |
|
1694 | 1694 | $method = 'PUT'; |
1695 | 1695 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1696 | 1696 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | public function putFilter(array $params = []) |
1722 | 1722 | { |
1723 | 1723 | $this->checkRequiredParameters(['filter_id', 'body'], $params); |
1724 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']); |
|
1724 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']); |
|
1725 | 1725 | $method = 'PUT'; |
1726 | 1726 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1727 | 1727 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1756,7 +1756,7 @@ discard block |
||
1756 | 1756 | public function putJob(array $params = []) |
1757 | 1757 | { |
1758 | 1758 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
1759 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']); |
|
1759 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']); |
|
1760 | 1760 | $method = 'PUT'; |
1761 | 1761 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1762 | 1762 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | public function putTrainedModel(array $params = []) |
1790 | 1790 | { |
1791 | 1791 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
1792 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']); |
|
1792 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']); |
|
1793 | 1793 | $method = 'PUT'; |
1794 | 1794 | $url = $this->addQueryString($url, $params, ['defer_definition_decompression', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1795 | 1795 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1821,7 +1821,7 @@ discard block |
||
1821 | 1821 | public function putTrainedModelAlias(array $params = []) |
1822 | 1822 | { |
1823 | 1823 | $this->checkRequiredParameters(['model_alias', 'model_id'], $params); |
1824 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/model_aliases/' . $this->encode($params['model_alias']); |
|
1824 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/model_aliases/'.$this->encode($params['model_alias']); |
|
1825 | 1825 | $method = 'PUT'; |
1826 | 1826 | $url = $this->addQueryString($url, $params, ['reassign', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1827 | 1827 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1853,7 +1853,7 @@ discard block |
||
1853 | 1853 | public function putTrainedModelDefinitionPart(array $params = []) |
1854 | 1854 | { |
1855 | 1855 | $this->checkRequiredParameters(['model_id', 'part', 'body'], $params); |
1856 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/definition/' . $this->encode($params['part']); |
|
1856 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/definition/'.$this->encode($params['part']); |
|
1857 | 1857 | $method = 'PUT'; |
1858 | 1858 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1859 | 1859 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1884,7 +1884,7 @@ discard block |
||
1884 | 1884 | public function putTrainedModelVocabulary(array $params = []) |
1885 | 1885 | { |
1886 | 1886 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
1887 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/vocabulary'; |
|
1887 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/vocabulary'; |
|
1888 | 1888 | $method = 'PUT'; |
1889 | 1889 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1890 | 1890 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1916,7 +1916,7 @@ discard block |
||
1916 | 1916 | public function resetJob(array $params = []) |
1917 | 1917 | { |
1918 | 1918 | $this->checkRequiredParameters(['job_id'], $params); |
1919 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_reset'; |
|
1919 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_reset'; |
|
1920 | 1920 | $method = 'POST'; |
1921 | 1921 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'delete_user_annotations', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1922 | 1922 | $headers = ['Accept' => 'application/json']; |
@@ -1949,7 +1949,7 @@ discard block |
||
1949 | 1949 | public function revertModelSnapshot(array $params = []) |
1950 | 1950 | { |
1951 | 1951 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
1952 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_revert'; |
|
1952 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_revert'; |
|
1953 | 1953 | $method = 'POST'; |
1954 | 1954 | $url = $this->addQueryString($url, $params, ['delete_intervening_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1955 | 1955 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | public function startDataFrameAnalytics(array $params = []) |
2011 | 2011 | { |
2012 | 2012 | $this->checkRequiredParameters(['id'], $params); |
2013 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_start'; |
|
2013 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_start'; |
|
2014 | 2014 | $method = 'POST'; |
2015 | 2015 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2016 | 2016 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2044,7 +2044,7 @@ discard block |
||
2044 | 2044 | public function startDatafeed(array $params = []) |
2045 | 2045 | { |
2046 | 2046 | $this->checkRequiredParameters(['datafeed_id'], $params); |
2047 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_start'; |
|
2047 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_start'; |
|
2048 | 2048 | $method = 'POST'; |
2049 | 2049 | $url = $this->addQueryString($url, $params, ['start', 'end', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2050 | 2050 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2082,7 +2082,7 @@ discard block |
||
2082 | 2082 | public function startTrainedModelDeployment(array $params = []) |
2083 | 2083 | { |
2084 | 2084 | $this->checkRequiredParameters(['model_id'], $params); |
2085 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start'; |
|
2085 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_start'; |
|
2086 | 2086 | $method = 'POST'; |
2087 | 2087 | $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']); |
2088 | 2088 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | public function stopDataFrameAnalytics(array $params = []) |
2117 | 2117 | { |
2118 | 2118 | $this->checkRequiredParameters(['id'], $params); |
2119 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_stop'; |
|
2119 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_stop'; |
|
2120 | 2120 | $method = 'POST'; |
2121 | 2121 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2122 | 2122 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2151,7 +2151,7 @@ discard block |
||
2151 | 2151 | public function stopDatafeed(array $params = []) |
2152 | 2152 | { |
2153 | 2153 | $this->checkRequiredParameters(['datafeed_id'], $params); |
2154 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_stop'; |
|
2154 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_stop'; |
|
2155 | 2155 | $method = 'POST'; |
2156 | 2156 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'allow_no_datafeeds', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2157 | 2157 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | public function stopTrainedModelDeployment(array $params = []) |
2185 | 2185 | { |
2186 | 2186 | $this->checkRequiredParameters(['model_id'], $params); |
2187 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_stop'; |
|
2187 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_stop'; |
|
2188 | 2188 | $method = 'POST'; |
2189 | 2189 | $url = $this->addQueryString($url, $params, ['allow_no_match', 'force', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2190 | 2190 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2215,7 +2215,7 @@ discard block |
||
2215 | 2215 | public function updateDataFrameAnalytics(array $params = []) |
2216 | 2216 | { |
2217 | 2217 | $this->checkRequiredParameters(['id', 'body'], $params); |
2218 | - $url = '/_ml/data_frame/analytics/' . $this->encode($params['id']) . '/_update'; |
|
2218 | + $url = '/_ml/data_frame/analytics/'.$this->encode($params['id']).'/_update'; |
|
2219 | 2219 | $method = 'POST'; |
2220 | 2220 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2221 | 2221 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2250,7 +2250,7 @@ discard block |
||
2250 | 2250 | public function updateDatafeed(array $params = []) |
2251 | 2251 | { |
2252 | 2252 | $this->checkRequiredParameters(['datafeed_id', 'body'], $params); |
2253 | - $url = '/_ml/datafeeds/' . $this->encode($params['datafeed_id']) . '/_update'; |
|
2253 | + $url = '/_ml/datafeeds/'.$this->encode($params['datafeed_id']).'/_update'; |
|
2254 | 2254 | $method = 'POST'; |
2255 | 2255 | $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2256 | 2256 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2281,7 +2281,7 @@ discard block |
||
2281 | 2281 | public function updateFilter(array $params = []) |
2282 | 2282 | { |
2283 | 2283 | $this->checkRequiredParameters(['filter_id', 'body'], $params); |
2284 | - $url = '/_ml/filters/' . $this->encode($params['filter_id']) . '/_update'; |
|
2284 | + $url = '/_ml/filters/'.$this->encode($params['filter_id']).'/_update'; |
|
2285 | 2285 | $method = 'POST'; |
2286 | 2286 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2287 | 2287 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | public function updateJob(array $params = []) |
2313 | 2313 | { |
2314 | 2314 | $this->checkRequiredParameters(['job_id', 'body'], $params); |
2315 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/_update'; |
|
2315 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/_update'; |
|
2316 | 2316 | $method = 'POST'; |
2317 | 2317 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2318 | 2318 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2344,7 +2344,7 @@ discard block |
||
2344 | 2344 | public function updateModelSnapshot(array $params = []) |
2345 | 2345 | { |
2346 | 2346 | $this->checkRequiredParameters(['job_id', 'snapshot_id', 'body'], $params); |
2347 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_update'; |
|
2347 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_update'; |
|
2348 | 2348 | $method = 'POST'; |
2349 | 2349 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2350 | 2350 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2375,7 +2375,7 @@ discard block |
||
2375 | 2375 | public function updateTrainedModelDeployment(array $params = []) |
2376 | 2376 | { |
2377 | 2377 | $this->checkRequiredParameters(['model_id', 'body'], $params); |
2378 | - $url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update'; |
|
2378 | + $url = '/_ml/trained_models/'.$this->encode($params['model_id']).'/deployment/_update'; |
|
2379 | 2379 | $method = 'POST'; |
2380 | 2380 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2381 | 2381 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -2408,7 +2408,7 @@ discard block |
||
2408 | 2408 | public function upgradeJobSnapshot(array $params = []) |
2409 | 2409 | { |
2410 | 2410 | $this->checkRequiredParameters(['job_id', 'snapshot_id'], $params); |
2411 | - $url = '/_ml/anomaly_detectors/' . $this->encode($params['job_id']) . '/model_snapshots/' . $this->encode($params['snapshot_id']) . '/_upgrade'; |
|
2411 | + $url = '/_ml/anomaly_detectors/'.$this->encode($params['job_id']).'/model_snapshots/'.$this->encode($params['snapshot_id']).'/_upgrade'; |
|
2412 | 2412 | $method = 'POST'; |
2413 | 2413 | $url = $this->addQueryString($url, $params, ['timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
2414 | 2414 | $headers = ['Accept' => 'application/json']; |
@@ -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,107 +25,107 @@ |
||
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 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
61 | - } |
|
62 | - /** |
|
63 | - * 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. |
|
64 | - * |
|
65 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
66 | - * |
|
67 | - * @param array{ |
|
68 | - * index: string, // The index name to use as the default |
|
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 | - * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
75 | - * } $params |
|
76 | - * |
|
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 msearch(array $params = []) |
|
84 | - { |
|
85 | - $this->checkRequiredParameters(['body'], $params); |
|
86 | - if (isset($params['index'])) { |
|
87 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
88 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
89 | - } else { |
|
90 | - $url = '/_fleet/_fleet_msearch'; |
|
91 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
92 | - } |
|
93 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
94 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
95 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
96 | - } |
|
97 | - /** |
|
98 | - * 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. |
|
99 | - * |
|
100 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
101 | - * |
|
102 | - * @param array{ |
|
103 | - * index: string, // (REQUIRED) The index name to search. |
|
104 | - * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
105 | - * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
106 | - * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
107 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
108 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
109 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
110 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
111 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
112 | - * body: array, // The search definition using the Query DSL |
|
113 | - * } $params |
|
114 | - * |
|
115 | - * @throws MissingParameterException if a required parameter is missing |
|
116 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
117 | - * @throws ClientResponseException if the status code of response is 4xx |
|
118 | - * @throws ServerResponseException if the status code of response is 5xx |
|
119 | - * |
|
120 | - * @return Elasticsearch|Promise |
|
121 | - */ |
|
122 | - public function search(array $params = []) |
|
123 | - { |
|
124 | - $this->checkRequiredParameters(['index'], $params); |
|
125 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
126 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
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 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
129 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
130 | - } |
|
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 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
61 | + } |
|
62 | + /** |
|
63 | + * 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. |
|
64 | + * |
|
65 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
66 | + * |
|
67 | + * @param array{ |
|
68 | + * index: string, // The index name to use as the default |
|
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 | + * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
75 | + * } $params |
|
76 | + * |
|
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 msearch(array $params = []) |
|
84 | + { |
|
85 | + $this->checkRequiredParameters(['body'], $params); |
|
86 | + if (isset($params['index'])) { |
|
87 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
88 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
89 | + } else { |
|
90 | + $url = '/_fleet/_fleet_msearch'; |
|
91 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
92 | + } |
|
93 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
94 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
95 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
96 | + } |
|
97 | + /** |
|
98 | + * 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. |
|
99 | + * |
|
100 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
101 | + * |
|
102 | + * @param array{ |
|
103 | + * index: string, // (REQUIRED) The index name to search. |
|
104 | + * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
105 | + * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
106 | + * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
107 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
108 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
109 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
110 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
111 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
112 | + * body: array, // The search definition using the Query DSL |
|
113 | + * } $params |
|
114 | + * |
|
115 | + * @throws MissingParameterException if a required parameter is missing |
|
116 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
117 | + * @throws ClientResponseException if the status code of response is 4xx |
|
118 | + * @throws ServerResponseException if the status code of response is 5xx |
|
119 | + * |
|
120 | + * @return Elasticsearch|Promise |
|
121 | + */ |
|
122 | + public function search(array $params = []) |
|
123 | + { |
|
124 | + $this->checkRequiredParameters(['index'], $params); |
|
125 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
126 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
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 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
129 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
130 | + } |
|
131 | 131 | } |
@@ -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,128 +25,128 @@ |
||
25 | 25 | */ |
26 | 26 | class QueryRuleset extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes a query ruleset. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * ruleset_id: string, // (REQUIRED) The unique identifier of the query ruleset to delete |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws MissingParameterException if a required parameter is missing |
|
44 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | - * @throws ClientResponseException if the status code of response is 4xx |
|
46 | - * @throws ServerResponseException if the status code of response is 5xx |
|
47 | - * |
|
48 | - * @return Elasticsearch|Promise |
|
49 | - */ |
|
50 | - public function delete(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['ruleset_id'], $params); |
|
53 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
54 | - $method = 'DELETE'; |
|
55 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | - $headers = ['Accept' => 'application/json']; |
|
57 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
58 | - } |
|
59 | - /** |
|
60 | - * Returns the details about a query ruleset. |
|
61 | - * |
|
62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html |
|
63 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * ruleset_id: string, // (REQUIRED) The unique identifier of the query ruleset |
|
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 MissingParameterException if a required parameter is missing |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function get(array $params = []) |
|
82 | - { |
|
83 | - $this->checkRequiredParameters(['ruleset_id'], $params); |
|
84 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
85 | - $method = 'GET'; |
|
86 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json']; |
|
88 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | - } |
|
90 | - /** |
|
91 | - * Lists query rulesets. |
|
92 | - * |
|
93 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html |
|
94 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
95 | - * |
|
96 | - * @param array{ |
|
97 | - * from: int, // Starting offset (default: 0) |
|
98 | - * size: int, // specifies a max number of results to get (default: 100) |
|
99 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
100 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
101 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
102 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
103 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
104 | - * } $params |
|
105 | - * |
|
106 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
107 | - * @throws ClientResponseException if the status code of response is 4xx |
|
108 | - * @throws ServerResponseException if the status code of response is 5xx |
|
109 | - * |
|
110 | - * @return Elasticsearch|Promise |
|
111 | - */ |
|
112 | - public function list(array $params = []) |
|
113 | - { |
|
114 | - $url = '/_query_rules'; |
|
115 | - $method = 'GET'; |
|
116 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | - $headers = ['Accept' => 'application/json']; |
|
118 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | - } |
|
120 | - /** |
|
121 | - * Creates or updates a query ruleset. |
|
122 | - * |
|
123 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html |
|
124 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
125 | - * |
|
126 | - * @param array{ |
|
127 | - * ruleset_id: string, // (REQUIRED) The unique identifier of the ruleset to be created or updated. |
|
128 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | - * body: array, // (REQUIRED) The query ruleset configuration, including `rules` |
|
134 | - * } $params |
|
135 | - * |
|
136 | - * @throws MissingParameterException if a required parameter is missing |
|
137 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
138 | - * @throws ClientResponseException if the status code of response is 4xx |
|
139 | - * @throws ServerResponseException if the status code of response is 5xx |
|
140 | - * |
|
141 | - * @return Elasticsearch|Promise |
|
142 | - */ |
|
143 | - public function put(array $params = []) |
|
144 | - { |
|
145 | - $this->checkRequiredParameters(['ruleset_id', 'body'], $params); |
|
146 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
147 | - $method = 'PUT'; |
|
148 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
149 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
150 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
151 | - } |
|
28 | + /** |
|
29 | + * Deletes a query ruleset. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * ruleset_id: string, // (REQUIRED) The unique identifier of the query ruleset to delete |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws MissingParameterException if a required parameter is missing |
|
44 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | + * @throws ClientResponseException if the status code of response is 4xx |
|
46 | + * @throws ServerResponseException if the status code of response is 5xx |
|
47 | + * |
|
48 | + * @return Elasticsearch|Promise |
|
49 | + */ |
|
50 | + public function delete(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['ruleset_id'], $params); |
|
53 | + $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
54 | + $method = 'DELETE'; |
|
55 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | + $headers = ['Accept' => 'application/json']; |
|
57 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
58 | + } |
|
59 | + /** |
|
60 | + * Returns the details about a query ruleset. |
|
61 | + * |
|
62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html |
|
63 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * ruleset_id: string, // (REQUIRED) The unique identifier of the query ruleset |
|
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 MissingParameterException if a required parameter is missing |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function get(array $params = []) |
|
82 | + { |
|
83 | + $this->checkRequiredParameters(['ruleset_id'], $params); |
|
84 | + $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
85 | + $method = 'GET'; |
|
86 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json']; |
|
88 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
89 | + } |
|
90 | + /** |
|
91 | + * Lists query rulesets. |
|
92 | + * |
|
93 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html |
|
94 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
95 | + * |
|
96 | + * @param array{ |
|
97 | + * from: int, // Starting offset (default: 0) |
|
98 | + * size: int, // specifies a max number of results to get (default: 100) |
|
99 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
100 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
101 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
102 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
103 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
104 | + * } $params |
|
105 | + * |
|
106 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
107 | + * @throws ClientResponseException if the status code of response is 4xx |
|
108 | + * @throws ServerResponseException if the status code of response is 5xx |
|
109 | + * |
|
110 | + * @return Elasticsearch|Promise |
|
111 | + */ |
|
112 | + public function list(array $params = []) |
|
113 | + { |
|
114 | + $url = '/_query_rules'; |
|
115 | + $method = 'GET'; |
|
116 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
117 | + $headers = ['Accept' => 'application/json']; |
|
118 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
119 | + } |
|
120 | + /** |
|
121 | + * Creates or updates a query ruleset. |
|
122 | + * |
|
123 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html |
|
124 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
125 | + * |
|
126 | + * @param array{ |
|
127 | + * ruleset_id: string, // (REQUIRED) The unique identifier of the ruleset to be created or updated. |
|
128 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | + * body: array, // (REQUIRED) The query ruleset configuration, including `rules` |
|
134 | + * } $params |
|
135 | + * |
|
136 | + * @throws MissingParameterException if a required parameter is missing |
|
137 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
138 | + * @throws ClientResponseException if the status code of response is 4xx |
|
139 | + * @throws ServerResponseException if the status code of response is 5xx |
|
140 | + * |
|
141 | + * @return Elasticsearch|Promise |
|
142 | + */ |
|
143 | + public function put(array $params = []) |
|
144 | + { |
|
145 | + $this->checkRequiredParameters(['ruleset_id', 'body'], $params); |
|
146 | + $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
147 | + $method = 'PUT'; |
|
148 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
149 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
150 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
151 | + } |
|
152 | 152 | } |
@@ -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 delete(array $params = []) |
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['ruleset_id'], $params); |
53 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
53 | + $url = '/_query_rules/'.$this->encode($params['ruleset_id']); |
|
54 | 54 | $method = 'DELETE'; |
55 | 55 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function get(array $params = []) |
82 | 82 | { |
83 | 83 | $this->checkRequiredParameters(['ruleset_id'], $params); |
84 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
84 | + $url = '/_query_rules/'.$this->encode($params['ruleset_id']); |
|
85 | 85 | $method = 'GET'; |
86 | 86 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
87 | 87 | $headers = ['Accept' => 'application/json']; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public function put(array $params = []) |
144 | 144 | { |
145 | 145 | $this->checkRequiredParameters(['ruleset_id', 'body'], $params); |
146 | - $url = '/_query_rules/' . $this->encode($params['ruleset_id']); |
|
146 | + $url = '/_query_rules/'.$this->encode($params['ruleset_id']); |
|
147 | 147 | $method = 'PUT'; |
148 | 148 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
149 | 149 | $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 QueryRuleset extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class QueryRuleset extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes a query ruleset. |
30 | 29 | * |