@@ -25,92 +25,92 @@ |
||
25 | 25 | */ |
26 | 26 | class Profiling extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | - * body: array, // (REQUIRED) The filter conditions for the flamegraph |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
45 | - * |
|
46 | - * @return Elasticsearch|Promise |
|
47 | - */ |
|
48 | - public function flamegraph(array $params = []) |
|
49 | - { |
|
50 | - $this->checkRequiredParameters(['body'], $params); |
|
51 | - $url = '/_profiling/flamegraph'; |
|
52 | - $method = 'POST'; |
|
53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | - } |
|
57 | - /** |
|
58 | - * Extracts raw stacktrace information from Universal Profiling. |
|
59 | - * |
|
60 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
61 | - * |
|
62 | - * @param array{ |
|
63 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
64 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
65 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
66 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
67 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
68 | - * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
69 | - * } $params |
|
70 | - * |
|
71 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
72 | - * @throws ClientResponseException if the status code of response is 4xx |
|
73 | - * @throws ServerResponseException if the status code of response is 5xx |
|
74 | - * |
|
75 | - * @return Elasticsearch|Promise |
|
76 | - */ |
|
77 | - public function stacktraces(array $params = []) |
|
78 | - { |
|
79 | - $this->checkRequiredParameters(['body'], $params); |
|
80 | - $url = '/_profiling/stacktraces'; |
|
81 | - $method = 'POST'; |
|
82 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
83 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
84 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
85 | - } |
|
86 | - /** |
|
87 | - * Returns basic information about the status of Universal Profiling. |
|
88 | - * |
|
89 | - * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
90 | - * |
|
91 | - * @param array{ |
|
92 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
93 | - * timeout: time, // Explicit operation timeout |
|
94 | - * wait_for_resources_created: boolean, // Whether to return immediately or wait until resources have been created |
|
95 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
96 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
97 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
98 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
99 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
100 | - * } $params |
|
101 | - * |
|
102 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
103 | - * @throws ClientResponseException if the status code of response is 4xx |
|
104 | - * @throws ServerResponseException if the status code of response is 5xx |
|
105 | - * |
|
106 | - * @return Elasticsearch|Promise |
|
107 | - */ |
|
108 | - public function status(array $params = []) |
|
109 | - { |
|
110 | - $url = '/_profiling/status'; |
|
111 | - $method = 'GET'; |
|
112 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'wait_for_resources_created', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
113 | - $headers = ['Accept' => 'application/json']; |
|
114 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
115 | - } |
|
28 | + /** |
|
29 | + * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | + * body: array, // (REQUIRED) The filter conditions for the flamegraph |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
45 | + * |
|
46 | + * @return Elasticsearch|Promise |
|
47 | + */ |
|
48 | + public function flamegraph(array $params = []) |
|
49 | + { |
|
50 | + $this->checkRequiredParameters(['body'], $params); |
|
51 | + $url = '/_profiling/flamegraph'; |
|
52 | + $method = 'POST'; |
|
53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | + } |
|
57 | + /** |
|
58 | + * Extracts raw stacktrace information from Universal Profiling. |
|
59 | + * |
|
60 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
61 | + * |
|
62 | + * @param array{ |
|
63 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
64 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
65 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
66 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
67 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
68 | + * body: array, // (REQUIRED) The filter conditions for stacktraces |
|
69 | + * } $params |
|
70 | + * |
|
71 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
72 | + * @throws ClientResponseException if the status code of response is 4xx |
|
73 | + * @throws ServerResponseException if the status code of response is 5xx |
|
74 | + * |
|
75 | + * @return Elasticsearch|Promise |
|
76 | + */ |
|
77 | + public function stacktraces(array $params = []) |
|
78 | + { |
|
79 | + $this->checkRequiredParameters(['body'], $params); |
|
80 | + $url = '/_profiling/stacktraces'; |
|
81 | + $method = 'POST'; |
|
82 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
83 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
84 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
85 | + } |
|
86 | + /** |
|
87 | + * Returns basic information about the status of Universal Profiling. |
|
88 | + * |
|
89 | + * @see https://www.elastic.co/guide/en/observability/current/universal-profiling.html |
|
90 | + * |
|
91 | + * @param array{ |
|
92 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
93 | + * timeout: time, // Explicit operation timeout |
|
94 | + * wait_for_resources_created: boolean, // Whether to return immediately or wait until resources have been created |
|
95 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
96 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
97 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
98 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
99 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
100 | + * } $params |
|
101 | + * |
|
102 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
103 | + * @throws ClientResponseException if the status code of response is 4xx |
|
104 | + * @throws ServerResponseException if the status code of response is 5xx |
|
105 | + * |
|
106 | + * @return Elasticsearch|Promise |
|
107 | + */ |
|
108 | + public function status(array $params = []) |
|
109 | + { |
|
110 | + $url = '/_profiling/status'; |
|
111 | + $method = 'GET'; |
|
112 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'wait_for_resources_created', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
113 | + $headers = ['Accept' => 'application/json']; |
|
114 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
115 | + } |
|
116 | 116 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Profiling extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Profiling extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. |
30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -25,97 +25,97 @@ |
||
25 | 25 | */ |
26 | 26 | class DanglingIndices extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes the specified dangling index |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
35 | - * accept_data_loss: boolean, // Must be set to true in order to delete the dangling index |
|
36 | - * timeout: time, // Explicit operation timeout |
|
37 | - * master_timeout: time, // Specify timeout for connection to master |
|
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 | - * } $params |
|
44 | - * |
|
45 | - * @throws MissingParameterException if a required parameter is missing |
|
46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
49 | - * |
|
50 | - * @return Elasticsearch|Promise |
|
51 | - */ |
|
52 | - public function deleteDanglingIndex(array $params = []) |
|
53 | - { |
|
54 | - $this->checkRequiredParameters(['index_uuid'], $params); |
|
55 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
56 | - $method = 'DELETE'; |
|
57 | - $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | - $headers = ['Accept' => 'application/json']; |
|
59 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Imports the specified dangling index |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
68 | - * accept_data_loss: boolean, // Must be set to true in order to import the dangling index |
|
69 | - * timeout: time, // Explicit operation timeout |
|
70 | - * master_timeout: time, // Specify timeout for connection to master |
|
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 importDanglingIndex(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['index_uuid'], $params); |
|
88 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
89 | - $method = 'POST'; |
|
90 | - $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', '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 | - * Returns all dangling indices. |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
98 | - * |
|
99 | - * @param array{ |
|
100 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
101 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
102 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
103 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
104 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
105 | - * } $params |
|
106 | - * |
|
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 listDanglingIndices(array $params = []) |
|
114 | - { |
|
115 | - $url = '/_dangling'; |
|
116 | - $method = 'GET'; |
|
117 | - $url = $this->addQueryString($url, $params, ['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 | - } |
|
28 | + /** |
|
29 | + * Deletes the specified dangling index |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
35 | + * accept_data_loss: boolean, // Must be set to true in order to delete the dangling index |
|
36 | + * timeout: time, // Explicit operation timeout |
|
37 | + * master_timeout: time, // Specify timeout for connection to master |
|
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 | + * } $params |
|
44 | + * |
|
45 | + * @throws MissingParameterException if a required parameter is missing |
|
46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
49 | + * |
|
50 | + * @return Elasticsearch|Promise |
|
51 | + */ |
|
52 | + public function deleteDanglingIndex(array $params = []) |
|
53 | + { |
|
54 | + $this->checkRequiredParameters(['index_uuid'], $params); |
|
55 | + $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
56 | + $method = 'DELETE'; |
|
57 | + $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | + $headers = ['Accept' => 'application/json']; |
|
59 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Imports the specified dangling index |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
68 | + * accept_data_loss: boolean, // Must be set to true in order to import the dangling index |
|
69 | + * timeout: time, // Explicit operation timeout |
|
70 | + * master_timeout: time, // Specify timeout for connection to master |
|
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 importDanglingIndex(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['index_uuid'], $params); |
|
88 | + $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
89 | + $method = 'POST'; |
|
90 | + $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', '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 | + * Returns all dangling indices. |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
98 | + * |
|
99 | + * @param array{ |
|
100 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
101 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
102 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
103 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
104 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
105 | + * } $params |
|
106 | + * |
|
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 listDanglingIndices(array $params = []) |
|
114 | + { |
|
115 | + $url = '/_dangling'; |
|
116 | + $method = 'GET'; |
|
117 | + $url = $this->addQueryString($url, $params, ['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 | 121 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function deleteDanglingIndex(array $params = []) |
53 | 53 | { |
54 | 54 | $this->checkRequiredParameters(['index_uuid'], $params); |
55 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
55 | + $url = '/_dangling/'.$this->encode($params['index_uuid']); |
|
56 | 56 | $method = 'DELETE'; |
57 | 57 | $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
58 | 58 | $headers = ['Accept' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function importDanglingIndex(array $params = []) |
86 | 86 | { |
87 | 87 | $this->checkRequiredParameters(['index_uuid'], $params); |
88 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
88 | + $url = '/_dangling/'.$this->encode($params['index_uuid']); |
|
89 | 89 | $method = 'POST'; |
90 | 90 | $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', '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 DanglingIndices extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class DanglingIndices extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes the specified dangling index |
30 | 29 | * |
@@ -25,61 +25,61 @@ |
||
25 | 25 | */ |
26 | 26 | class Xpack extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Retrieves information about the installed X-Pack features. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
35 | - * accept_enterprise: boolean, // If this param is used it must be set to true |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function info(array $params = []) |
|
50 | - { |
|
51 | - $url = '/_xpack'; |
|
52 | - $method = 'GET'; |
|
53 | - $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json']; |
|
55 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | - } |
|
57 | - /** |
|
58 | - * Retrieves usage information about the installed X-Pack features. |
|
59 | - * |
|
60 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
61 | - * |
|
62 | - * @param array{ |
|
63 | - * master_timeout: time, // Specify timeout for watch write operation |
|
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 NoNodeAvailableException if all the hosts are offline |
|
72 | - * @throws ClientResponseException if the status code of response is 4xx |
|
73 | - * @throws ServerResponseException if the status code of response is 5xx |
|
74 | - * |
|
75 | - * @return Elasticsearch|Promise |
|
76 | - */ |
|
77 | - public function usage(array $params = []) |
|
78 | - { |
|
79 | - $url = '/_xpack/usage'; |
|
80 | - $method = 'GET'; |
|
81 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
82 | - $headers = ['Accept' => 'application/json']; |
|
83 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
84 | - } |
|
28 | + /** |
|
29 | + * Retrieves information about the installed X-Pack features. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
35 | + * accept_enterprise: boolean, // If this param is used it must be set to true |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function info(array $params = []) |
|
50 | + { |
|
51 | + $url = '/_xpack'; |
|
52 | + $method = 'GET'; |
|
53 | + $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json']; |
|
55 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
56 | + } |
|
57 | + /** |
|
58 | + * Retrieves usage information about the installed X-Pack features. |
|
59 | + * |
|
60 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
61 | + * |
|
62 | + * @param array{ |
|
63 | + * master_timeout: time, // Specify timeout for watch write operation |
|
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 NoNodeAvailableException if all the hosts are offline |
|
72 | + * @throws ClientResponseException if the status code of response is 4xx |
|
73 | + * @throws ServerResponseException if the status code of response is 5xx |
|
74 | + * |
|
75 | + * @return Elasticsearch|Promise |
|
76 | + */ |
|
77 | + public function usage(array $params = []) |
|
78 | + { |
|
79 | + $url = '/_xpack/usage'; |
|
80 | + $method = 'GET'; |
|
81 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
82 | + $headers = ['Accept' => 'application/json']; |
|
83 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
84 | + } |
|
85 | 85 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Xpack extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Xpack extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Retrieves information about the installed X-Pack features. |
30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -25,31 +25,31 @@ |
||
25 | 25 | */ |
26 | 26 | class Ssl extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.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 | - * } $params |
|
40 | - * |
|
41 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
42 | - * @throws ClientResponseException if the status code of response is 4xx |
|
43 | - * @throws ServerResponseException if the status code of response is 5xx |
|
44 | - * |
|
45 | - * @return Elasticsearch|Promise |
|
46 | - */ |
|
47 | - public function certificates(array $params = []) |
|
48 | - { |
|
49 | - $url = '/_ssl/certificates'; |
|
50 | - $method = 'GET'; |
|
51 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
52 | - $headers = ['Accept' => 'application/json']; |
|
53 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
54 | - } |
|
28 | + /** |
|
29 | + * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.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 | + * } $params |
|
40 | + * |
|
41 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
42 | + * @throws ClientResponseException if the status code of response is 4xx |
|
43 | + * @throws ServerResponseException if the status code of response is 5xx |
|
44 | + * |
|
45 | + * @return Elasticsearch|Promise |
|
46 | + */ |
|
47 | + public function certificates(array $params = []) |
|
48 | + { |
|
49 | + $url = '/_ssl/certificates'; |
|
50 | + $method = 'GET'; |
|
51 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
52 | + $headers = ['Accept' => 'application/json']; |
|
53 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
54 | + } |
|
55 | 55 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Ssl extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Ssl extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -18,10 +18,10 @@ |
||
18 | 18 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait; |
19 | 19 | abstract class AbstractEndpoint |
20 | 20 | { |
21 | - use EndpointTrait; |
|
22 | - protected ClientInterface $client; |
|
23 | - public function __construct(ClientInterface $client) |
|
24 | - { |
|
25 | - $this->client = $client; |
|
26 | - } |
|
21 | + use EndpointTrait; |
|
22 | + protected ClientInterface $client; |
|
23 | + public function __construct(ClientInterface $client) |
|
24 | + { |
|
25 | + $this->client = $client; |
|
26 | + } |
|
27 | 27 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface; |
@@ -16,8 +16,7 @@ |
||
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface; |
18 | 18 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait; |
19 | -abstract class AbstractEndpoint |
|
20 | -{ |
|
19 | +abstract class AbstractEndpoint { |
|
21 | 20 | use EndpointTrait; |
22 | 21 | protected ClientInterface $client; |
23 | 22 | public function __construct(ClientInterface $client) |
@@ -25,263 +25,263 @@ |
||
25 | 25 | */ |
26 | 26 | class Slm extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an existing snapshot lifecycle policy. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
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 deleteLifecycle(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
52 | - $url = '/_slm/policy/' . $this->encode($params['policy_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 | - * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
60 | - * |
|
61 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
62 | - * |
|
63 | - * @param array{ |
|
64 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
65 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
66 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
67 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
68 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
69 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
70 | - * } $params |
|
71 | - * |
|
72 | - * @throws MissingParameterException if a required parameter is missing |
|
73 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
74 | - * @throws ClientResponseException if the status code of response is 4xx |
|
75 | - * @throws ServerResponseException if the status code of response is 5xx |
|
76 | - * |
|
77 | - * @return Elasticsearch|Promise |
|
78 | - */ |
|
79 | - public function executeLifecycle(array $params = []) |
|
80 | - { |
|
81 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
82 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
83 | - $method = 'PUT'; |
|
84 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | - $headers = ['Accept' => 'application/json']; |
|
86 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
87 | - } |
|
88 | - /** |
|
89 | - * Deletes any snapshots that are expired according to the policy's retention rules. |
|
90 | - * |
|
91 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
92 | - * |
|
93 | - * @param array{ |
|
94 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
95 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
96 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
97 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
98 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
99 | - * } $params |
|
100 | - * |
|
101 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
102 | - * @throws ClientResponseException if the status code of response is 4xx |
|
103 | - * @throws ServerResponseException if the status code of response is 5xx |
|
104 | - * |
|
105 | - * @return Elasticsearch|Promise |
|
106 | - */ |
|
107 | - public function executeRetention(array $params = []) |
|
108 | - { |
|
109 | - $url = '/_slm/_execute_retention'; |
|
110 | - $method = 'POST'; |
|
111 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
112 | - $headers = ['Accept' => 'application/json']; |
|
113 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
114 | - } |
|
115 | - /** |
|
116 | - * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
117 | - * |
|
118 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
119 | - * |
|
120 | - * @param array{ |
|
121 | - * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
122 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
123 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
124 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
125 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
126 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
127 | - * } $params |
|
128 | - * |
|
129 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
130 | - * @throws ClientResponseException if the status code of response is 4xx |
|
131 | - * @throws ServerResponseException if the status code of response is 5xx |
|
132 | - * |
|
133 | - * @return Elasticsearch|Promise |
|
134 | - */ |
|
135 | - public function getLifecycle(array $params = []) |
|
136 | - { |
|
137 | - if (isset($params['policy_id'])) { |
|
138 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
139 | - $method = 'GET'; |
|
140 | - } else { |
|
141 | - $url = '/_slm/policy'; |
|
142 | - $method = 'GET'; |
|
143 | - } |
|
144 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
145 | - $headers = ['Accept' => 'application/json']; |
|
146 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
147 | - } |
|
148 | - /** |
|
149 | - * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
150 | - * |
|
151 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
152 | - * |
|
153 | - * @param array{ |
|
154 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
155 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
156 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
157 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
158 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
159 | - * } $params |
|
160 | - * |
|
161 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
162 | - * @throws ClientResponseException if the status code of response is 4xx |
|
163 | - * @throws ServerResponseException if the status code of response is 5xx |
|
164 | - * |
|
165 | - * @return Elasticsearch|Promise |
|
166 | - */ |
|
167 | - public function getStats(array $params = []) |
|
168 | - { |
|
169 | - $url = '/_slm/stats'; |
|
170 | - $method = 'GET'; |
|
171 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
172 | - $headers = ['Accept' => 'application/json']; |
|
173 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
174 | - } |
|
175 | - /** |
|
176 | - * Retrieves the status of snapshot lifecycle management (SLM). |
|
177 | - * |
|
178 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
179 | - * |
|
180 | - * @param array{ |
|
181 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
182 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
183 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
184 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
185 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
186 | - * } $params |
|
187 | - * |
|
188 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
189 | - * @throws ClientResponseException if the status code of response is 4xx |
|
190 | - * @throws ServerResponseException if the status code of response is 5xx |
|
191 | - * |
|
192 | - * @return Elasticsearch|Promise |
|
193 | - */ |
|
194 | - public function getStatus(array $params = []) |
|
195 | - { |
|
196 | - $url = '/_slm/status'; |
|
197 | - $method = 'GET'; |
|
198 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
199 | - $headers = ['Accept' => 'application/json']; |
|
200 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
201 | - } |
|
202 | - /** |
|
203 | - * Creates or updates a snapshot lifecycle policy. |
|
204 | - * |
|
205 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
206 | - * |
|
207 | - * @param array{ |
|
208 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
209 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
210 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
211 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
212 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
213 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
214 | - * body: array, // The snapshot lifecycle policy definition to register |
|
215 | - * } $params |
|
216 | - * |
|
217 | - * @throws MissingParameterException if a required parameter is missing |
|
218 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
219 | - * @throws ClientResponseException if the status code of response is 4xx |
|
220 | - * @throws ServerResponseException if the status code of response is 5xx |
|
221 | - * |
|
222 | - * @return Elasticsearch|Promise |
|
223 | - */ |
|
224 | - public function putLifecycle(array $params = []) |
|
225 | - { |
|
226 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
227 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
228 | - $method = 'PUT'; |
|
229 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
230 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
231 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
232 | - } |
|
233 | - /** |
|
234 | - * Turns on snapshot lifecycle management (SLM). |
|
235 | - * |
|
236 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
237 | - * |
|
238 | - * @param array{ |
|
239 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
240 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
241 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
242 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
243 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
244 | - * } $params |
|
245 | - * |
|
246 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
247 | - * @throws ClientResponseException if the status code of response is 4xx |
|
248 | - * @throws ServerResponseException if the status code of response is 5xx |
|
249 | - * |
|
250 | - * @return Elasticsearch|Promise |
|
251 | - */ |
|
252 | - public function start(array $params = []) |
|
253 | - { |
|
254 | - $url = '/_slm/start'; |
|
255 | - $method = 'POST'; |
|
256 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
257 | - $headers = ['Accept' => 'application/json']; |
|
258 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
259 | - } |
|
260 | - /** |
|
261 | - * Turns off snapshot lifecycle management (SLM). |
|
262 | - * |
|
263 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
264 | - * |
|
265 | - * @param array{ |
|
266 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
267 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
268 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
269 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
270 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
271 | - * } $params |
|
272 | - * |
|
273 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
274 | - * @throws ClientResponseException if the status code of response is 4xx |
|
275 | - * @throws ServerResponseException if the status code of response is 5xx |
|
276 | - * |
|
277 | - * @return Elasticsearch|Promise |
|
278 | - */ |
|
279 | - public function stop(array $params = []) |
|
280 | - { |
|
281 | - $url = '/_slm/stop'; |
|
282 | - $method = 'POST'; |
|
283 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
284 | - $headers = ['Accept' => 'application/json']; |
|
285 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
286 | - } |
|
28 | + /** |
|
29 | + * Deletes an existing snapshot lifecycle policy. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
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 deleteLifecycle(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
52 | + $url = '/_slm/policy/' . $this->encode($params['policy_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 | + * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
60 | + * |
|
61 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
62 | + * |
|
63 | + * @param array{ |
|
64 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
65 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
66 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
67 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
68 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
69 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
70 | + * } $params |
|
71 | + * |
|
72 | + * @throws MissingParameterException if a required parameter is missing |
|
73 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
74 | + * @throws ClientResponseException if the status code of response is 4xx |
|
75 | + * @throws ServerResponseException if the status code of response is 5xx |
|
76 | + * |
|
77 | + * @return Elasticsearch|Promise |
|
78 | + */ |
|
79 | + public function executeLifecycle(array $params = []) |
|
80 | + { |
|
81 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
82 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
83 | + $method = 'PUT'; |
|
84 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | + $headers = ['Accept' => 'application/json']; |
|
86 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
87 | + } |
|
88 | + /** |
|
89 | + * Deletes any snapshots that are expired according to the policy's retention rules. |
|
90 | + * |
|
91 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
92 | + * |
|
93 | + * @param array{ |
|
94 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
95 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
96 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
97 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
98 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
99 | + * } $params |
|
100 | + * |
|
101 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
102 | + * @throws ClientResponseException if the status code of response is 4xx |
|
103 | + * @throws ServerResponseException if the status code of response is 5xx |
|
104 | + * |
|
105 | + * @return Elasticsearch|Promise |
|
106 | + */ |
|
107 | + public function executeRetention(array $params = []) |
|
108 | + { |
|
109 | + $url = '/_slm/_execute_retention'; |
|
110 | + $method = 'POST'; |
|
111 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
112 | + $headers = ['Accept' => 'application/json']; |
|
113 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
114 | + } |
|
115 | + /** |
|
116 | + * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
117 | + * |
|
118 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
119 | + * |
|
120 | + * @param array{ |
|
121 | + * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
122 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
123 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
124 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
125 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
126 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
127 | + * } $params |
|
128 | + * |
|
129 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
130 | + * @throws ClientResponseException if the status code of response is 4xx |
|
131 | + * @throws ServerResponseException if the status code of response is 5xx |
|
132 | + * |
|
133 | + * @return Elasticsearch|Promise |
|
134 | + */ |
|
135 | + public function getLifecycle(array $params = []) |
|
136 | + { |
|
137 | + if (isset($params['policy_id'])) { |
|
138 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
139 | + $method = 'GET'; |
|
140 | + } else { |
|
141 | + $url = '/_slm/policy'; |
|
142 | + $method = 'GET'; |
|
143 | + } |
|
144 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
145 | + $headers = ['Accept' => 'application/json']; |
|
146 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
147 | + } |
|
148 | + /** |
|
149 | + * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
150 | + * |
|
151 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
152 | + * |
|
153 | + * @param array{ |
|
154 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
155 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
156 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
157 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
158 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
159 | + * } $params |
|
160 | + * |
|
161 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
162 | + * @throws ClientResponseException if the status code of response is 4xx |
|
163 | + * @throws ServerResponseException if the status code of response is 5xx |
|
164 | + * |
|
165 | + * @return Elasticsearch|Promise |
|
166 | + */ |
|
167 | + public function getStats(array $params = []) |
|
168 | + { |
|
169 | + $url = '/_slm/stats'; |
|
170 | + $method = 'GET'; |
|
171 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
172 | + $headers = ['Accept' => 'application/json']; |
|
173 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
174 | + } |
|
175 | + /** |
|
176 | + * Retrieves the status of snapshot lifecycle management (SLM). |
|
177 | + * |
|
178 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
179 | + * |
|
180 | + * @param array{ |
|
181 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
182 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
183 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
184 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
185 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
186 | + * } $params |
|
187 | + * |
|
188 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
189 | + * @throws ClientResponseException if the status code of response is 4xx |
|
190 | + * @throws ServerResponseException if the status code of response is 5xx |
|
191 | + * |
|
192 | + * @return Elasticsearch|Promise |
|
193 | + */ |
|
194 | + public function getStatus(array $params = []) |
|
195 | + { |
|
196 | + $url = '/_slm/status'; |
|
197 | + $method = 'GET'; |
|
198 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
199 | + $headers = ['Accept' => 'application/json']; |
|
200 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
201 | + } |
|
202 | + /** |
|
203 | + * Creates or updates a snapshot lifecycle policy. |
|
204 | + * |
|
205 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
206 | + * |
|
207 | + * @param array{ |
|
208 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
209 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
210 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
211 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
212 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
213 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
214 | + * body: array, // The snapshot lifecycle policy definition to register |
|
215 | + * } $params |
|
216 | + * |
|
217 | + * @throws MissingParameterException if a required parameter is missing |
|
218 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
219 | + * @throws ClientResponseException if the status code of response is 4xx |
|
220 | + * @throws ServerResponseException if the status code of response is 5xx |
|
221 | + * |
|
222 | + * @return Elasticsearch|Promise |
|
223 | + */ |
|
224 | + public function putLifecycle(array $params = []) |
|
225 | + { |
|
226 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
227 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
228 | + $method = 'PUT'; |
|
229 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
230 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
231 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
232 | + } |
|
233 | + /** |
|
234 | + * Turns on snapshot lifecycle management (SLM). |
|
235 | + * |
|
236 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
237 | + * |
|
238 | + * @param array{ |
|
239 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
240 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
241 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
242 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
243 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
244 | + * } $params |
|
245 | + * |
|
246 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
247 | + * @throws ClientResponseException if the status code of response is 4xx |
|
248 | + * @throws ServerResponseException if the status code of response is 5xx |
|
249 | + * |
|
250 | + * @return Elasticsearch|Promise |
|
251 | + */ |
|
252 | + public function start(array $params = []) |
|
253 | + { |
|
254 | + $url = '/_slm/start'; |
|
255 | + $method = 'POST'; |
|
256 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
257 | + $headers = ['Accept' => 'application/json']; |
|
258 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
259 | + } |
|
260 | + /** |
|
261 | + * Turns off snapshot lifecycle management (SLM). |
|
262 | + * |
|
263 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
264 | + * |
|
265 | + * @param array{ |
|
266 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
267 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
268 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
269 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
270 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
271 | + * } $params |
|
272 | + * |
|
273 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
274 | + * @throws ClientResponseException if the status code of response is 4xx |
|
275 | + * @throws ServerResponseException if the status code of response is 5xx |
|
276 | + * |
|
277 | + * @return Elasticsearch|Promise |
|
278 | + */ |
|
279 | + public function stop(array $params = []) |
|
280 | + { |
|
281 | + $url = '/_slm/stop'; |
|
282 | + $method = 'POST'; |
|
283 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
284 | + $headers = ['Accept' => 'application/json']; |
|
285 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
286 | + } |
|
287 | 287 | } |
@@ -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 deleteLifecycle(array $params = []) |
50 | 50 | { |
51 | 51 | $this->checkRequiredParameters(['policy_id'], $params); |
52 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
52 | + $url = '/_slm/policy/'.$this->encode($params['policy_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']; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function executeLifecycle(array $params = []) |
80 | 80 | { |
81 | 81 | $this->checkRequiredParameters(['policy_id'], $params); |
82 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
82 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']).'/_execute'; |
|
83 | 83 | $method = 'PUT'; |
84 | 84 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
85 | 85 | $headers = ['Accept' => 'application/json']; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function getLifecycle(array $params = []) |
136 | 136 | { |
137 | 137 | if (isset($params['policy_id'])) { |
138 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
138 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']); |
|
139 | 139 | $method = 'GET'; |
140 | 140 | } else { |
141 | 141 | $url = '/_slm/policy'; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | public function putLifecycle(array $params = []) |
225 | 225 | { |
226 | 226 | $this->checkRequiredParameters(['policy_id'], $params); |
227 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
227 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']); |
|
228 | 228 | $method = 'PUT'; |
229 | 229 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
230 | 230 | $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 Slm extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Slm extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes an existing snapshot lifecycle policy. |
30 | 29 | * |
@@ -25,144 +25,144 @@ |
||
25 | 25 | */ |
26 | 26 | class SearchableSnapshots extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Retrieve node-level cache statistics about searchable snapshots. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * node_id: list, // 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 |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function cacheStats(array $params = []) |
|
50 | - { |
|
51 | - if (isset($params['node_id'])) { |
|
52 | - $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
53 | - $method = 'GET'; |
|
54 | - } else { |
|
55 | - $url = '/_searchable_snapshots/cache/stats'; |
|
56 | - $method = 'GET'; |
|
57 | - } |
|
58 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | - $headers = ['Accept' => 'application/json']; |
|
60 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
61 | - } |
|
62 | - /** |
|
63 | - * Clear the cache of searchable snapshots. |
|
64 | - * |
|
65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
66 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
67 | - * |
|
68 | - * @param array{ |
|
69 | - * index: list, // A comma-separated list of index names |
|
70 | - * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
71 | - * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
72 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
73 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
74 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
75 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
76 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
77 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
78 | - * } $params |
|
79 | - * |
|
80 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
81 | - * @throws ClientResponseException if the status code of response is 4xx |
|
82 | - * @throws ServerResponseException if the status code of response is 5xx |
|
83 | - * |
|
84 | - * @return Elasticsearch|Promise |
|
85 | - */ |
|
86 | - public function clearCache(array $params = []) |
|
87 | - { |
|
88 | - if (isset($params['index'])) { |
|
89 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
90 | - $method = 'POST'; |
|
91 | - } else { |
|
92 | - $url = '/_searchable_snapshots/cache/clear'; |
|
93 | - $method = 'POST'; |
|
94 | - } |
|
95 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', '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 | - * Mount a snapshot as a searchable index. |
|
101 | - * |
|
102 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
103 | - * |
|
104 | - * @param array{ |
|
105 | - * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
106 | - * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
107 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
108 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
109 | - * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
110 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
111 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
112 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
113 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
114 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
115 | - * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
116 | - * } $params |
|
117 | - * |
|
118 | - * @throws MissingParameterException if a required parameter is missing |
|
119 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
120 | - * @throws ClientResponseException if the status code of response is 4xx |
|
121 | - * @throws ServerResponseException if the status code of response is 5xx |
|
122 | - * |
|
123 | - * @return Elasticsearch|Promise |
|
124 | - */ |
|
125 | - public function mount(array $params = []) |
|
126 | - { |
|
127 | - $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
128 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
129 | - $method = 'POST'; |
|
130 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
131 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
132 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
133 | - } |
|
134 | - /** |
|
135 | - * Retrieve shard-level statistics about searchable snapshots. |
|
136 | - * |
|
137 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
138 | - * |
|
139 | - * @param array{ |
|
140 | - * index: list, // A comma-separated list of index names |
|
141 | - * level: enum, // Return stats aggregated at cluster, index or shard level |
|
142 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
143 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
144 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
145 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
146 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
147 | - * } $params |
|
148 | - * |
|
149 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
150 | - * @throws ClientResponseException if the status code of response is 4xx |
|
151 | - * @throws ServerResponseException if the status code of response is 5xx |
|
152 | - * |
|
153 | - * @return Elasticsearch|Promise |
|
154 | - */ |
|
155 | - public function stats(array $params = []) |
|
156 | - { |
|
157 | - if (isset($params['index'])) { |
|
158 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
159 | - $method = 'GET'; |
|
160 | - } else { |
|
161 | - $url = '/_searchable_snapshots/stats'; |
|
162 | - $method = 'GET'; |
|
163 | - } |
|
164 | - $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
165 | - $headers = ['Accept' => 'application/json']; |
|
166 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
167 | - } |
|
28 | + /** |
|
29 | + * Retrieve node-level cache statistics about searchable snapshots. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * node_id: list, // 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 |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function cacheStats(array $params = []) |
|
50 | + { |
|
51 | + if (isset($params['node_id'])) { |
|
52 | + $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
53 | + $method = 'GET'; |
|
54 | + } else { |
|
55 | + $url = '/_searchable_snapshots/cache/stats'; |
|
56 | + $method = 'GET'; |
|
57 | + } |
|
58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | + $headers = ['Accept' => 'application/json']; |
|
60 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
61 | + } |
|
62 | + /** |
|
63 | + * Clear the cache of searchable snapshots. |
|
64 | + * |
|
65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
66 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
67 | + * |
|
68 | + * @param array{ |
|
69 | + * index: list, // A comma-separated list of index names |
|
70 | + * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
71 | + * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
72 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
73 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
74 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
75 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
76 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
77 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
78 | + * } $params |
|
79 | + * |
|
80 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
81 | + * @throws ClientResponseException if the status code of response is 4xx |
|
82 | + * @throws ServerResponseException if the status code of response is 5xx |
|
83 | + * |
|
84 | + * @return Elasticsearch|Promise |
|
85 | + */ |
|
86 | + public function clearCache(array $params = []) |
|
87 | + { |
|
88 | + if (isset($params['index'])) { |
|
89 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
90 | + $method = 'POST'; |
|
91 | + } else { |
|
92 | + $url = '/_searchable_snapshots/cache/clear'; |
|
93 | + $method = 'POST'; |
|
94 | + } |
|
95 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', '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 | + * Mount a snapshot as a searchable index. |
|
101 | + * |
|
102 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
103 | + * |
|
104 | + * @param array{ |
|
105 | + * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
106 | + * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
107 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
108 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
109 | + * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
110 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
111 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
112 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
113 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
114 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
115 | + * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
116 | + * } $params |
|
117 | + * |
|
118 | + * @throws MissingParameterException if a required parameter is missing |
|
119 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
120 | + * @throws ClientResponseException if the status code of response is 4xx |
|
121 | + * @throws ServerResponseException if the status code of response is 5xx |
|
122 | + * |
|
123 | + * @return Elasticsearch|Promise |
|
124 | + */ |
|
125 | + public function mount(array $params = []) |
|
126 | + { |
|
127 | + $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
128 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
129 | + $method = 'POST'; |
|
130 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
131 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
132 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
133 | + } |
|
134 | + /** |
|
135 | + * Retrieve shard-level statistics about searchable snapshots. |
|
136 | + * |
|
137 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
138 | + * |
|
139 | + * @param array{ |
|
140 | + * index: list, // A comma-separated list of index names |
|
141 | + * level: enum, // Return stats aggregated at cluster, index or shard level |
|
142 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
143 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
144 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
145 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
146 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
147 | + * } $params |
|
148 | + * |
|
149 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
150 | + * @throws ClientResponseException if the status code of response is 4xx |
|
151 | + * @throws ServerResponseException if the status code of response is 5xx |
|
152 | + * |
|
153 | + * @return Elasticsearch|Promise |
|
154 | + */ |
|
155 | + public function stats(array $params = []) |
|
156 | + { |
|
157 | + if (isset($params['index'])) { |
|
158 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
159 | + $method = 'GET'; |
|
160 | + } else { |
|
161 | + $url = '/_searchable_snapshots/stats'; |
|
162 | + $method = 'GET'; |
|
163 | + } |
|
164 | + $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
165 | + $headers = ['Accept' => 'application/json']; |
|
166 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
167 | + } |
|
168 | 168 | } |
@@ -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 cacheStats(array $params = []) |
50 | 50 | { |
51 | 51 | if (isset($params['node_id'])) { |
52 | - $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
52 | + $url = '/_searchable_snapshots/'.$this->encode($params['node_id']).'/cache/stats'; |
|
53 | 53 | $method = 'GET'; |
54 | 54 | } else { |
55 | 55 | $url = '/_searchable_snapshots/cache/stats'; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function clearCache(array $params = []) |
87 | 87 | { |
88 | 88 | if (isset($params['index'])) { |
89 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
89 | + $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/cache/clear'; |
|
90 | 90 | $method = 'POST'; |
91 | 91 | } else { |
92 | 92 | $url = '/_searchable_snapshots/cache/clear'; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function mount(array $params = []) |
126 | 126 | { |
127 | 127 | $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
128 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
128 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_mount'; |
|
129 | 129 | $method = 'POST'; |
130 | 130 | $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
131 | 131 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function stats(array $params = []) |
156 | 156 | { |
157 | 157 | if (isset($params['index'])) { |
158 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
158 | + $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/stats'; |
|
159 | 159 | $method = 'GET'; |
160 | 160 | } else { |
161 | 161 | $url = '/_searchable_snapshots/stats'; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class SearchableSnapshots extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class SearchableSnapshots extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Retrieve node-level cache statistics about searchable snapshots. |
30 | 29 | * |
@@ -25,368 +25,368 @@ |
||
25 | 25 | */ |
26 | 26 | class Transform extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an existing transform. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * transform_id: string, // (REQUIRED) The id of the transform to delete |
|
35 | - * force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. |
|
36 | - * delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. |
|
37 | - * timeout: time, // Controls the time to wait for the transform deletion |
|
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 | - * } $params |
|
44 | - * |
|
45 | - * @throws MissingParameterException if a required parameter is missing |
|
46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
49 | - * |
|
50 | - * @return Elasticsearch|Promise |
|
51 | - */ |
|
52 | - public function deleteTransform(array $params = []) |
|
53 | - { |
|
54 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
55 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
56 | - $method = 'DELETE'; |
|
57 | - $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | - $headers = ['Accept' => 'application/json']; |
|
59 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Retrieves configuration information for transforms. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * transform_id: string, // The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms |
|
68 | - * from: int, // skips a number of transform configs, defaults to 0 |
|
69 | - * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
70 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
71 | - * exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT |
|
72 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
73 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
74 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
75 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
76 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
77 | - * } $params |
|
78 | - * |
|
79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
82 | - * |
|
83 | - * @return Elasticsearch|Promise |
|
84 | - */ |
|
85 | - public function getTransform(array $params = []) |
|
86 | - { |
|
87 | - if (isset($params['transform_id'])) { |
|
88 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
89 | - $method = 'GET'; |
|
90 | - } else { |
|
91 | - $url = '/_transform'; |
|
92 | - $method = 'GET'; |
|
93 | - } |
|
94 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
95 | - $headers = ['Accept' => 'application/json']; |
|
96 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
97 | - } |
|
98 | - /** |
|
99 | - * Retrieves usage information for transforms. |
|
100 | - * |
|
101 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html |
|
102 | - * |
|
103 | - * @param array{ |
|
104 | - * transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
105 | - * from: number, // skips a number of transform stats, defaults to 0 |
|
106 | - * size: number, // specifies a max number of transform stats to get, defaults to 100 |
|
107 | - * timeout: time, // Controls the time to wait for the stats |
|
108 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
109 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
110 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
111 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
112 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
113 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
114 | - * } $params |
|
115 | - * |
|
116 | - * @throws MissingParameterException if a required parameter is missing |
|
117 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
118 | - * @throws ClientResponseException if the status code of response is 4xx |
|
119 | - * @throws ServerResponseException if the status code of response is 5xx |
|
120 | - * |
|
121 | - * @return Elasticsearch|Promise |
|
122 | - */ |
|
123 | - public function getTransformStats(array $params = []) |
|
124 | - { |
|
125 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
126 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
127 | - $method = 'GET'; |
|
128 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
129 | - $headers = ['Accept' => 'application/json']; |
|
130 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
131 | - } |
|
132 | - /** |
|
133 | - * Previews a transform. |
|
134 | - * |
|
135 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html |
|
136 | - * |
|
137 | - * @param array{ |
|
138 | - * transform_id: string, // The id of the transform to preview. |
|
139 | - * timeout: time, // Controls the time to wait for the preview |
|
140 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
141 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
142 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
143 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
144 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
145 | - * body: array, // The definition for the transform to preview |
|
146 | - * } $params |
|
147 | - * |
|
148 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | - * @throws ClientResponseException if the status code of response is 4xx |
|
150 | - * @throws ServerResponseException if the status code of response is 5xx |
|
151 | - * |
|
152 | - * @return Elasticsearch|Promise |
|
153 | - */ |
|
154 | - public function previewTransform(array $params = []) |
|
155 | - { |
|
156 | - if (isset($params['transform_id'])) { |
|
157 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
158 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
159 | - } else { |
|
160 | - $url = '/_transform/_preview'; |
|
161 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
162 | - } |
|
163 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
164 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
165 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
166 | - } |
|
167 | - /** |
|
168 | - * Instantiates a transform. |
|
169 | - * |
|
170 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html |
|
171 | - * |
|
172 | - * @param array{ |
|
173 | - * transform_id: string, // (REQUIRED) The id of the new transform. |
|
174 | - * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
175 | - * timeout: time, // Controls the time to wait for the transform to start |
|
176 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
177 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
178 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
179 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
180 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
181 | - * body: array, // (REQUIRED) The transform definition |
|
182 | - * } $params |
|
183 | - * |
|
184 | - * @throws MissingParameterException if a required parameter is missing |
|
185 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
186 | - * @throws ClientResponseException if the status code of response is 4xx |
|
187 | - * @throws ServerResponseException if the status code of response is 5xx |
|
188 | - * |
|
189 | - * @return Elasticsearch|Promise |
|
190 | - */ |
|
191 | - public function putTransform(array $params = []) |
|
192 | - { |
|
193 | - $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
194 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
195 | - $method = 'PUT'; |
|
196 | - $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
197 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
198 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
199 | - } |
|
200 | - /** |
|
201 | - * Resets an existing transform. |
|
202 | - * |
|
203 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html |
|
204 | - * |
|
205 | - * @param array{ |
|
206 | - * transform_id: string, // (REQUIRED) The id of the transform to reset |
|
207 | - * force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. |
|
208 | - * timeout: time, // Controls the time to wait for the transform to reset |
|
209 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
210 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
211 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
212 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
213 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
214 | - * } $params |
|
215 | - * |
|
216 | - * @throws MissingParameterException if a required parameter is missing |
|
217 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
218 | - * @throws ClientResponseException if the status code of response is 4xx |
|
219 | - * @throws ServerResponseException if the status code of response is 5xx |
|
220 | - * |
|
221 | - * @return Elasticsearch|Promise |
|
222 | - */ |
|
223 | - public function resetTransform(array $params = []) |
|
224 | - { |
|
225 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
226 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
227 | - $method = 'POST'; |
|
228 | - $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
229 | - $headers = ['Accept' => 'application/json']; |
|
230 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
231 | - } |
|
232 | - /** |
|
233 | - * Schedules now a transform. |
|
234 | - * |
|
235 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html |
|
236 | - * |
|
237 | - * @param array{ |
|
238 | - * transform_id: string, // (REQUIRED) The id of the transform. |
|
239 | - * timeout: time, // Controls the time to wait for the scheduling to take place |
|
240 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
241 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
242 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
243 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
244 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
245 | - * } $params |
|
246 | - * |
|
247 | - * @throws MissingParameterException if a required parameter is missing |
|
248 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
249 | - * @throws ClientResponseException if the status code of response is 4xx |
|
250 | - * @throws ServerResponseException if the status code of response is 5xx |
|
251 | - * |
|
252 | - * @return Elasticsearch|Promise |
|
253 | - */ |
|
254 | - public function scheduleNowTransform(array $params = []) |
|
255 | - { |
|
256 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
257 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
258 | - $method = 'POST'; |
|
259 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
260 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
261 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
262 | - } |
|
263 | - /** |
|
264 | - * Starts one or more transforms. |
|
265 | - * |
|
266 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html |
|
267 | - * |
|
268 | - * @param array{ |
|
269 | - * transform_id: string, // (REQUIRED) The id of the transform to start |
|
270 | - * from: string, // Restricts the set of transformed entities to those changed after this time |
|
271 | - * timeout: time, // Controls the time to wait for the transform to start |
|
272 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
273 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
274 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
275 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
276 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
277 | - * } $params |
|
278 | - * |
|
279 | - * @throws MissingParameterException if a required parameter is missing |
|
280 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
281 | - * @throws ClientResponseException if the status code of response is 4xx |
|
282 | - * @throws ServerResponseException if the status code of response is 5xx |
|
283 | - * |
|
284 | - * @return Elasticsearch|Promise |
|
285 | - */ |
|
286 | - public function startTransform(array $params = []) |
|
287 | - { |
|
288 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
289 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
290 | - $method = 'POST'; |
|
291 | - $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
292 | - $headers = ['Accept' => 'application/json']; |
|
293 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
294 | - } |
|
295 | - /** |
|
296 | - * Stops one or more transforms. |
|
297 | - * |
|
298 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html |
|
299 | - * |
|
300 | - * @param array{ |
|
301 | - * transform_id: string, // (REQUIRED) The id of the transform to stop |
|
302 | - * force: boolean, // Whether to force stop a failed transform or not. Default to false |
|
303 | - * wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false |
|
304 | - * timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds |
|
305 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
306 | - * wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false |
|
307 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
308 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
309 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
310 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
311 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
312 | - * } $params |
|
313 | - * |
|
314 | - * @throws MissingParameterException if a required parameter is missing |
|
315 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
316 | - * @throws ClientResponseException if the status code of response is 4xx |
|
317 | - * @throws ServerResponseException if the status code of response is 5xx |
|
318 | - * |
|
319 | - * @return Elasticsearch|Promise |
|
320 | - */ |
|
321 | - public function stopTransform(array $params = []) |
|
322 | - { |
|
323 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
324 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
325 | - $method = 'POST'; |
|
326 | - $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | - $headers = ['Accept' => 'application/json']; |
|
328 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
329 | - } |
|
330 | - /** |
|
331 | - * Updates certain properties of a transform. |
|
332 | - * |
|
333 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html |
|
334 | - * |
|
335 | - * @param array{ |
|
336 | - * transform_id: string, // (REQUIRED) The id of the transform. |
|
337 | - * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
338 | - * timeout: time, // Controls the time to wait for the update |
|
339 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
340 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
341 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
342 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
343 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
344 | - * body: array, // (REQUIRED) The update transform definition |
|
345 | - * } $params |
|
346 | - * |
|
347 | - * @throws MissingParameterException if a required parameter is missing |
|
348 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
349 | - * @throws ClientResponseException if the status code of response is 4xx |
|
350 | - * @throws ServerResponseException if the status code of response is 5xx |
|
351 | - * |
|
352 | - * @return Elasticsearch|Promise |
|
353 | - */ |
|
354 | - public function updateTransform(array $params = []) |
|
355 | - { |
|
356 | - $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
357 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
358 | - $method = 'POST'; |
|
359 | - $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
361 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
362 | - } |
|
363 | - /** |
|
364 | - * Upgrades all transforms. |
|
365 | - * |
|
366 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html |
|
367 | - * |
|
368 | - * @param array{ |
|
369 | - * dry_run: boolean, // Whether to only check for updates but don't execute |
|
370 | - * timeout: time, // Controls the time to wait for the upgrade |
|
371 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
372 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
373 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
374 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
375 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
376 | - * } $params |
|
377 | - * |
|
378 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
379 | - * @throws ClientResponseException if the status code of response is 4xx |
|
380 | - * @throws ServerResponseException if the status code of response is 5xx |
|
381 | - * |
|
382 | - * @return Elasticsearch|Promise |
|
383 | - */ |
|
384 | - public function upgradeTransforms(array $params = []) |
|
385 | - { |
|
386 | - $url = '/_transform/_upgrade'; |
|
387 | - $method = 'POST'; |
|
388 | - $url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
389 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
390 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
391 | - } |
|
28 | + /** |
|
29 | + * Deletes an existing transform. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * transform_id: string, // (REQUIRED) The id of the transform to delete |
|
35 | + * force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. |
|
36 | + * delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. |
|
37 | + * timeout: time, // Controls the time to wait for the transform deletion |
|
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 | + * } $params |
|
44 | + * |
|
45 | + * @throws MissingParameterException if a required parameter is missing |
|
46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
49 | + * |
|
50 | + * @return Elasticsearch|Promise |
|
51 | + */ |
|
52 | + public function deleteTransform(array $params = []) |
|
53 | + { |
|
54 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
55 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
56 | + $method = 'DELETE'; |
|
57 | + $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
58 | + $headers = ['Accept' => 'application/json']; |
|
59 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Retrieves configuration information for transforms. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * transform_id: string, // The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms |
|
68 | + * from: int, // skips a number of transform configs, defaults to 0 |
|
69 | + * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
70 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
71 | + * exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT |
|
72 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
73 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
74 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
75 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
76 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
77 | + * } $params |
|
78 | + * |
|
79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
82 | + * |
|
83 | + * @return Elasticsearch|Promise |
|
84 | + */ |
|
85 | + public function getTransform(array $params = []) |
|
86 | + { |
|
87 | + if (isset($params['transform_id'])) { |
|
88 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
89 | + $method = 'GET'; |
|
90 | + } else { |
|
91 | + $url = '/_transform'; |
|
92 | + $method = 'GET'; |
|
93 | + } |
|
94 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
95 | + $headers = ['Accept' => 'application/json']; |
|
96 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
97 | + } |
|
98 | + /** |
|
99 | + * Retrieves usage information for transforms. |
|
100 | + * |
|
101 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html |
|
102 | + * |
|
103 | + * @param array{ |
|
104 | + * transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
105 | + * from: number, // skips a number of transform stats, defaults to 0 |
|
106 | + * size: number, // specifies a max number of transform stats to get, defaults to 100 |
|
107 | + * timeout: time, // Controls the time to wait for the stats |
|
108 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
109 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
110 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
111 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
112 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
113 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
114 | + * } $params |
|
115 | + * |
|
116 | + * @throws MissingParameterException if a required parameter is missing |
|
117 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
118 | + * @throws ClientResponseException if the status code of response is 4xx |
|
119 | + * @throws ServerResponseException if the status code of response is 5xx |
|
120 | + * |
|
121 | + * @return Elasticsearch|Promise |
|
122 | + */ |
|
123 | + public function getTransformStats(array $params = []) |
|
124 | + { |
|
125 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
126 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
127 | + $method = 'GET'; |
|
128 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
129 | + $headers = ['Accept' => 'application/json']; |
|
130 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
131 | + } |
|
132 | + /** |
|
133 | + * Previews a transform. |
|
134 | + * |
|
135 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html |
|
136 | + * |
|
137 | + * @param array{ |
|
138 | + * transform_id: string, // The id of the transform to preview. |
|
139 | + * timeout: time, // Controls the time to wait for the preview |
|
140 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
141 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
142 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
143 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
144 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
145 | + * body: array, // The definition for the transform to preview |
|
146 | + * } $params |
|
147 | + * |
|
148 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | + * @throws ClientResponseException if the status code of response is 4xx |
|
150 | + * @throws ServerResponseException if the status code of response is 5xx |
|
151 | + * |
|
152 | + * @return Elasticsearch|Promise |
|
153 | + */ |
|
154 | + public function previewTransform(array $params = []) |
|
155 | + { |
|
156 | + if (isset($params['transform_id'])) { |
|
157 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
158 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
159 | + } else { |
|
160 | + $url = '/_transform/_preview'; |
|
161 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
162 | + } |
|
163 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
164 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
165 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
166 | + } |
|
167 | + /** |
|
168 | + * Instantiates a transform. |
|
169 | + * |
|
170 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html |
|
171 | + * |
|
172 | + * @param array{ |
|
173 | + * transform_id: string, // (REQUIRED) The id of the new transform. |
|
174 | + * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
175 | + * timeout: time, // Controls the time to wait for the transform to start |
|
176 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
177 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
178 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
179 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
180 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
181 | + * body: array, // (REQUIRED) The transform definition |
|
182 | + * } $params |
|
183 | + * |
|
184 | + * @throws MissingParameterException if a required parameter is missing |
|
185 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
186 | + * @throws ClientResponseException if the status code of response is 4xx |
|
187 | + * @throws ServerResponseException if the status code of response is 5xx |
|
188 | + * |
|
189 | + * @return Elasticsearch|Promise |
|
190 | + */ |
|
191 | + public function putTransform(array $params = []) |
|
192 | + { |
|
193 | + $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
194 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
195 | + $method = 'PUT'; |
|
196 | + $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
197 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
198 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
199 | + } |
|
200 | + /** |
|
201 | + * Resets an existing transform. |
|
202 | + * |
|
203 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html |
|
204 | + * |
|
205 | + * @param array{ |
|
206 | + * transform_id: string, // (REQUIRED) The id of the transform to reset |
|
207 | + * force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. |
|
208 | + * timeout: time, // Controls the time to wait for the transform to reset |
|
209 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
210 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
211 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
212 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
213 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
214 | + * } $params |
|
215 | + * |
|
216 | + * @throws MissingParameterException if a required parameter is missing |
|
217 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
218 | + * @throws ClientResponseException if the status code of response is 4xx |
|
219 | + * @throws ServerResponseException if the status code of response is 5xx |
|
220 | + * |
|
221 | + * @return Elasticsearch|Promise |
|
222 | + */ |
|
223 | + public function resetTransform(array $params = []) |
|
224 | + { |
|
225 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
226 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
227 | + $method = 'POST'; |
|
228 | + $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
229 | + $headers = ['Accept' => 'application/json']; |
|
230 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
231 | + } |
|
232 | + /** |
|
233 | + * Schedules now a transform. |
|
234 | + * |
|
235 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html |
|
236 | + * |
|
237 | + * @param array{ |
|
238 | + * transform_id: string, // (REQUIRED) The id of the transform. |
|
239 | + * timeout: time, // Controls the time to wait for the scheduling to take place |
|
240 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
241 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
242 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
243 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
244 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
245 | + * } $params |
|
246 | + * |
|
247 | + * @throws MissingParameterException if a required parameter is missing |
|
248 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
249 | + * @throws ClientResponseException if the status code of response is 4xx |
|
250 | + * @throws ServerResponseException if the status code of response is 5xx |
|
251 | + * |
|
252 | + * @return Elasticsearch|Promise |
|
253 | + */ |
|
254 | + public function scheduleNowTransform(array $params = []) |
|
255 | + { |
|
256 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
257 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
258 | + $method = 'POST'; |
|
259 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
260 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
261 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
262 | + } |
|
263 | + /** |
|
264 | + * Starts one or more transforms. |
|
265 | + * |
|
266 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html |
|
267 | + * |
|
268 | + * @param array{ |
|
269 | + * transform_id: string, // (REQUIRED) The id of the transform to start |
|
270 | + * from: string, // Restricts the set of transformed entities to those changed after this time |
|
271 | + * timeout: time, // Controls the time to wait for the transform to start |
|
272 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
273 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
274 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
275 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
276 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
277 | + * } $params |
|
278 | + * |
|
279 | + * @throws MissingParameterException if a required parameter is missing |
|
280 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
281 | + * @throws ClientResponseException if the status code of response is 4xx |
|
282 | + * @throws ServerResponseException if the status code of response is 5xx |
|
283 | + * |
|
284 | + * @return Elasticsearch|Promise |
|
285 | + */ |
|
286 | + public function startTransform(array $params = []) |
|
287 | + { |
|
288 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
289 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
290 | + $method = 'POST'; |
|
291 | + $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
292 | + $headers = ['Accept' => 'application/json']; |
|
293 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
294 | + } |
|
295 | + /** |
|
296 | + * Stops one or more transforms. |
|
297 | + * |
|
298 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html |
|
299 | + * |
|
300 | + * @param array{ |
|
301 | + * transform_id: string, // (REQUIRED) The id of the transform to stop |
|
302 | + * force: boolean, // Whether to force stop a failed transform or not. Default to false |
|
303 | + * wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false |
|
304 | + * timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds |
|
305 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
306 | + * wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false |
|
307 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
308 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
309 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
310 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
311 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
312 | + * } $params |
|
313 | + * |
|
314 | + * @throws MissingParameterException if a required parameter is missing |
|
315 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
316 | + * @throws ClientResponseException if the status code of response is 4xx |
|
317 | + * @throws ServerResponseException if the status code of response is 5xx |
|
318 | + * |
|
319 | + * @return Elasticsearch|Promise |
|
320 | + */ |
|
321 | + public function stopTransform(array $params = []) |
|
322 | + { |
|
323 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
324 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
325 | + $method = 'POST'; |
|
326 | + $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | + $headers = ['Accept' => 'application/json']; |
|
328 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
329 | + } |
|
330 | + /** |
|
331 | + * Updates certain properties of a transform. |
|
332 | + * |
|
333 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html |
|
334 | + * |
|
335 | + * @param array{ |
|
336 | + * transform_id: string, // (REQUIRED) The id of the transform. |
|
337 | + * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
338 | + * timeout: time, // Controls the time to wait for the update |
|
339 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
340 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
341 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
342 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
343 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
344 | + * body: array, // (REQUIRED) The update transform definition |
|
345 | + * } $params |
|
346 | + * |
|
347 | + * @throws MissingParameterException if a required parameter is missing |
|
348 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
349 | + * @throws ClientResponseException if the status code of response is 4xx |
|
350 | + * @throws ServerResponseException if the status code of response is 5xx |
|
351 | + * |
|
352 | + * @return Elasticsearch|Promise |
|
353 | + */ |
|
354 | + public function updateTransform(array $params = []) |
|
355 | + { |
|
356 | + $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
357 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
358 | + $method = 'POST'; |
|
359 | + $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
361 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
362 | + } |
|
363 | + /** |
|
364 | + * Upgrades all transforms. |
|
365 | + * |
|
366 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html |
|
367 | + * |
|
368 | + * @param array{ |
|
369 | + * dry_run: boolean, // Whether to only check for updates but don't execute |
|
370 | + * timeout: time, // Controls the time to wait for the upgrade |
|
371 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
372 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
373 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
374 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
375 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
376 | + * } $params |
|
377 | + * |
|
378 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
379 | + * @throws ClientResponseException if the status code of response is 4xx |
|
380 | + * @throws ServerResponseException if the status code of response is 5xx |
|
381 | + * |
|
382 | + * @return Elasticsearch|Promise |
|
383 | + */ |
|
384 | + public function upgradeTransforms(array $params = []) |
|
385 | + { |
|
386 | + $url = '/_transform/_upgrade'; |
|
387 | + $method = 'POST'; |
|
388 | + $url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
389 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
390 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
391 | + } |
|
392 | 392 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function deleteTransform(array $params = []) |
53 | 53 | { |
54 | 54 | $this->checkRequiredParameters(['transform_id'], $params); |
55 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
55 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
56 | 56 | $method = 'DELETE'; |
57 | 57 | $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
58 | 58 | $headers = ['Accept' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function getTransform(array $params = []) |
86 | 86 | { |
87 | 87 | if (isset($params['transform_id'])) { |
88 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
88 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
89 | 89 | $method = 'GET'; |
90 | 90 | } else { |
91 | 91 | $url = '/_transform'; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function getTransformStats(array $params = []) |
124 | 124 | { |
125 | 125 | $this->checkRequiredParameters(['transform_id'], $params); |
126 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
126 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_stats'; |
|
127 | 127 | $method = 'GET'; |
128 | 128 | $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
129 | 129 | $headers = ['Accept' => 'application/json']; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | public function previewTransform(array $params = []) |
155 | 155 | { |
156 | 156 | if (isset($params['transform_id'])) { |
157 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
157 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_preview'; |
|
158 | 158 | $method = empty($params['body']) ? 'GET' : 'POST'; |
159 | 159 | } else { |
160 | 160 | $url = '/_transform/_preview'; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | public function putTransform(array $params = []) |
192 | 192 | { |
193 | 193 | $this->checkRequiredParameters(['transform_id', 'body'], $params); |
194 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
194 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
195 | 195 | $method = 'PUT'; |
196 | 196 | $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
197 | 197 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function resetTransform(array $params = []) |
224 | 224 | { |
225 | 225 | $this->checkRequiredParameters(['transform_id'], $params); |
226 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
226 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_reset'; |
|
227 | 227 | $method = 'POST'; |
228 | 228 | $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
229 | 229 | $headers = ['Accept' => 'application/json']; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | public function scheduleNowTransform(array $params = []) |
255 | 255 | { |
256 | 256 | $this->checkRequiredParameters(['transform_id'], $params); |
257 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
257 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_schedule_now'; |
|
258 | 258 | $method = 'POST'; |
259 | 259 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
260 | 260 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | public function startTransform(array $params = []) |
287 | 287 | { |
288 | 288 | $this->checkRequiredParameters(['transform_id'], $params); |
289 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
289 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_start'; |
|
290 | 290 | $method = 'POST'; |
291 | 291 | $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
292 | 292 | $headers = ['Accept' => 'application/json']; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function stopTransform(array $params = []) |
322 | 322 | { |
323 | 323 | $this->checkRequiredParameters(['transform_id'], $params); |
324 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
324 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_stop'; |
|
325 | 325 | $method = 'POST'; |
326 | 326 | $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
327 | 327 | $headers = ['Accept' => 'application/json']; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | public function updateTransform(array $params = []) |
355 | 355 | { |
356 | 356 | $this->checkRequiredParameters(['transform_id', 'body'], $params); |
357 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
357 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_update'; |
|
358 | 358 | $method = 'POST'; |
359 | 359 | $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
360 | 360 | $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 Transform extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Transform extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes an existing transform. |
30 | 29 | * |
@@ -25,402 +25,402 @@ |
||
25 | 25 | */ |
26 | 26 | class Watcher extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Acknowledges a watch, manually throttling the execution of the watch's actions. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * watch_id: string, // (REQUIRED) Watch ID |
|
35 | - * action_id: list, // A comma-separated list of the action ids to be acked |
|
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 ackWatch(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
53 | - if (isset($params['action_id'])) { |
|
54 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
55 | - $method = 'PUT'; |
|
56 | - } else { |
|
57 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
58 | - $method = 'PUT'; |
|
59 | - } |
|
60 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
61 | - $headers = ['Accept' => 'application/json']; |
|
62 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
63 | - } |
|
64 | - /** |
|
65 | - * Activates a currently inactive watch. |
|
66 | - * |
|
67 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html |
|
68 | - * |
|
69 | - * @param array{ |
|
70 | - * watch_id: string, // (REQUIRED) Watch ID |
|
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 activateWatch(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
88 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
89 | - $method = 'PUT'; |
|
90 | - $url = $this->addQueryString($url, $params, ['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 | - * Deactivates a currently active watch. |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html |
|
98 | - * |
|
99 | - * @param array{ |
|
100 | - * watch_id: string, // (REQUIRED) Watch ID |
|
101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | - * } $params |
|
107 | - * |
|
108 | - * @throws MissingParameterException if a required parameter is missing |
|
109 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | - * @throws ClientResponseException if the status code of response is 4xx |
|
111 | - * @throws ServerResponseException if the status code of response is 5xx |
|
112 | - * |
|
113 | - * @return Elasticsearch|Promise |
|
114 | - */ |
|
115 | - public function deactivateWatch(array $params = []) |
|
116 | - { |
|
117 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
118 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
119 | - $method = 'PUT'; |
|
120 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | - $headers = ['Accept' => 'application/json']; |
|
122 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
123 | - } |
|
124 | - /** |
|
125 | - * Removes a watch from Watcher. |
|
126 | - * |
|
127 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html |
|
128 | - * |
|
129 | - * @param array{ |
|
130 | - * id: string, // (REQUIRED) Watch ID |
|
131 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
132 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
133 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
134 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
135 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 deleteWatch(array $params = []) |
|
146 | - { |
|
147 | - $this->checkRequiredParameters(['id'], $params); |
|
148 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
149 | - $method = 'DELETE'; |
|
150 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | - $headers = ['Accept' => 'application/json']; |
|
152 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
153 | - } |
|
154 | - /** |
|
155 | - * Forces the execution of a stored watch. |
|
156 | - * |
|
157 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html |
|
158 | - * |
|
159 | - * @param array{ |
|
160 | - * id: string, // Watch ID |
|
161 | - * debug: boolean, // indicates whether the watch should execute in debug mode |
|
162 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | - * body: array, // Execution control |
|
168 | - * } $params |
|
169 | - * |
|
170 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
171 | - * @throws ClientResponseException if the status code of response is 4xx |
|
172 | - * @throws ServerResponseException if the status code of response is 5xx |
|
173 | - * |
|
174 | - * @return Elasticsearch|Promise |
|
175 | - */ |
|
176 | - public function executeWatch(array $params = []) |
|
177 | - { |
|
178 | - if (isset($params['id'])) { |
|
179 | - $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
180 | - $method = 'PUT'; |
|
181 | - } else { |
|
182 | - $url = '/_watcher/watch/_execute'; |
|
183 | - $method = 'PUT'; |
|
184 | - } |
|
185 | - $url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
187 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
188 | - } |
|
189 | - /** |
|
190 | - * Retrieve settings for the watcher system index |
|
191 | - * |
|
192 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html |
|
193 | - * |
|
194 | - * @param array{ |
|
195 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
196 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
197 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
198 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
199 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
200 | - * } $params |
|
201 | - * |
|
202 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
203 | - * @throws ClientResponseException if the status code of response is 4xx |
|
204 | - * @throws ServerResponseException if the status code of response is 5xx |
|
205 | - * |
|
206 | - * @return Elasticsearch|Promise |
|
207 | - */ |
|
208 | - public function getSettings(array $params = []) |
|
209 | - { |
|
210 | - $url = '/_watcher/settings'; |
|
211 | - $method = 'GET'; |
|
212 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
213 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
214 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
215 | - } |
|
216 | - /** |
|
217 | - * Retrieves a watch by its ID. |
|
218 | - * |
|
219 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html |
|
220 | - * |
|
221 | - * @param array{ |
|
222 | - * id: string, // (REQUIRED) Watch ID |
|
223 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | - * } $params |
|
229 | - * |
|
230 | - * @throws MissingParameterException if a required parameter is missing |
|
231 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
232 | - * @throws ClientResponseException if the status code of response is 4xx |
|
233 | - * @throws ServerResponseException if the status code of response is 5xx |
|
234 | - * |
|
235 | - * @return Elasticsearch|Promise |
|
236 | - */ |
|
237 | - public function getWatch(array $params = []) |
|
238 | - { |
|
239 | - $this->checkRequiredParameters(['id'], $params); |
|
240 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
241 | - $method = 'GET'; |
|
242 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
243 | - $headers = ['Accept' => 'application/json']; |
|
244 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
245 | - } |
|
246 | - /** |
|
247 | - * Creates a new watch, or updates an existing one. |
|
248 | - * |
|
249 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html |
|
250 | - * |
|
251 | - * @param array{ |
|
252 | - * id: string, // (REQUIRED) Watch ID |
|
253 | - * active: boolean, // Specify whether the watch is in/active by default |
|
254 | - * version: number, // Explicit version number for concurrency control |
|
255 | - * if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number |
|
256 | - * if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term |
|
257 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
258 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
259 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
260 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
261 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
262 | - * body: array, // The watch |
|
263 | - * } $params |
|
264 | - * |
|
265 | - * @throws MissingParameterException if a required parameter is missing |
|
266 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
267 | - * @throws ClientResponseException if the status code of response is 4xx |
|
268 | - * @throws ServerResponseException if the status code of response is 5xx |
|
269 | - * |
|
270 | - * @return Elasticsearch|Promise |
|
271 | - */ |
|
272 | - public function putWatch(array $params = []) |
|
273 | - { |
|
274 | - $this->checkRequiredParameters(['id'], $params); |
|
275 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
276 | - $method = 'PUT'; |
|
277 | - $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
278 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
279 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
280 | - } |
|
281 | - /** |
|
282 | - * Retrieves stored watches. |
|
283 | - * |
|
284 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html |
|
285 | - * |
|
286 | - * @param array{ |
|
287 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
288 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
289 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
290 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
291 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
292 | - * body: array, // From, size, query, sort and search_after |
|
293 | - * } $params |
|
294 | - * |
|
295 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
296 | - * @throws ClientResponseException if the status code of response is 4xx |
|
297 | - * @throws ServerResponseException if the status code of response is 5xx |
|
298 | - * |
|
299 | - * @return Elasticsearch|Promise |
|
300 | - */ |
|
301 | - public function queryWatches(array $params = []) |
|
302 | - { |
|
303 | - $url = '/_watcher/_query/watches'; |
|
304 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
305 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
306 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
307 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
308 | - } |
|
309 | - /** |
|
310 | - * Starts Watcher if it is not already running. |
|
311 | - * |
|
312 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html |
|
313 | - * |
|
314 | - * @param array{ |
|
315 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
316 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
317 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
318 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
319 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
320 | - * } $params |
|
321 | - * |
|
322 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
323 | - * @throws ClientResponseException if the status code of response is 4xx |
|
324 | - * @throws ServerResponseException if the status code of response is 5xx |
|
325 | - * |
|
326 | - * @return Elasticsearch|Promise |
|
327 | - */ |
|
328 | - public function start(array $params = []) |
|
329 | - { |
|
330 | - $url = '/_watcher/_start'; |
|
331 | - $method = 'POST'; |
|
332 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
333 | - $headers = ['Accept' => 'application/json']; |
|
334 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
335 | - } |
|
336 | - /** |
|
337 | - * Retrieves the current Watcher metrics. |
|
338 | - * |
|
339 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html |
|
340 | - * |
|
341 | - * @param array{ |
|
342 | - * metric: list, // Controls what additional stat metrics should be include in the response |
|
343 | - * emit_stacktraces: boolean, // Emits stack traces of currently running watches |
|
344 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
345 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
346 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
347 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
348 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
349 | - * } $params |
|
350 | - * |
|
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 stats(array $params = []) |
|
358 | - { |
|
359 | - if (isset($params['metric'])) { |
|
360 | - $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
361 | - $method = 'GET'; |
|
362 | - } else { |
|
363 | - $url = '/_watcher/stats'; |
|
364 | - $method = 'GET'; |
|
365 | - } |
|
366 | - $url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
367 | - $headers = ['Accept' => 'application/json']; |
|
368 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
369 | - } |
|
370 | - /** |
|
371 | - * Stops Watcher if it is running. |
|
372 | - * |
|
373 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html |
|
374 | - * |
|
375 | - * @param array{ |
|
376 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
377 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
378 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
379 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
380 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
381 | - * } $params |
|
382 | - * |
|
383 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
384 | - * @throws ClientResponseException if the status code of response is 4xx |
|
385 | - * @throws ServerResponseException if the status code of response is 5xx |
|
386 | - * |
|
387 | - * @return Elasticsearch|Promise |
|
388 | - */ |
|
389 | - public function stop(array $params = []) |
|
390 | - { |
|
391 | - $url = '/_watcher/_stop'; |
|
392 | - $method = 'POST'; |
|
393 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | - $headers = ['Accept' => 'application/json']; |
|
395 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
396 | - } |
|
397 | - /** |
|
398 | - * Update settings for the watcher system index |
|
399 | - * |
|
400 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html |
|
401 | - * |
|
402 | - * @param array{ |
|
403 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
404 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
405 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
406 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
407 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
408 | - * body: array, // (REQUIRED) An object with the new index settings |
|
409 | - * } $params |
|
410 | - * |
|
411 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
412 | - * @throws ClientResponseException if the status code of response is 4xx |
|
413 | - * @throws ServerResponseException if the status code of response is 5xx |
|
414 | - * |
|
415 | - * @return Elasticsearch|Promise |
|
416 | - */ |
|
417 | - public function updateSettings(array $params = []) |
|
418 | - { |
|
419 | - $this->checkRequiredParameters(['body'], $params); |
|
420 | - $url = '/_watcher/settings'; |
|
421 | - $method = 'PUT'; |
|
422 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
423 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
424 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
425 | - } |
|
28 | + /** |
|
29 | + * Acknowledges a watch, manually throttling the execution of the watch's actions. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * watch_id: string, // (REQUIRED) Watch ID |
|
35 | + * action_id: list, // A comma-separated list of the action ids to be acked |
|
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 ackWatch(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
53 | + if (isset($params['action_id'])) { |
|
54 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
55 | + $method = 'PUT'; |
|
56 | + } else { |
|
57 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
58 | + $method = 'PUT'; |
|
59 | + } |
|
60 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
61 | + $headers = ['Accept' => 'application/json']; |
|
62 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
63 | + } |
|
64 | + /** |
|
65 | + * Activates a currently inactive watch. |
|
66 | + * |
|
67 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html |
|
68 | + * |
|
69 | + * @param array{ |
|
70 | + * watch_id: string, // (REQUIRED) Watch ID |
|
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 activateWatch(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
88 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
89 | + $method = 'PUT'; |
|
90 | + $url = $this->addQueryString($url, $params, ['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 | + * Deactivates a currently active watch. |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html |
|
98 | + * |
|
99 | + * @param array{ |
|
100 | + * watch_id: string, // (REQUIRED) Watch ID |
|
101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | + * } $params |
|
107 | + * |
|
108 | + * @throws MissingParameterException if a required parameter is missing |
|
109 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | + * @throws ClientResponseException if the status code of response is 4xx |
|
111 | + * @throws ServerResponseException if the status code of response is 5xx |
|
112 | + * |
|
113 | + * @return Elasticsearch|Promise |
|
114 | + */ |
|
115 | + public function deactivateWatch(array $params = []) |
|
116 | + { |
|
117 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
118 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
119 | + $method = 'PUT'; |
|
120 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | + $headers = ['Accept' => 'application/json']; |
|
122 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
123 | + } |
|
124 | + /** |
|
125 | + * Removes a watch from Watcher. |
|
126 | + * |
|
127 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html |
|
128 | + * |
|
129 | + * @param array{ |
|
130 | + * id: string, // (REQUIRED) Watch ID |
|
131 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
132 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
133 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
134 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
135 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 deleteWatch(array $params = []) |
|
146 | + { |
|
147 | + $this->checkRequiredParameters(['id'], $params); |
|
148 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
149 | + $method = 'DELETE'; |
|
150 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | + $headers = ['Accept' => 'application/json']; |
|
152 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
153 | + } |
|
154 | + /** |
|
155 | + * Forces the execution of a stored watch. |
|
156 | + * |
|
157 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html |
|
158 | + * |
|
159 | + * @param array{ |
|
160 | + * id: string, // Watch ID |
|
161 | + * debug: boolean, // indicates whether the watch should execute in debug mode |
|
162 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | + * body: array, // Execution control |
|
168 | + * } $params |
|
169 | + * |
|
170 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
171 | + * @throws ClientResponseException if the status code of response is 4xx |
|
172 | + * @throws ServerResponseException if the status code of response is 5xx |
|
173 | + * |
|
174 | + * @return Elasticsearch|Promise |
|
175 | + */ |
|
176 | + public function executeWatch(array $params = []) |
|
177 | + { |
|
178 | + if (isset($params['id'])) { |
|
179 | + $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
180 | + $method = 'PUT'; |
|
181 | + } else { |
|
182 | + $url = '/_watcher/watch/_execute'; |
|
183 | + $method = 'PUT'; |
|
184 | + } |
|
185 | + $url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
187 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
188 | + } |
|
189 | + /** |
|
190 | + * Retrieve settings for the watcher system index |
|
191 | + * |
|
192 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html |
|
193 | + * |
|
194 | + * @param array{ |
|
195 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
196 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
197 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
198 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
199 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
200 | + * } $params |
|
201 | + * |
|
202 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
203 | + * @throws ClientResponseException if the status code of response is 4xx |
|
204 | + * @throws ServerResponseException if the status code of response is 5xx |
|
205 | + * |
|
206 | + * @return Elasticsearch|Promise |
|
207 | + */ |
|
208 | + public function getSettings(array $params = []) |
|
209 | + { |
|
210 | + $url = '/_watcher/settings'; |
|
211 | + $method = 'GET'; |
|
212 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
213 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
214 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
215 | + } |
|
216 | + /** |
|
217 | + * Retrieves a watch by its ID. |
|
218 | + * |
|
219 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html |
|
220 | + * |
|
221 | + * @param array{ |
|
222 | + * id: string, // (REQUIRED) Watch ID |
|
223 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | + * } $params |
|
229 | + * |
|
230 | + * @throws MissingParameterException if a required parameter is missing |
|
231 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
232 | + * @throws ClientResponseException if the status code of response is 4xx |
|
233 | + * @throws ServerResponseException if the status code of response is 5xx |
|
234 | + * |
|
235 | + * @return Elasticsearch|Promise |
|
236 | + */ |
|
237 | + public function getWatch(array $params = []) |
|
238 | + { |
|
239 | + $this->checkRequiredParameters(['id'], $params); |
|
240 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
241 | + $method = 'GET'; |
|
242 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
243 | + $headers = ['Accept' => 'application/json']; |
|
244 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
245 | + } |
|
246 | + /** |
|
247 | + * Creates a new watch, or updates an existing one. |
|
248 | + * |
|
249 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html |
|
250 | + * |
|
251 | + * @param array{ |
|
252 | + * id: string, // (REQUIRED) Watch ID |
|
253 | + * active: boolean, // Specify whether the watch is in/active by default |
|
254 | + * version: number, // Explicit version number for concurrency control |
|
255 | + * if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number |
|
256 | + * if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term |
|
257 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
258 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
259 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
260 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
261 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
262 | + * body: array, // The watch |
|
263 | + * } $params |
|
264 | + * |
|
265 | + * @throws MissingParameterException if a required parameter is missing |
|
266 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
267 | + * @throws ClientResponseException if the status code of response is 4xx |
|
268 | + * @throws ServerResponseException if the status code of response is 5xx |
|
269 | + * |
|
270 | + * @return Elasticsearch|Promise |
|
271 | + */ |
|
272 | + public function putWatch(array $params = []) |
|
273 | + { |
|
274 | + $this->checkRequiredParameters(['id'], $params); |
|
275 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
276 | + $method = 'PUT'; |
|
277 | + $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
278 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
279 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
280 | + } |
|
281 | + /** |
|
282 | + * Retrieves stored watches. |
|
283 | + * |
|
284 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html |
|
285 | + * |
|
286 | + * @param array{ |
|
287 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
288 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
289 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
290 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
291 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
292 | + * body: array, // From, size, query, sort and search_after |
|
293 | + * } $params |
|
294 | + * |
|
295 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
296 | + * @throws ClientResponseException if the status code of response is 4xx |
|
297 | + * @throws ServerResponseException if the status code of response is 5xx |
|
298 | + * |
|
299 | + * @return Elasticsearch|Promise |
|
300 | + */ |
|
301 | + public function queryWatches(array $params = []) |
|
302 | + { |
|
303 | + $url = '/_watcher/_query/watches'; |
|
304 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
305 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
306 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
307 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
308 | + } |
|
309 | + /** |
|
310 | + * Starts Watcher if it is not already running. |
|
311 | + * |
|
312 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html |
|
313 | + * |
|
314 | + * @param array{ |
|
315 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
316 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
317 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
318 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
319 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
320 | + * } $params |
|
321 | + * |
|
322 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
323 | + * @throws ClientResponseException if the status code of response is 4xx |
|
324 | + * @throws ServerResponseException if the status code of response is 5xx |
|
325 | + * |
|
326 | + * @return Elasticsearch|Promise |
|
327 | + */ |
|
328 | + public function start(array $params = []) |
|
329 | + { |
|
330 | + $url = '/_watcher/_start'; |
|
331 | + $method = 'POST'; |
|
332 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
333 | + $headers = ['Accept' => 'application/json']; |
|
334 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
335 | + } |
|
336 | + /** |
|
337 | + * Retrieves the current Watcher metrics. |
|
338 | + * |
|
339 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html |
|
340 | + * |
|
341 | + * @param array{ |
|
342 | + * metric: list, // Controls what additional stat metrics should be include in the response |
|
343 | + * emit_stacktraces: boolean, // Emits stack traces of currently running watches |
|
344 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
345 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
346 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
347 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
348 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
349 | + * } $params |
|
350 | + * |
|
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 stats(array $params = []) |
|
358 | + { |
|
359 | + if (isset($params['metric'])) { |
|
360 | + $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
361 | + $method = 'GET'; |
|
362 | + } else { |
|
363 | + $url = '/_watcher/stats'; |
|
364 | + $method = 'GET'; |
|
365 | + } |
|
366 | + $url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
367 | + $headers = ['Accept' => 'application/json']; |
|
368 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
369 | + } |
|
370 | + /** |
|
371 | + * Stops Watcher if it is running. |
|
372 | + * |
|
373 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html |
|
374 | + * |
|
375 | + * @param array{ |
|
376 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
377 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
378 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
379 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
380 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
381 | + * } $params |
|
382 | + * |
|
383 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
384 | + * @throws ClientResponseException if the status code of response is 4xx |
|
385 | + * @throws ServerResponseException if the status code of response is 5xx |
|
386 | + * |
|
387 | + * @return Elasticsearch|Promise |
|
388 | + */ |
|
389 | + public function stop(array $params = []) |
|
390 | + { |
|
391 | + $url = '/_watcher/_stop'; |
|
392 | + $method = 'POST'; |
|
393 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | + $headers = ['Accept' => 'application/json']; |
|
395 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
396 | + } |
|
397 | + /** |
|
398 | + * Update settings for the watcher system index |
|
399 | + * |
|
400 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html |
|
401 | + * |
|
402 | + * @param array{ |
|
403 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
404 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
405 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
406 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
407 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
408 | + * body: array, // (REQUIRED) An object with the new index settings |
|
409 | + * } $params |
|
410 | + * |
|
411 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
412 | + * @throws ClientResponseException if the status code of response is 4xx |
|
413 | + * @throws ServerResponseException if the status code of response is 5xx |
|
414 | + * |
|
415 | + * @return Elasticsearch|Promise |
|
416 | + */ |
|
417 | + public function updateSettings(array $params = []) |
|
418 | + { |
|
419 | + $this->checkRequiredParameters(['body'], $params); |
|
420 | + $url = '/_watcher/settings'; |
|
421 | + $method = 'PUT'; |
|
422 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
423 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
424 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
425 | + } |
|
426 | 426 | } |
@@ -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; |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['watch_id'], $params); |
53 | 53 | if (isset($params['action_id'])) { |
54 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
54 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack/'.$this->encode($params['action_id']); |
|
55 | 55 | $method = 'PUT'; |
56 | 56 | } else { |
57 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
57 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack'; |
|
58 | 58 | $method = 'PUT'; |
59 | 59 | } |
60 | 60 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function activateWatch(array $params = []) |
86 | 86 | { |
87 | 87 | $this->checkRequiredParameters(['watch_id'], $params); |
88 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
88 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_activate'; |
|
89 | 89 | $method = 'PUT'; |
90 | 90 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
91 | 91 | $headers = ['Accept' => 'application/json']; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function deactivateWatch(array $params = []) |
116 | 116 | { |
117 | 117 | $this->checkRequiredParameters(['watch_id'], $params); |
118 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
118 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_deactivate'; |
|
119 | 119 | $method = 'PUT'; |
120 | 120 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
121 | 121 | $headers = ['Accept' => 'application/json']; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function deleteWatch(array $params = []) |
146 | 146 | { |
147 | 147 | $this->checkRequiredParameters(['id'], $params); |
148 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
148 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
149 | 149 | $method = 'DELETE'; |
150 | 150 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
151 | 151 | $headers = ['Accept' => 'application/json']; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | public function executeWatch(array $params = []) |
177 | 177 | { |
178 | 178 | if (isset($params['id'])) { |
179 | - $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
179 | + $url = '/_watcher/watch/'.$this->encode($params['id']).'/_execute'; |
|
180 | 180 | $method = 'PUT'; |
181 | 181 | } else { |
182 | 182 | $url = '/_watcher/watch/_execute'; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public function getWatch(array $params = []) |
238 | 238 | { |
239 | 239 | $this->checkRequiredParameters(['id'], $params); |
240 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
240 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
241 | 241 | $method = 'GET'; |
242 | 242 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
243 | 243 | $headers = ['Accept' => 'application/json']; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | public function putWatch(array $params = []) |
273 | 273 | { |
274 | 274 | $this->checkRequiredParameters(['id'], $params); |
275 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
275 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
276 | 276 | $method = 'PUT'; |
277 | 277 | $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
278 | 278 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | public function stats(array $params = []) |
358 | 358 | { |
359 | 359 | if (isset($params['metric'])) { |
360 | - $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
360 | + $url = '/_watcher/stats/'.$this->encode($params['metric']); |
|
361 | 361 | $method = 'GET'; |
362 | 362 | } else { |
363 | 363 | $url = '/_watcher/stats'; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Watcher extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Watcher extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Acknowledges a watch, manually throttling the execution of the watch's actions. |
30 | 29 | * |