@@ -25,33 +25,33 @@ |
||
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 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
54 | - $request = $this->addOtelAttributes($params, [], $request, 'ssl.certificates'); |
|
55 | - return $this->client->sendRequest($request); |
|
56 | - } |
|
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 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
54 | + $request = $this->addOtelAttributes($params, [], $request, 'ssl.certificates'); |
|
55 | + return $this->client->sendRequest($request); |
|
56 | + } |
|
57 | 57 | } |
@@ -25,105 +25,105 @@ |
||
25 | 25 | */ |
26 | 26 | class Shutdown extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * node_id: string, // (REQUIRED) The node id of node to be removed from the shutdown state |
|
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 deleteNode(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['node_id'], $params); |
|
52 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.delete_node'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * node_id: string, // Which node for which to retrieve the shutdown status |
|
67 | - * master_timeout: time, // Timeout for processing on master node |
|
68 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | - * } $params |
|
74 | - * |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function getNode(array $params = []) |
|
82 | - { |
|
83 | - if (isset($params['node_id'])) { |
|
84 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
85 | - $method = 'GET'; |
|
86 | - } else { |
|
87 | - $url = '/_nodes/shutdown'; |
|
88 | - $method = 'GET'; |
|
89 | - } |
|
90 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
92 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
93 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.get_node'); |
|
94 | - return $this->client->sendRequest($request); |
|
95 | - } |
|
96 | - /** |
|
97 | - * Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
98 | - * |
|
99 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
100 | - * |
|
101 | - * @param array{ |
|
102 | - * node_id: string, // (REQUIRED) The node id of node to be shut down |
|
103 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | - * body: array, // (REQUIRED) The shutdown type definition to register |
|
109 | - * } $params |
|
110 | - * |
|
111 | - * @throws MissingParameterException if a required parameter is missing |
|
112 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | - * @throws ClientResponseException if the status code of response is 4xx |
|
114 | - * @throws ServerResponseException if the status code of response is 5xx |
|
115 | - * |
|
116 | - * @return Elasticsearch|Promise |
|
117 | - */ |
|
118 | - public function putNode(array $params = []) |
|
119 | - { |
|
120 | - $this->checkRequiredParameters(['node_id', 'body'], $params); |
|
121 | - $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
122 | - $method = 'PUT'; |
|
123 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
125 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.put_node'); |
|
127 | - return $this->client->sendRequest($request); |
|
128 | - } |
|
28 | + /** |
|
29 | + * Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * node_id: string, // (REQUIRED) The node id of node to be removed from the shutdown state |
|
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 deleteNode(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['node_id'], $params); |
|
52 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.delete_node'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * node_id: string, // Which node for which to retrieve the shutdown status |
|
67 | + * master_timeout: time, // Timeout for processing on master node |
|
68 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | + * } $params |
|
74 | + * |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function getNode(array $params = []) |
|
82 | + { |
|
83 | + if (isset($params['node_id'])) { |
|
84 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
85 | + $method = 'GET'; |
|
86 | + } else { |
|
87 | + $url = '/_nodes/shutdown'; |
|
88 | + $method = 'GET'; |
|
89 | + } |
|
90 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
92 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
93 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.get_node'); |
|
94 | + return $this->client->sendRequest($request); |
|
95 | + } |
|
96 | + /** |
|
97 | + * Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
98 | + * |
|
99 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current |
|
100 | + * |
|
101 | + * @param array{ |
|
102 | + * node_id: string, // (REQUIRED) The node id of node to be shut down |
|
103 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | + * body: array, // (REQUIRED) The shutdown type definition to register |
|
109 | + * } $params |
|
110 | + * |
|
111 | + * @throws MissingParameterException if a required parameter is missing |
|
112 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | + * @throws ClientResponseException if the status code of response is 4xx |
|
114 | + * @throws ServerResponseException if the status code of response is 5xx |
|
115 | + * |
|
116 | + * @return Elasticsearch|Promise |
|
117 | + */ |
|
118 | + public function putNode(array $params = []) |
|
119 | + { |
|
120 | + $this->checkRequiredParameters(['node_id', 'body'], $params); |
|
121 | + $url = '/_nodes/' . $this->encode($params['node_id']) . '/shutdown'; |
|
122 | + $method = 'PUT'; |
|
123 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
125 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'shutdown.put_node'); |
|
127 | + return $this->client->sendRequest($request); |
|
128 | + } |
|
129 | 129 | } |
@@ -25,171 +25,171 @@ |
||
25 | 25 | */ |
26 | 26 | class Enrich extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an existing enrich policy and its enrich index. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
35 | - * master_timeout: time, // Timeout for processing on master node |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws MissingParameterException if a required parameter is missing |
|
44 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | - * @throws ClientResponseException if the status code of response is 4xx |
|
46 | - * @throws ServerResponseException if the status code of response is 5xx |
|
47 | - * |
|
48 | - * @return Elasticsearch|Promise |
|
49 | - */ |
|
50 | - public function deletePolicy(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['name'], $params); |
|
53 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
54 | - $method = 'DELETE'; |
|
55 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | - $headers = ['Accept' => 'application/json']; |
|
57 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.delete_policy'); |
|
59 | - return $this->client->sendRequest($request); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Creates the enrich index for an existing enrich policy. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
68 | - * wait_for_completion: boolean, // Should the request should block until the execution is complete. |
|
69 | - * master_timeout: time, // Timeout for processing on master node |
|
70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | - * } $params |
|
76 | - * |
|
77 | - * @throws MissingParameterException if a required parameter is missing |
|
78 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
79 | - * @throws ClientResponseException if the status code of response is 4xx |
|
80 | - * @throws ServerResponseException if the status code of response is 5xx |
|
81 | - * |
|
82 | - * @return Elasticsearch|Promise |
|
83 | - */ |
|
84 | - public function executePolicy(array $params = []) |
|
85 | - { |
|
86 | - $this->checkRequiredParameters(['name'], $params); |
|
87 | - $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
88 | - $method = 'PUT'; |
|
89 | - $url = $this->addQueryString($url, $params, ['wait_for_completion', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
90 | - $headers = ['Accept' => 'application/json']; |
|
91 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
92 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.execute_policy'); |
|
93 | - return $this->client->sendRequest($request); |
|
94 | - } |
|
95 | - /** |
|
96 | - * Gets information about an enrich policy. |
|
97 | - * |
|
98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html |
|
99 | - * |
|
100 | - * @param array{ |
|
101 | - * name: list, // A comma-separated list of enrich policy names |
|
102 | - * master_timeout: time, // Timeout for processing on master node |
|
103 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | - * } $params |
|
109 | - * |
|
110 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | - * @throws ClientResponseException if the status code of response is 4xx |
|
112 | - * @throws ServerResponseException if the status code of response is 5xx |
|
113 | - * |
|
114 | - * @return Elasticsearch|Promise |
|
115 | - */ |
|
116 | - public function getPolicy(array $params = []) |
|
117 | - { |
|
118 | - if (isset($params['name'])) { |
|
119 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
120 | - $method = 'GET'; |
|
121 | - } else { |
|
122 | - $url = '/_enrich/policy'; |
|
123 | - $method = 'GET'; |
|
124 | - } |
|
125 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | - $headers = ['Accept' => 'application/json']; |
|
127 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.get_policy'); |
|
129 | - return $this->client->sendRequest($request); |
|
130 | - } |
|
131 | - /** |
|
132 | - * Creates a new enrich policy. |
|
133 | - * |
|
134 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html |
|
135 | - * |
|
136 | - * @param array{ |
|
137 | - * name: string, // (REQUIRED) The name of the enrich policy |
|
138 | - * master_timeout: time, // Timeout for processing on master node |
|
139 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
140 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
141 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
142 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
143 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
144 | - * body: array, // (REQUIRED) The enrich policy to register |
|
145 | - * } $params |
|
146 | - * |
|
147 | - * @throws MissingParameterException if a required parameter is missing |
|
148 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | - * @throws ClientResponseException if the status code of response is 4xx |
|
150 | - * @throws ServerResponseException if the status code of response is 5xx |
|
151 | - * |
|
152 | - * @return Elasticsearch|Promise |
|
153 | - */ |
|
154 | - public function putPolicy(array $params = []) |
|
155 | - { |
|
156 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
157 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
158 | - $method = 'PUT'; |
|
159 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
160 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
161 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
162 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.put_policy'); |
|
163 | - return $this->client->sendRequest($request); |
|
164 | - } |
|
165 | - /** |
|
166 | - * Gets enrich coordinator statistics and information about enrich policies that are currently executing. |
|
167 | - * |
|
168 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html |
|
169 | - * |
|
170 | - * @param array{ |
|
171 | - * master_timeout: time, // Timeout for processing on master node |
|
172 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
173 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
174 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
175 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
176 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
177 | - * } $params |
|
178 | - * |
|
179 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | - * @throws ClientResponseException if the status code of response is 4xx |
|
181 | - * @throws ServerResponseException if the status code of response is 5xx |
|
182 | - * |
|
183 | - * @return Elasticsearch|Promise |
|
184 | - */ |
|
185 | - public function stats(array $params = []) |
|
186 | - { |
|
187 | - $url = '/_enrich/_stats'; |
|
188 | - $method = 'GET'; |
|
189 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | - $headers = ['Accept' => 'application/json']; |
|
191 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | - $request = $this->addOtelAttributes($params, [], $request, 'enrich.stats'); |
|
193 | - return $this->client->sendRequest($request); |
|
194 | - } |
|
28 | + /** |
|
29 | + * Deletes an existing enrich policy and its enrich index. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
35 | + * master_timeout: time, // Timeout for processing on master node |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws MissingParameterException if a required parameter is missing |
|
44 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | + * @throws ClientResponseException if the status code of response is 4xx |
|
46 | + * @throws ServerResponseException if the status code of response is 5xx |
|
47 | + * |
|
48 | + * @return Elasticsearch|Promise |
|
49 | + */ |
|
50 | + public function deletePolicy(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['name'], $params); |
|
53 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
54 | + $method = 'DELETE'; |
|
55 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | + $headers = ['Accept' => 'application/json']; |
|
57 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.delete_policy'); |
|
59 | + return $this->client->sendRequest($request); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Creates the enrich index for an existing enrich policy. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
68 | + * wait_for_completion: boolean, // Should the request should block until the execution is complete. |
|
69 | + * master_timeout: time, // Timeout for processing on master node |
|
70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | + * } $params |
|
76 | + * |
|
77 | + * @throws MissingParameterException if a required parameter is missing |
|
78 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
79 | + * @throws ClientResponseException if the status code of response is 4xx |
|
80 | + * @throws ServerResponseException if the status code of response is 5xx |
|
81 | + * |
|
82 | + * @return Elasticsearch|Promise |
|
83 | + */ |
|
84 | + public function executePolicy(array $params = []) |
|
85 | + { |
|
86 | + $this->checkRequiredParameters(['name'], $params); |
|
87 | + $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
88 | + $method = 'PUT'; |
|
89 | + $url = $this->addQueryString($url, $params, ['wait_for_completion', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
90 | + $headers = ['Accept' => 'application/json']; |
|
91 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
92 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.execute_policy'); |
|
93 | + return $this->client->sendRequest($request); |
|
94 | + } |
|
95 | + /** |
|
96 | + * Gets information about an enrich policy. |
|
97 | + * |
|
98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html |
|
99 | + * |
|
100 | + * @param array{ |
|
101 | + * name: list, // A comma-separated list of enrich policy names |
|
102 | + * master_timeout: time, // Timeout for processing on master node |
|
103 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | + * } $params |
|
109 | + * |
|
110 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | + * @throws ClientResponseException if the status code of response is 4xx |
|
112 | + * @throws ServerResponseException if the status code of response is 5xx |
|
113 | + * |
|
114 | + * @return Elasticsearch|Promise |
|
115 | + */ |
|
116 | + public function getPolicy(array $params = []) |
|
117 | + { |
|
118 | + if (isset($params['name'])) { |
|
119 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
120 | + $method = 'GET'; |
|
121 | + } else { |
|
122 | + $url = '/_enrich/policy'; |
|
123 | + $method = 'GET'; |
|
124 | + } |
|
125 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | + $headers = ['Accept' => 'application/json']; |
|
127 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.get_policy'); |
|
129 | + return $this->client->sendRequest($request); |
|
130 | + } |
|
131 | + /** |
|
132 | + * Creates a new enrich policy. |
|
133 | + * |
|
134 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html |
|
135 | + * |
|
136 | + * @param array{ |
|
137 | + * name: string, // (REQUIRED) The name of the enrich policy |
|
138 | + * master_timeout: time, // Timeout for processing on master node |
|
139 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
140 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
141 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
142 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
143 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
144 | + * body: array, // (REQUIRED) The enrich policy to register |
|
145 | + * } $params |
|
146 | + * |
|
147 | + * @throws MissingParameterException if a required parameter is missing |
|
148 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
149 | + * @throws ClientResponseException if the status code of response is 4xx |
|
150 | + * @throws ServerResponseException if the status code of response is 5xx |
|
151 | + * |
|
152 | + * @return Elasticsearch|Promise |
|
153 | + */ |
|
154 | + public function putPolicy(array $params = []) |
|
155 | + { |
|
156 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
157 | + $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
158 | + $method = 'PUT'; |
|
159 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
160 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
161 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
162 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'enrich.put_policy'); |
|
163 | + return $this->client->sendRequest($request); |
|
164 | + } |
|
165 | + /** |
|
166 | + * Gets enrich coordinator statistics and information about enrich policies that are currently executing. |
|
167 | + * |
|
168 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html |
|
169 | + * |
|
170 | + * @param array{ |
|
171 | + * master_timeout: time, // Timeout for processing on master node |
|
172 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
173 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
174 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
175 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
176 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
177 | + * } $params |
|
178 | + * |
|
179 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | + * @throws ClientResponseException if the status code of response is 4xx |
|
181 | + * @throws ServerResponseException if the status code of response is 5xx |
|
182 | + * |
|
183 | + * @return Elasticsearch|Promise |
|
184 | + */ |
|
185 | + public function stats(array $params = []) |
|
186 | + { |
|
187 | + $url = '/_enrich/_stats'; |
|
188 | + $method = 'GET'; |
|
189 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
190 | + $headers = ['Accept' => 'application/json']; |
|
191 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
192 | + $request = $this->addOtelAttributes($params, [], $request, 'enrich.stats'); |
|
193 | + return $this->client->sendRequest($request); |
|
194 | + } |
|
195 | 195 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function deletePolicy(array $params = []) |
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['name'], $params); |
53 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
53 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
54 | 54 | $method = 'DELETE'; |
55 | 55 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function executePolicy(array $params = []) |
85 | 85 | { |
86 | 86 | $this->checkRequiredParameters(['name'], $params); |
87 | - $url = '/_enrich/policy/' . $this->encode($params['name']) . '/_execute'; |
|
87 | + $url = '/_enrich/policy/'.$this->encode($params['name']).'/_execute'; |
|
88 | 88 | $method = 'PUT'; |
89 | 89 | $url = $this->addQueryString($url, $params, ['wait_for_completion', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
90 | 90 | $headers = ['Accept' => 'application/json']; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function getPolicy(array $params = []) |
117 | 117 | { |
118 | 118 | if (isset($params['name'])) { |
119 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
119 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
120 | 120 | $method = 'GET'; |
121 | 121 | } else { |
122 | 122 | $url = '/_enrich/policy'; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | public function putPolicy(array $params = []) |
155 | 155 | { |
156 | 156 | $this->checkRequiredParameters(['name', 'body'], $params); |
157 | - $url = '/_enrich/policy/' . $this->encode($params['name']); |
|
157 | + $url = '/_enrich/policy/'.$this->encode($params['name']); |
|
158 | 158 | $method = 'PUT'; |
159 | 159 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
160 | 160 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -25,198 +25,198 @@ |
||
25 | 25 | */ |
26 | 26 | class Sql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Clears the SQL cursor |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | - * body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
45 | - * |
|
46 | - * @return Elasticsearch|Promise |
|
47 | - */ |
|
48 | - public function clearCursor(array $params = []) |
|
49 | - { |
|
50 | - $this->checkRequiredParameters(['body'], $params); |
|
51 | - $url = '/_sql/close'; |
|
52 | - $method = 'POST'; |
|
53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | - $request = $this->addOtelAttributes($params, [], $request, 'sql.clear_cursor'); |
|
57 | - return $this->client->sendRequest($request); |
|
58 | - } |
|
59 | - /** |
|
60 | - * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. |
|
61 | - * |
|
62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html |
|
63 | - * |
|
64 | - * @param array{ |
|
65 | - * id: string, // (REQUIRED) The async search ID |
|
66 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
67 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
68 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
69 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
70 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
71 | - * } $params |
|
72 | - * |
|
73 | - * @throws MissingParameterException if a required parameter is missing |
|
74 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | - * @throws ClientResponseException if the status code of response is 4xx |
|
76 | - * @throws ServerResponseException if the status code of response is 5xx |
|
77 | - * |
|
78 | - * @return Elasticsearch|Promise |
|
79 | - */ |
|
80 | - public function deleteAsync(array $params = []) |
|
81 | - { |
|
82 | - $this->checkRequiredParameters(['id'], $params); |
|
83 | - $url = '/_sql/async/delete/' . $this->encode($params['id']); |
|
84 | - $method = 'DELETE'; |
|
85 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
86 | - $headers = ['Accept' => 'application/json']; |
|
87 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
88 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.delete_async'); |
|
89 | - return $this->client->sendRequest($request); |
|
90 | - } |
|
91 | - /** |
|
92 | - * Returns the current status and available results for an async SQL search or stored synchronous SQL search |
|
93 | - * |
|
94 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html |
|
95 | - * |
|
96 | - * @param array{ |
|
97 | - * id: string, // (REQUIRED) The async search ID |
|
98 | - * delimiter: string, // Separator for CSV results |
|
99 | - * format: string, // Short version of the Accept header, e.g. json, yaml |
|
100 | - * keep_alive: time, // Retention period for the search and its results |
|
101 | - * wait_for_completion_timeout: time, // Duration to wait for complete results |
|
102 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | - * } $params |
|
108 | - * |
|
109 | - * @throws MissingParameterException if a required parameter is missing |
|
110 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | - * @throws ClientResponseException if the status code of response is 4xx |
|
112 | - * @throws ServerResponseException if the status code of response is 5xx |
|
113 | - * |
|
114 | - * @return Elasticsearch|Promise |
|
115 | - */ |
|
116 | - public function getAsync(array $params = []) |
|
117 | - { |
|
118 | - $this->checkRequiredParameters(['id'], $params); |
|
119 | - $url = '/_sql/async/' . $this->encode($params['id']); |
|
120 | - $method = 'GET'; |
|
121 | - $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
122 | - $headers = ['Accept' => 'application/json']; |
|
123 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
124 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async'); |
|
125 | - return $this->client->sendRequest($request); |
|
126 | - } |
|
127 | - /** |
|
128 | - * Returns the current status of an async SQL search or a stored synchronous SQL search |
|
129 | - * |
|
130 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html |
|
131 | - * |
|
132 | - * @param array{ |
|
133 | - * id: string, // (REQUIRED) The async search ID |
|
134 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
135 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
136 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
137 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
138 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
139 | - * } $params |
|
140 | - * |
|
141 | - * @throws MissingParameterException if a required parameter is missing |
|
142 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
143 | - * @throws ClientResponseException if the status code of response is 4xx |
|
144 | - * @throws ServerResponseException if the status code of response is 5xx |
|
145 | - * |
|
146 | - * @return Elasticsearch|Promise |
|
147 | - */ |
|
148 | - public function getAsyncStatus(array $params = []) |
|
149 | - { |
|
150 | - $this->checkRequiredParameters(['id'], $params); |
|
151 | - $url = '/_sql/async/status/' . $this->encode($params['id']); |
|
152 | - $method = 'GET'; |
|
153 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
154 | - $headers = ['Accept' => 'application/json']; |
|
155 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
156 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async_status'); |
|
157 | - return $this->client->sendRequest($request); |
|
158 | - } |
|
159 | - /** |
|
160 | - * Executes a SQL request |
|
161 | - * |
|
162 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html |
|
163 | - * |
|
164 | - * @param array{ |
|
165 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
166 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
167 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
168 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
169 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
170 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
171 | - * body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query. |
|
172 | - * } $params |
|
173 | - * |
|
174 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
175 | - * @throws ClientResponseException if the status code of response is 4xx |
|
176 | - * @throws ServerResponseException if the status code of response is 5xx |
|
177 | - * |
|
178 | - * @return Elasticsearch|Promise |
|
179 | - */ |
|
180 | - public function query(array $params = []) |
|
181 | - { |
|
182 | - $this->checkRequiredParameters(['body'], $params); |
|
183 | - $url = '/_sql'; |
|
184 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
185 | - $url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
187 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
188 | - $request = $this->addOtelAttributes($params, [], $request, 'sql.query'); |
|
189 | - return $this->client->sendRequest($request); |
|
190 | - } |
|
191 | - /** |
|
192 | - * Translates SQL into Elasticsearch queries |
|
193 | - * |
|
194 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html |
|
195 | - * |
|
196 | - * @param array{ |
|
197 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
198 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
199 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
200 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
201 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
202 | - * body: array, // (REQUIRED) Specify the query in the `query` element. |
|
203 | - * } $params |
|
204 | - * |
|
205 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
206 | - * @throws ClientResponseException if the status code of response is 4xx |
|
207 | - * @throws ServerResponseException if the status code of response is 5xx |
|
208 | - * |
|
209 | - * @return Elasticsearch|Promise |
|
210 | - */ |
|
211 | - public function translate(array $params = []) |
|
212 | - { |
|
213 | - $this->checkRequiredParameters(['body'], $params); |
|
214 | - $url = '/_sql/translate'; |
|
215 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
216 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
217 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
218 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
219 | - $request = $this->addOtelAttributes($params, [], $request, 'sql.translate'); |
|
220 | - return $this->client->sendRequest($request); |
|
221 | - } |
|
28 | + /** |
|
29 | + * Clears the SQL cursor |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | + * body: array, // (REQUIRED) Specify the cursor value in the `cursor` element to clean the cursor. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
45 | + * |
|
46 | + * @return Elasticsearch|Promise |
|
47 | + */ |
|
48 | + public function clearCursor(array $params = []) |
|
49 | + { |
|
50 | + $this->checkRequiredParameters(['body'], $params); |
|
51 | + $url = '/_sql/close'; |
|
52 | + $method = 'POST'; |
|
53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | + $request = $this->addOtelAttributes($params, [], $request, 'sql.clear_cursor'); |
|
57 | + return $this->client->sendRequest($request); |
|
58 | + } |
|
59 | + /** |
|
60 | + * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. |
|
61 | + * |
|
62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html |
|
63 | + * |
|
64 | + * @param array{ |
|
65 | + * id: string, // (REQUIRED) The async search ID |
|
66 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
67 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
68 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
69 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
70 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
71 | + * } $params |
|
72 | + * |
|
73 | + * @throws MissingParameterException if a required parameter is missing |
|
74 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | + * @throws ClientResponseException if the status code of response is 4xx |
|
76 | + * @throws ServerResponseException if the status code of response is 5xx |
|
77 | + * |
|
78 | + * @return Elasticsearch|Promise |
|
79 | + */ |
|
80 | + public function deleteAsync(array $params = []) |
|
81 | + { |
|
82 | + $this->checkRequiredParameters(['id'], $params); |
|
83 | + $url = '/_sql/async/delete/' . $this->encode($params['id']); |
|
84 | + $method = 'DELETE'; |
|
85 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
86 | + $headers = ['Accept' => 'application/json']; |
|
87 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
88 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.delete_async'); |
|
89 | + return $this->client->sendRequest($request); |
|
90 | + } |
|
91 | + /** |
|
92 | + * Returns the current status and available results for an async SQL search or stored synchronous SQL search |
|
93 | + * |
|
94 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html |
|
95 | + * |
|
96 | + * @param array{ |
|
97 | + * id: string, // (REQUIRED) The async search ID |
|
98 | + * delimiter: string, // Separator for CSV results |
|
99 | + * format: string, // Short version of the Accept header, e.g. json, yaml |
|
100 | + * keep_alive: time, // Retention period for the search and its results |
|
101 | + * wait_for_completion_timeout: time, // Duration to wait for complete results |
|
102 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | + * } $params |
|
108 | + * |
|
109 | + * @throws MissingParameterException if a required parameter is missing |
|
110 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | + * @throws ClientResponseException if the status code of response is 4xx |
|
112 | + * @throws ServerResponseException if the status code of response is 5xx |
|
113 | + * |
|
114 | + * @return Elasticsearch|Promise |
|
115 | + */ |
|
116 | + public function getAsync(array $params = []) |
|
117 | + { |
|
118 | + $this->checkRequiredParameters(['id'], $params); |
|
119 | + $url = '/_sql/async/' . $this->encode($params['id']); |
|
120 | + $method = 'GET'; |
|
121 | + $url = $this->addQueryString($url, $params, ['delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
122 | + $headers = ['Accept' => 'application/json']; |
|
123 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
124 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async'); |
|
125 | + return $this->client->sendRequest($request); |
|
126 | + } |
|
127 | + /** |
|
128 | + * Returns the current status of an async SQL search or a stored synchronous SQL search |
|
129 | + * |
|
130 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html |
|
131 | + * |
|
132 | + * @param array{ |
|
133 | + * id: string, // (REQUIRED) The async search ID |
|
134 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
135 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
136 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
137 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
138 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
139 | + * } $params |
|
140 | + * |
|
141 | + * @throws MissingParameterException if a required parameter is missing |
|
142 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
143 | + * @throws ClientResponseException if the status code of response is 4xx |
|
144 | + * @throws ServerResponseException if the status code of response is 5xx |
|
145 | + * |
|
146 | + * @return Elasticsearch|Promise |
|
147 | + */ |
|
148 | + public function getAsyncStatus(array $params = []) |
|
149 | + { |
|
150 | + $this->checkRequiredParameters(['id'], $params); |
|
151 | + $url = '/_sql/async/status/' . $this->encode($params['id']); |
|
152 | + $method = 'GET'; |
|
153 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
154 | + $headers = ['Accept' => 'application/json']; |
|
155 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
156 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'sql.get_async_status'); |
|
157 | + return $this->client->sendRequest($request); |
|
158 | + } |
|
159 | + /** |
|
160 | + * Executes a SQL request |
|
161 | + * |
|
162 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html |
|
163 | + * |
|
164 | + * @param array{ |
|
165 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
166 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
167 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
168 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
169 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
170 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
171 | + * body: array, // (REQUIRED) Use the `query` element to start a query. Use the `cursor` element to continue a query. |
|
172 | + * } $params |
|
173 | + * |
|
174 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
175 | + * @throws ClientResponseException if the status code of response is 4xx |
|
176 | + * @throws ServerResponseException if the status code of response is 5xx |
|
177 | + * |
|
178 | + * @return Elasticsearch|Promise |
|
179 | + */ |
|
180 | + public function query(array $params = []) |
|
181 | + { |
|
182 | + $this->checkRequiredParameters(['body'], $params); |
|
183 | + $url = '/_sql'; |
|
184 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
185 | + $url = $this->addQueryString($url, $params, ['format', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
187 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
188 | + $request = $this->addOtelAttributes($params, [], $request, 'sql.query'); |
|
189 | + return $this->client->sendRequest($request); |
|
190 | + } |
|
191 | + /** |
|
192 | + * Translates SQL into Elasticsearch queries |
|
193 | + * |
|
194 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html |
|
195 | + * |
|
196 | + * @param array{ |
|
197 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
198 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
199 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
200 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
201 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
202 | + * body: array, // (REQUIRED) Specify the query in the `query` element. |
|
203 | + * } $params |
|
204 | + * |
|
205 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
206 | + * @throws ClientResponseException if the status code of response is 4xx |
|
207 | + * @throws ServerResponseException if the status code of response is 5xx |
|
208 | + * |
|
209 | + * @return Elasticsearch|Promise |
|
210 | + */ |
|
211 | + public function translate(array $params = []) |
|
212 | + { |
|
213 | + $this->checkRequiredParameters(['body'], $params); |
|
214 | + $url = '/_sql/translate'; |
|
215 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
216 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
217 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
218 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
219 | + $request = $this->addOtelAttributes($params, [], $request, 'sql.translate'); |
|
220 | + return $this->client->sendRequest($request); |
|
221 | + } |
|
222 | 222 | } |
@@ -25,138 +25,138 @@ |
||
25 | 25 | */ |
26 | 26 | class Eql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * id: string, // (REQUIRED) The async search ID |
|
35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws MissingParameterException if a required parameter is missing |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function delete(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['id'], $params); |
|
52 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.delete'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Returns async results from previously executed Event Query Language (EQL) search |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * id: string, // (REQUIRED) The async search ID |
|
67 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
68 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
69 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | - * } $params |
|
75 | - * |
|
76 | - * @throws MissingParameterException if a required parameter is missing |
|
77 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | - * @throws ClientResponseException if the status code of response is 4xx |
|
79 | - * @throws ServerResponseException if the status code of response is 5xx |
|
80 | - * |
|
81 | - * @return Elasticsearch|Promise |
|
82 | - */ |
|
83 | - public function get(array $params = []) |
|
84 | - { |
|
85 | - $this->checkRequiredParameters(['id'], $params); |
|
86 | - $url = '/_eql/search/' . $this->encode($params['id']); |
|
87 | - $method = 'GET'; |
|
88 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | - $headers = ['Accept' => 'application/json']; |
|
90 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get'); |
|
92 | - return $this->client->sendRequest($request); |
|
93 | - } |
|
94 | - /** |
|
95 | - * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
98 | - * |
|
99 | - * @param array{ |
|
100 | - * id: string, // (REQUIRED) The async search ID |
|
101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | - * } $params |
|
107 | - * |
|
108 | - * @throws MissingParameterException if a required parameter is missing |
|
109 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | - * @throws ClientResponseException if the status code of response is 4xx |
|
111 | - * @throws ServerResponseException if the status code of response is 5xx |
|
112 | - * |
|
113 | - * @return Elasticsearch|Promise |
|
114 | - */ |
|
115 | - public function getStatus(array $params = []) |
|
116 | - { |
|
117 | - $this->checkRequiredParameters(['id'], $params); |
|
118 | - $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
119 | - $method = 'GET'; |
|
120 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | - $headers = ['Accept' => 'application/json']; |
|
122 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
123 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get_status'); |
|
124 | - return $this->client->sendRequest($request); |
|
125 | - } |
|
126 | - /** |
|
127 | - * Returns results matching a query expressed in Event Query Language (EQL) |
|
128 | - * |
|
129 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
130 | - * |
|
131 | - * @param array{ |
|
132 | - * index: string, // (REQUIRED) The name of the index to scope the operation |
|
133 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
134 | - * keep_on_completion: boolean, // Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) |
|
135 | - * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
136 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
137 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
138 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
139 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
140 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
141 | - * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
142 | - * } $params |
|
143 | - * |
|
144 | - * @throws MissingParameterException if a required parameter is missing |
|
145 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | - * @throws ClientResponseException if the status code of response is 4xx |
|
147 | - * @throws ServerResponseException if the status code of response is 5xx |
|
148 | - * |
|
149 | - * @return Elasticsearch|Promise |
|
150 | - */ |
|
151 | - public function search(array $params = []) |
|
152 | - { |
|
153 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
154 | - $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
155 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
156 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'eql.search'); |
|
160 | - return $this->client->sendRequest($request); |
|
161 | - } |
|
28 | + /** |
|
29 | + * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * id: string, // (REQUIRED) The async search ID |
|
35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws MissingParameterException if a required parameter is missing |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function delete(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['id'], $params); |
|
52 | + $url = '/_eql/search/' . $this->encode($params['id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.delete'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Returns async results from previously executed Event Query Language (EQL) search |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * id: string, // (REQUIRED) The async search ID |
|
67 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
68 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
69 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | + * } $params |
|
75 | + * |
|
76 | + * @throws MissingParameterException if a required parameter is missing |
|
77 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | + * @throws ClientResponseException if the status code of response is 4xx |
|
79 | + * @throws ServerResponseException if the status code of response is 5xx |
|
80 | + * |
|
81 | + * @return Elasticsearch|Promise |
|
82 | + */ |
|
83 | + public function get(array $params = []) |
|
84 | + { |
|
85 | + $this->checkRequiredParameters(['id'], $params); |
|
86 | + $url = '/_eql/search/' . $this->encode($params['id']); |
|
87 | + $method = 'GET'; |
|
88 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | + $headers = ['Accept' => 'application/json']; |
|
90 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get'); |
|
92 | + return $this->client->sendRequest($request); |
|
93 | + } |
|
94 | + /** |
|
95 | + * Returns the status of a previously submitted async or stored Event Query Language (EQL) search |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
98 | + * |
|
99 | + * @param array{ |
|
100 | + * id: string, // (REQUIRED) The async search ID |
|
101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | + * } $params |
|
107 | + * |
|
108 | + * @throws MissingParameterException if a required parameter is missing |
|
109 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | + * @throws ClientResponseException if the status code of response is 4xx |
|
111 | + * @throws ServerResponseException if the status code of response is 5xx |
|
112 | + * |
|
113 | + * @return Elasticsearch|Promise |
|
114 | + */ |
|
115 | + public function getStatus(array $params = []) |
|
116 | + { |
|
117 | + $this->checkRequiredParameters(['id'], $params); |
|
118 | + $url = '/_eql/search/status/' . $this->encode($params['id']); |
|
119 | + $method = 'GET'; |
|
120 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | + $headers = ['Accept' => 'application/json']; |
|
122 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
123 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'eql.get_status'); |
|
124 | + return $this->client->sendRequest($request); |
|
125 | + } |
|
126 | + /** |
|
127 | + * Returns results matching a query expressed in Event Query Language (EQL) |
|
128 | + * |
|
129 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html |
|
130 | + * |
|
131 | + * @param array{ |
|
132 | + * index: string, // (REQUIRED) The name of the index to scope the operation |
|
133 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
134 | + * keep_on_completion: boolean, // Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) |
|
135 | + * keep_alive: time, // Update the time interval in which the results (partial or final) for this search will be available |
|
136 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
137 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
138 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
139 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
140 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
141 | + * body: array, // (REQUIRED) Eql request body. Use the `query` to limit the query scope. |
|
142 | + * } $params |
|
143 | + * |
|
144 | + * @throws MissingParameterException if a required parameter is missing |
|
145 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | + * @throws ClientResponseException if the status code of response is 4xx |
|
147 | + * @throws ServerResponseException if the status code of response is 5xx |
|
148 | + * |
|
149 | + * @return Elasticsearch|Promise |
|
150 | + */ |
|
151 | + public function search(array $params = []) |
|
152 | + { |
|
153 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
154 | + $url = '/' . $this->encode($params['index']) . '/_eql/search'; |
|
155 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
156 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_on_completion', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'eql.search'); |
|
160 | + return $this->client->sendRequest($request); |
|
161 | + } |
|
162 | 162 | } |
@@ -25,353 +25,353 @@ |
||
25 | 25 | */ |
26 | 26 | class Ilm extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * policy: string, // (REQUIRED) The name of the index lifecycle policy |
|
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'], $params); |
|
52 | - $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.delete_lifecycle'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * index: string, // (REQUIRED) The name of the index to explain |
|
67 | - * only_managed: boolean, // filters the indices included in the response to ones managed by ILM |
|
68 | - * only_errors: boolean, // filters the indices included in the response to ones in an ILM error state, implies only_managed |
|
69 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | - * } $params |
|
75 | - * |
|
76 | - * @throws MissingParameterException if a required parameter is missing |
|
77 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | - * @throws ClientResponseException if the status code of response is 4xx |
|
79 | - * @throws ServerResponseException if the status code of response is 5xx |
|
80 | - * |
|
81 | - * @return Elasticsearch|Promise |
|
82 | - */ |
|
83 | - public function explainLifecycle(array $params = []) |
|
84 | - { |
|
85 | - $this->checkRequiredParameters(['index'], $params); |
|
86 | - $url = '/' . $this->encode($params['index']) . '/_ilm/explain'; |
|
87 | - $method = 'GET'; |
|
88 | - $url = $this->addQueryString($url, $params, ['only_managed', 'only_errors', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | - $headers = ['Accept' => 'application/json']; |
|
90 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.explain_lifecycle'); |
|
92 | - return $this->client->sendRequest($request); |
|
93 | - } |
|
94 | - /** |
|
95 | - * Returns the specified policy definition. Includes the policy version and last modified date. |
|
96 | - * |
|
97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html |
|
98 | - * |
|
99 | - * @param array{ |
|
100 | - * policy: string, // The name of the index lifecycle policy |
|
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 NoNodeAvailableException if all the hosts are offline |
|
109 | - * @throws ClientResponseException if the status code of response is 4xx |
|
110 | - * @throws ServerResponseException if the status code of response is 5xx |
|
111 | - * |
|
112 | - * @return Elasticsearch|Promise |
|
113 | - */ |
|
114 | - public function getLifecycle(array $params = []) |
|
115 | - { |
|
116 | - if (isset($params['policy'])) { |
|
117 | - $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
118 | - $method = 'GET'; |
|
119 | - } else { |
|
120 | - $url = '/_ilm/policy'; |
|
121 | - $method = 'GET'; |
|
122 | - } |
|
123 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | - $headers = ['Accept' => 'application/json']; |
|
125 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | - $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.get_lifecycle'); |
|
127 | - return $this->client->sendRequest($request); |
|
128 | - } |
|
129 | - /** |
|
130 | - * Retrieves the current index lifecycle management (ILM) status. |
|
131 | - * |
|
132 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html |
|
133 | - * |
|
134 | - * @param array{ |
|
135 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
136 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
137 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
138 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
139 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
140 | - * } $params |
|
141 | - * |
|
142 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
143 | - * @throws ClientResponseException if the status code of response is 4xx |
|
144 | - * @throws ServerResponseException if the status code of response is 5xx |
|
145 | - * |
|
146 | - * @return Elasticsearch|Promise |
|
147 | - */ |
|
148 | - public function getStatus(array $params = []) |
|
149 | - { |
|
150 | - $url = '/_ilm/status'; |
|
151 | - $method = 'GET'; |
|
152 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
153 | - $headers = ['Accept' => 'application/json']; |
|
154 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
155 | - $request = $this->addOtelAttributes($params, [], $request, 'ilm.get_status'); |
|
156 | - return $this->client->sendRequest($request); |
|
157 | - } |
|
158 | - /** |
|
159 | - * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing |
|
160 | - * |
|
161 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html |
|
162 | - * |
|
163 | - * @param array{ |
|
164 | - * dry_run: boolean, // If set to true it will simulate the migration, providing a way to retrieve the ILM policies and indices that need to be migrated. The default is false |
|
165 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
166 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
167 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
168 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
169 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
170 | - * body: array, // Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data") |
|
171 | - * } $params |
|
172 | - * |
|
173 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
174 | - * @throws ClientResponseException if the status code of response is 4xx |
|
175 | - * @throws ServerResponseException if the status code of response is 5xx |
|
176 | - * |
|
177 | - * @return Elasticsearch|Promise |
|
178 | - */ |
|
179 | - public function migrateToDataTiers(array $params = []) |
|
180 | - { |
|
181 | - $url = '/_ilm/migrate_to_data_tiers'; |
|
182 | - $method = 'POST'; |
|
183 | - $url = $this->addQueryString($url, $params, ['dry_run', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
184 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
185 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
186 | - $request = $this->addOtelAttributes($params, [], $request, 'ilm.migrate_to_data_tiers'); |
|
187 | - return $this->client->sendRequest($request); |
|
188 | - } |
|
189 | - /** |
|
190 | - * Manually moves an index into the specified step and executes that step. |
|
191 | - * |
|
192 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html |
|
193 | - * |
|
194 | - * @param array{ |
|
195 | - * index: string, // (REQUIRED) The name of the index whose lifecycle step is to change |
|
196 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
197 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
198 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
199 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
200 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
201 | - * body: array, // The new lifecycle step to move to |
|
202 | - * } $params |
|
203 | - * |
|
204 | - * @throws MissingParameterException if a required parameter is missing |
|
205 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
206 | - * @throws ClientResponseException if the status code of response is 4xx |
|
207 | - * @throws ServerResponseException if the status code of response is 5xx |
|
208 | - * |
|
209 | - * @return Elasticsearch|Promise |
|
210 | - */ |
|
211 | - public function moveToStep(array $params = []) |
|
212 | - { |
|
213 | - $this->checkRequiredParameters(['index'], $params); |
|
214 | - $url = '/_ilm/move/' . $this->encode($params['index']); |
|
215 | - $method = 'POST'; |
|
216 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
217 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
218 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
219 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.move_to_step'); |
|
220 | - return $this->client->sendRequest($request); |
|
221 | - } |
|
222 | - /** |
|
223 | - * Creates a lifecycle policy |
|
224 | - * |
|
225 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html |
|
226 | - * |
|
227 | - * @param array{ |
|
228 | - * policy: string, // (REQUIRED) The name of the index lifecycle policy |
|
229 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
230 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
231 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
232 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
233 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
234 | - * body: array, // The lifecycle policy definition to register |
|
235 | - * } $params |
|
236 | - * |
|
237 | - * @throws MissingParameterException if a required parameter is missing |
|
238 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
239 | - * @throws ClientResponseException if the status code of response is 4xx |
|
240 | - * @throws ServerResponseException if the status code of response is 5xx |
|
241 | - * |
|
242 | - * @return Elasticsearch|Promise |
|
243 | - */ |
|
244 | - public function putLifecycle(array $params = []) |
|
245 | - { |
|
246 | - $this->checkRequiredParameters(['policy'], $params); |
|
247 | - $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
248 | - $method = 'PUT'; |
|
249 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
250 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
251 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
252 | - $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.put_lifecycle'); |
|
253 | - return $this->client->sendRequest($request); |
|
254 | - } |
|
255 | - /** |
|
256 | - * Removes the assigned lifecycle policy and stops managing the specified index |
|
257 | - * |
|
258 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html |
|
259 | - * |
|
260 | - * @param array{ |
|
261 | - * index: string, // (REQUIRED) The name of the index to remove policy on |
|
262 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
263 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
264 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
265 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
266 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
267 | - * } $params |
|
268 | - * |
|
269 | - * @throws MissingParameterException if a required parameter is missing |
|
270 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
271 | - * @throws ClientResponseException if the status code of response is 4xx |
|
272 | - * @throws ServerResponseException if the status code of response is 5xx |
|
273 | - * |
|
274 | - * @return Elasticsearch|Promise |
|
275 | - */ |
|
276 | - public function removePolicy(array $params = []) |
|
277 | - { |
|
278 | - $this->checkRequiredParameters(['index'], $params); |
|
279 | - $url = '/' . $this->encode($params['index']) . '/_ilm/remove'; |
|
280 | - $method = 'POST'; |
|
281 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
282 | - $headers = ['Accept' => 'application/json']; |
|
283 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
284 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.remove_policy'); |
|
285 | - return $this->client->sendRequest($request); |
|
286 | - } |
|
287 | - /** |
|
288 | - * Retries executing the policy for an index that is in the ERROR step. |
|
289 | - * |
|
290 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html |
|
291 | - * |
|
292 | - * @param array{ |
|
293 | - * index: string, // (REQUIRED) The name of the indices (comma-separated) whose failed lifecycle step is to be retry |
|
294 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
295 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
296 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
297 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
298 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
299 | - * } $params |
|
300 | - * |
|
301 | - * @throws MissingParameterException if a required parameter is missing |
|
302 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
303 | - * @throws ClientResponseException if the status code of response is 4xx |
|
304 | - * @throws ServerResponseException if the status code of response is 5xx |
|
305 | - * |
|
306 | - * @return Elasticsearch|Promise |
|
307 | - */ |
|
308 | - public function retry(array $params = []) |
|
309 | - { |
|
310 | - $this->checkRequiredParameters(['index'], $params); |
|
311 | - $url = '/' . $this->encode($params['index']) . '/_ilm/retry'; |
|
312 | - $method = 'POST'; |
|
313 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
314 | - $headers = ['Accept' => 'application/json']; |
|
315 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
316 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.retry'); |
|
317 | - return $this->client->sendRequest($request); |
|
318 | - } |
|
319 | - /** |
|
320 | - * Start the index lifecycle management (ILM) plugin. |
|
321 | - * |
|
322 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html |
|
323 | - * |
|
324 | - * @param array{ |
|
325 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
326 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
327 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
328 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
329 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
330 | - * } $params |
|
331 | - * |
|
332 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
333 | - * @throws ClientResponseException if the status code of response is 4xx |
|
334 | - * @throws ServerResponseException if the status code of response is 5xx |
|
335 | - * |
|
336 | - * @return Elasticsearch|Promise |
|
337 | - */ |
|
338 | - public function start(array $params = []) |
|
339 | - { |
|
340 | - $url = '/_ilm/start'; |
|
341 | - $method = 'POST'; |
|
342 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
343 | - $headers = ['Accept' => 'application/json']; |
|
344 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
345 | - $request = $this->addOtelAttributes($params, [], $request, 'ilm.start'); |
|
346 | - return $this->client->sendRequest($request); |
|
347 | - } |
|
348 | - /** |
|
349 | - * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin |
|
350 | - * |
|
351 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html |
|
352 | - * |
|
353 | - * @param array{ |
|
354 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
355 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
356 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
357 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
358 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
359 | - * } $params |
|
360 | - * |
|
361 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
362 | - * @throws ClientResponseException if the status code of response is 4xx |
|
363 | - * @throws ServerResponseException if the status code of response is 5xx |
|
364 | - * |
|
365 | - * @return Elasticsearch|Promise |
|
366 | - */ |
|
367 | - public function stop(array $params = []) |
|
368 | - { |
|
369 | - $url = '/_ilm/stop'; |
|
370 | - $method = 'POST'; |
|
371 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
372 | - $headers = ['Accept' => 'application/json']; |
|
373 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
374 | - $request = $this->addOtelAttributes($params, [], $request, 'ilm.stop'); |
|
375 | - return $this->client->sendRequest($request); |
|
376 | - } |
|
28 | + /** |
|
29 | + * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * policy: string, // (REQUIRED) The name of the index lifecycle policy |
|
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'], $params); |
|
52 | + $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.delete_lifecycle'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * index: string, // (REQUIRED) The name of the index to explain |
|
67 | + * only_managed: boolean, // filters the indices included in the response to ones managed by ILM |
|
68 | + * only_errors: boolean, // filters the indices included in the response to ones in an ILM error state, implies only_managed |
|
69 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | + * } $params |
|
75 | + * |
|
76 | + * @throws MissingParameterException if a required parameter is missing |
|
77 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
78 | + * @throws ClientResponseException if the status code of response is 4xx |
|
79 | + * @throws ServerResponseException if the status code of response is 5xx |
|
80 | + * |
|
81 | + * @return Elasticsearch|Promise |
|
82 | + */ |
|
83 | + public function explainLifecycle(array $params = []) |
|
84 | + { |
|
85 | + $this->checkRequiredParameters(['index'], $params); |
|
86 | + $url = '/' . $this->encode($params['index']) . '/_ilm/explain'; |
|
87 | + $method = 'GET'; |
|
88 | + $url = $this->addQueryString($url, $params, ['only_managed', 'only_errors', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
89 | + $headers = ['Accept' => 'application/json']; |
|
90 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
91 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.explain_lifecycle'); |
|
92 | + return $this->client->sendRequest($request); |
|
93 | + } |
|
94 | + /** |
|
95 | + * Returns the specified policy definition. Includes the policy version and last modified date. |
|
96 | + * |
|
97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html |
|
98 | + * |
|
99 | + * @param array{ |
|
100 | + * policy: string, // The name of the index lifecycle policy |
|
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 NoNodeAvailableException if all the hosts are offline |
|
109 | + * @throws ClientResponseException if the status code of response is 4xx |
|
110 | + * @throws ServerResponseException if the status code of response is 5xx |
|
111 | + * |
|
112 | + * @return Elasticsearch|Promise |
|
113 | + */ |
|
114 | + public function getLifecycle(array $params = []) |
|
115 | + { |
|
116 | + if (isset($params['policy'])) { |
|
117 | + $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
118 | + $method = 'GET'; |
|
119 | + } else { |
|
120 | + $url = '/_ilm/policy'; |
|
121 | + $method = 'GET'; |
|
122 | + } |
|
123 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | + $headers = ['Accept' => 'application/json']; |
|
125 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | + $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.get_lifecycle'); |
|
127 | + return $this->client->sendRequest($request); |
|
128 | + } |
|
129 | + /** |
|
130 | + * Retrieves the current index lifecycle management (ILM) status. |
|
131 | + * |
|
132 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html |
|
133 | + * |
|
134 | + * @param array{ |
|
135 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
136 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
137 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
138 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
139 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
140 | + * } $params |
|
141 | + * |
|
142 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
143 | + * @throws ClientResponseException if the status code of response is 4xx |
|
144 | + * @throws ServerResponseException if the status code of response is 5xx |
|
145 | + * |
|
146 | + * @return Elasticsearch|Promise |
|
147 | + */ |
|
148 | + public function getStatus(array $params = []) |
|
149 | + { |
|
150 | + $url = '/_ilm/status'; |
|
151 | + $method = 'GET'; |
|
152 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
153 | + $headers = ['Accept' => 'application/json']; |
|
154 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
155 | + $request = $this->addOtelAttributes($params, [], $request, 'ilm.get_status'); |
|
156 | + return $this->client->sendRequest($request); |
|
157 | + } |
|
158 | + /** |
|
159 | + * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing |
|
160 | + * |
|
161 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html |
|
162 | + * |
|
163 | + * @param array{ |
|
164 | + * dry_run: boolean, // If set to true it will simulate the migration, providing a way to retrieve the ILM policies and indices that need to be migrated. The default is false |
|
165 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
166 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
167 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
168 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
169 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
170 | + * body: array, // Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data") |
|
171 | + * } $params |
|
172 | + * |
|
173 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
174 | + * @throws ClientResponseException if the status code of response is 4xx |
|
175 | + * @throws ServerResponseException if the status code of response is 5xx |
|
176 | + * |
|
177 | + * @return Elasticsearch|Promise |
|
178 | + */ |
|
179 | + public function migrateToDataTiers(array $params = []) |
|
180 | + { |
|
181 | + $url = '/_ilm/migrate_to_data_tiers'; |
|
182 | + $method = 'POST'; |
|
183 | + $url = $this->addQueryString($url, $params, ['dry_run', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
184 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
185 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
186 | + $request = $this->addOtelAttributes($params, [], $request, 'ilm.migrate_to_data_tiers'); |
|
187 | + return $this->client->sendRequest($request); |
|
188 | + } |
|
189 | + /** |
|
190 | + * Manually moves an index into the specified step and executes that step. |
|
191 | + * |
|
192 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html |
|
193 | + * |
|
194 | + * @param array{ |
|
195 | + * index: string, // (REQUIRED) The name of the index whose lifecycle step is to change |
|
196 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
197 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
198 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
199 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
200 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
201 | + * body: array, // The new lifecycle step to move to |
|
202 | + * } $params |
|
203 | + * |
|
204 | + * @throws MissingParameterException if a required parameter is missing |
|
205 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
206 | + * @throws ClientResponseException if the status code of response is 4xx |
|
207 | + * @throws ServerResponseException if the status code of response is 5xx |
|
208 | + * |
|
209 | + * @return Elasticsearch|Promise |
|
210 | + */ |
|
211 | + public function moveToStep(array $params = []) |
|
212 | + { |
|
213 | + $this->checkRequiredParameters(['index'], $params); |
|
214 | + $url = '/_ilm/move/' . $this->encode($params['index']); |
|
215 | + $method = 'POST'; |
|
216 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
217 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
218 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
219 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.move_to_step'); |
|
220 | + return $this->client->sendRequest($request); |
|
221 | + } |
|
222 | + /** |
|
223 | + * Creates a lifecycle policy |
|
224 | + * |
|
225 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html |
|
226 | + * |
|
227 | + * @param array{ |
|
228 | + * policy: string, // (REQUIRED) The name of the index lifecycle policy |
|
229 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
230 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
231 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
232 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
233 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
234 | + * body: array, // The lifecycle policy definition to register |
|
235 | + * } $params |
|
236 | + * |
|
237 | + * @throws MissingParameterException if a required parameter is missing |
|
238 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
239 | + * @throws ClientResponseException if the status code of response is 4xx |
|
240 | + * @throws ServerResponseException if the status code of response is 5xx |
|
241 | + * |
|
242 | + * @return Elasticsearch|Promise |
|
243 | + */ |
|
244 | + public function putLifecycle(array $params = []) |
|
245 | + { |
|
246 | + $this->checkRequiredParameters(['policy'], $params); |
|
247 | + $url = '/_ilm/policy/' . $this->encode($params['policy']); |
|
248 | + $method = 'PUT'; |
|
249 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
250 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
251 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
252 | + $request = $this->addOtelAttributes($params, ['policy'], $request, 'ilm.put_lifecycle'); |
|
253 | + return $this->client->sendRequest($request); |
|
254 | + } |
|
255 | + /** |
|
256 | + * Removes the assigned lifecycle policy and stops managing the specified index |
|
257 | + * |
|
258 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html |
|
259 | + * |
|
260 | + * @param array{ |
|
261 | + * index: string, // (REQUIRED) The name of the index to remove policy on |
|
262 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
263 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
264 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
265 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
266 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
267 | + * } $params |
|
268 | + * |
|
269 | + * @throws MissingParameterException if a required parameter is missing |
|
270 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
271 | + * @throws ClientResponseException if the status code of response is 4xx |
|
272 | + * @throws ServerResponseException if the status code of response is 5xx |
|
273 | + * |
|
274 | + * @return Elasticsearch|Promise |
|
275 | + */ |
|
276 | + public function removePolicy(array $params = []) |
|
277 | + { |
|
278 | + $this->checkRequiredParameters(['index'], $params); |
|
279 | + $url = '/' . $this->encode($params['index']) . '/_ilm/remove'; |
|
280 | + $method = 'POST'; |
|
281 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
282 | + $headers = ['Accept' => 'application/json']; |
|
283 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
284 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.remove_policy'); |
|
285 | + return $this->client->sendRequest($request); |
|
286 | + } |
|
287 | + /** |
|
288 | + * Retries executing the policy for an index that is in the ERROR step. |
|
289 | + * |
|
290 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html |
|
291 | + * |
|
292 | + * @param array{ |
|
293 | + * index: string, // (REQUIRED) The name of the indices (comma-separated) whose failed lifecycle step is to be retry |
|
294 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
295 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
296 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
297 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
298 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
299 | + * } $params |
|
300 | + * |
|
301 | + * @throws MissingParameterException if a required parameter is missing |
|
302 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
303 | + * @throws ClientResponseException if the status code of response is 4xx |
|
304 | + * @throws ServerResponseException if the status code of response is 5xx |
|
305 | + * |
|
306 | + * @return Elasticsearch|Promise |
|
307 | + */ |
|
308 | + public function retry(array $params = []) |
|
309 | + { |
|
310 | + $this->checkRequiredParameters(['index'], $params); |
|
311 | + $url = '/' . $this->encode($params['index']) . '/_ilm/retry'; |
|
312 | + $method = 'POST'; |
|
313 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
314 | + $headers = ['Accept' => 'application/json']; |
|
315 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
316 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ilm.retry'); |
|
317 | + return $this->client->sendRequest($request); |
|
318 | + } |
|
319 | + /** |
|
320 | + * Start the index lifecycle management (ILM) plugin. |
|
321 | + * |
|
322 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html |
|
323 | + * |
|
324 | + * @param array{ |
|
325 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
326 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
327 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
328 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
329 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
330 | + * } $params |
|
331 | + * |
|
332 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
333 | + * @throws ClientResponseException if the status code of response is 4xx |
|
334 | + * @throws ServerResponseException if the status code of response is 5xx |
|
335 | + * |
|
336 | + * @return Elasticsearch|Promise |
|
337 | + */ |
|
338 | + public function start(array $params = []) |
|
339 | + { |
|
340 | + $url = '/_ilm/start'; |
|
341 | + $method = 'POST'; |
|
342 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
343 | + $headers = ['Accept' => 'application/json']; |
|
344 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
345 | + $request = $this->addOtelAttributes($params, [], $request, 'ilm.start'); |
|
346 | + return $this->client->sendRequest($request); |
|
347 | + } |
|
348 | + /** |
|
349 | + * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin |
|
350 | + * |
|
351 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html |
|
352 | + * |
|
353 | + * @param array{ |
|
354 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
355 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
356 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
357 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
358 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
359 | + * } $params |
|
360 | + * |
|
361 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
362 | + * @throws ClientResponseException if the status code of response is 4xx |
|
363 | + * @throws ServerResponseException if the status code of response is 5xx |
|
364 | + * |
|
365 | + * @return Elasticsearch|Promise |
|
366 | + */ |
|
367 | + public function stop(array $params = []) |
|
368 | + { |
|
369 | + $url = '/_ilm/stop'; |
|
370 | + $method = 'POST'; |
|
371 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
372 | + $headers = ['Accept' => 'application/json']; |
|
373 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
374 | + $request = $this->addOtelAttributes($params, [], $request, 'ilm.stop'); |
|
375 | + return $this->client->sendRequest($request); |
|
376 | + } |
|
377 | 377 | } |
@@ -25,439 +25,439 @@ |
||
25 | 25 | */ |
26 | 26 | class Ccr extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes auto-follow patterns. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
35 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws MissingParameterException if a required parameter is missing |
|
44 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | - * @throws ClientResponseException if the status code of response is 4xx |
|
46 | - * @throws ServerResponseException if the status code of response is 5xx |
|
47 | - * |
|
48 | - * @return Elasticsearch|Promise |
|
49 | - */ |
|
50 | - public function deleteAutoFollowPattern(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['name'], $params); |
|
53 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
54 | - $method = 'DELETE'; |
|
55 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | - $headers = ['Accept' => 'application/json']; |
|
57 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.delete_auto_follow_pattern'); |
|
59 | - return $this->client->sendRequest($request); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Creates a new follower index configured to follow the referenced leader index. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html |
|
65 | - * |
|
66 | - * @param array{ |
|
67 | - * index: string, // (REQUIRED) The name of the follower index |
|
68 | - * wait_for_active_shards: string, // Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) |
|
69 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | - * body: array, // (REQUIRED) The name of the leader index and other optional ccr related parameters |
|
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 follow(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
88 | - $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
89 | - $method = 'PUT'; |
|
90 | - $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
92 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
93 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow'); |
|
94 | - return $this->client->sendRequest($request); |
|
95 | - } |
|
96 | - /** |
|
97 | - * Retrieves information about all follower indices, including parameters and status for each follower index |
|
98 | - * |
|
99 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html |
|
100 | - * |
|
101 | - * @param array{ |
|
102 | - * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
103 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
104 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
105 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
106 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
107 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
108 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
109 | - * } $params |
|
110 | - * |
|
111 | - * @throws MissingParameterException if a required parameter is missing |
|
112 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | - * @throws ClientResponseException if the status code of response is 4xx |
|
114 | - * @throws ServerResponseException if the status code of response is 5xx |
|
115 | - * |
|
116 | - * @return Elasticsearch|Promise |
|
117 | - */ |
|
118 | - public function followInfo(array $params = []) |
|
119 | - { |
|
120 | - $this->checkRequiredParameters(['index'], $params); |
|
121 | - $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
122 | - $method = 'GET'; |
|
123 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | - $headers = ['Accept' => 'application/json']; |
|
125 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow_info'); |
|
127 | - return $this->client->sendRequest($request); |
|
128 | - } |
|
129 | - /** |
|
130 | - * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. |
|
131 | - * |
|
132 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html |
|
133 | - * |
|
134 | - * @param array{ |
|
135 | - * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
136 | - * timeout: time, // Explicit operation timeout |
|
137 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
138 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
139 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
140 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
141 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
142 | - * } $params |
|
143 | - * |
|
144 | - * @throws MissingParameterException if a required parameter is missing |
|
145 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | - * @throws ClientResponseException if the status code of response is 4xx |
|
147 | - * @throws ServerResponseException if the status code of response is 5xx |
|
148 | - * |
|
149 | - * @return Elasticsearch|Promise |
|
150 | - */ |
|
151 | - public function followStats(array $params = []) |
|
152 | - { |
|
153 | - $this->checkRequiredParameters(['index'], $params); |
|
154 | - $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
155 | - $method = 'GET'; |
|
156 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | - $headers = ['Accept' => 'application/json']; |
|
158 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow_stats'); |
|
160 | - return $this->client->sendRequest($request); |
|
161 | - } |
|
162 | - /** |
|
163 | - * Removes the follower retention leases from the leader. |
|
164 | - * |
|
165 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html |
|
166 | - * |
|
167 | - * @param array{ |
|
168 | - * index: string, // (REQUIRED) the name of the leader index for which specified follower retention leases should be removed |
|
169 | - * timeout: time, // Explicit operation timeout |
|
170 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
171 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
172 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
173 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
174 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
175 | - * body: array, // (REQUIRED) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index |
|
176 | - * } $params |
|
177 | - * |
|
178 | - * @throws MissingParameterException if a required parameter is missing |
|
179 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | - * @throws ClientResponseException if the status code of response is 4xx |
|
181 | - * @throws ServerResponseException if the status code of response is 5xx |
|
182 | - * |
|
183 | - * @return Elasticsearch|Promise |
|
184 | - */ |
|
185 | - public function forgetFollower(array $params = []) |
|
186 | - { |
|
187 | - $this->checkRequiredParameters(['index', 'body'], $params); |
|
188 | - $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
189 | - $method = 'POST'; |
|
190 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
191 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
192 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
193 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.forget_follower'); |
|
194 | - return $this->client->sendRequest($request); |
|
195 | - } |
|
196 | - /** |
|
197 | - * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. |
|
198 | - * |
|
199 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html |
|
200 | - * |
|
201 | - * @param array{ |
|
202 | - * name: string, // The name of the auto follow pattern. |
|
203 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
204 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
205 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
206 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
207 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
208 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
209 | - * } $params |
|
210 | - * |
|
211 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
212 | - * @throws ClientResponseException if the status code of response is 4xx |
|
213 | - * @throws ServerResponseException if the status code of response is 5xx |
|
214 | - * |
|
215 | - * @return Elasticsearch|Promise |
|
216 | - */ |
|
217 | - public function getAutoFollowPattern(array $params = []) |
|
218 | - { |
|
219 | - if (isset($params['name'])) { |
|
220 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
221 | - $method = 'GET'; |
|
222 | - } else { |
|
223 | - $url = '/_ccr/auto_follow'; |
|
224 | - $method = 'GET'; |
|
225 | - } |
|
226 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
227 | - $headers = ['Accept' => 'application/json']; |
|
228 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
229 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.get_auto_follow_pattern'); |
|
230 | - return $this->client->sendRequest($request); |
|
231 | - } |
|
232 | - /** |
|
233 | - * Pauses an auto-follow pattern |
|
234 | - * |
|
235 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html |
|
236 | - * |
|
237 | - * @param array{ |
|
238 | - * name: string, // (REQUIRED) The name of the auto follow pattern that should pause discovering new indices to follow. |
|
239 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
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 pauseAutoFollowPattern(array $params = []) |
|
255 | - { |
|
256 | - $this->checkRequiredParameters(['name'], $params); |
|
257 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
258 | - $method = 'POST'; |
|
259 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
260 | - $headers = ['Accept' => 'application/json']; |
|
261 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
262 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.pause_auto_follow_pattern'); |
|
263 | - return $this->client->sendRequest($request); |
|
264 | - } |
|
265 | - /** |
|
266 | - * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. |
|
267 | - * |
|
268 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html |
|
269 | - * |
|
270 | - * @param array{ |
|
271 | - * index: string, // (REQUIRED) The name of the follower index that should pause following its leader index. |
|
272 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
273 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
274 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
275 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
276 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
277 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
278 | - * } $params |
|
279 | - * |
|
280 | - * @throws MissingParameterException if a required parameter is missing |
|
281 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
282 | - * @throws ClientResponseException if the status code of response is 4xx |
|
283 | - * @throws ServerResponseException if the status code of response is 5xx |
|
284 | - * |
|
285 | - * @return Elasticsearch|Promise |
|
286 | - */ |
|
287 | - public function pauseFollow(array $params = []) |
|
288 | - { |
|
289 | - $this->checkRequiredParameters(['index'], $params); |
|
290 | - $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
291 | - $method = 'POST'; |
|
292 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
293 | - $headers = ['Accept' => 'application/json']; |
|
294 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
295 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.pause_follow'); |
|
296 | - return $this->client->sendRequest($request); |
|
297 | - } |
|
298 | - /** |
|
299 | - * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. |
|
300 | - * |
|
301 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html |
|
302 | - * |
|
303 | - * @param array{ |
|
304 | - * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
305 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
306 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
307 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
308 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
309 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
310 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
311 | - * body: array, // (REQUIRED) The specification of the auto follow pattern |
|
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 putAutoFollowPattern(array $params = []) |
|
322 | - { |
|
323 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
324 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
325 | - $method = 'PUT'; |
|
326 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
328 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
329 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.put_auto_follow_pattern'); |
|
330 | - return $this->client->sendRequest($request); |
|
331 | - } |
|
332 | - /** |
|
333 | - * Resumes an auto-follow pattern that has been paused |
|
334 | - * |
|
335 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html |
|
336 | - * |
|
337 | - * @param array{ |
|
338 | - * name: string, // (REQUIRED) The name of the auto follow pattern to resume discovering new indices to follow. |
|
339 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
340 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 resumeAutoFollowPattern(array $params = []) |
|
355 | - { |
|
356 | - $this->checkRequiredParameters(['name'], $params); |
|
357 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
358 | - $method = 'POST'; |
|
359 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | - $headers = ['Accept' => 'application/json']; |
|
361 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
362 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.resume_auto_follow_pattern'); |
|
363 | - return $this->client->sendRequest($request); |
|
364 | - } |
|
365 | - /** |
|
366 | - * Resumes a follower index that has been paused |
|
367 | - * |
|
368 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html |
|
369 | - * |
|
370 | - * @param array{ |
|
371 | - * index: string, // (REQUIRED) The name of the follow index to resume following. |
|
372 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
373 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
374 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
375 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
376 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
377 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
378 | - * body: array, // The name of the leader index and other optional ccr related parameters |
|
379 | - * } $params |
|
380 | - * |
|
381 | - * @throws MissingParameterException if a required parameter is missing |
|
382 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
383 | - * @throws ClientResponseException if the status code of response is 4xx |
|
384 | - * @throws ServerResponseException if the status code of response is 5xx |
|
385 | - * |
|
386 | - * @return Elasticsearch|Promise |
|
387 | - */ |
|
388 | - public function resumeFollow(array $params = []) |
|
389 | - { |
|
390 | - $this->checkRequiredParameters(['index'], $params); |
|
391 | - $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
392 | - $method = 'POST'; |
|
393 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
395 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
396 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.resume_follow'); |
|
397 | - return $this->client->sendRequest($request); |
|
398 | - } |
|
399 | - /** |
|
400 | - * Gets all stats related to cross-cluster replication. |
|
401 | - * |
|
402 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html |
|
403 | - * |
|
404 | - * @param array{ |
|
405 | - * timeout: time, // Explicit operation timeout |
|
406 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
407 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
408 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
409 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
410 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
411 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
412 | - * } $params |
|
413 | - * |
|
414 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
415 | - * @throws ClientResponseException if the status code of response is 4xx |
|
416 | - * @throws ServerResponseException if the status code of response is 5xx |
|
417 | - * |
|
418 | - * @return Elasticsearch|Promise |
|
419 | - */ |
|
420 | - public function stats(array $params = []) |
|
421 | - { |
|
422 | - $url = '/_ccr/stats'; |
|
423 | - $method = 'GET'; |
|
424 | - $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
425 | - $headers = ['Accept' => 'application/json']; |
|
426 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
427 | - $request = $this->addOtelAttributes($params, [], $request, 'ccr.stats'); |
|
428 | - return $this->client->sendRequest($request); |
|
429 | - } |
|
430 | - /** |
|
431 | - * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. |
|
432 | - * |
|
433 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html |
|
434 | - * |
|
435 | - * @param array{ |
|
436 | - * index: string, // (REQUIRED) The name of the follower index that should be turned into a regular index. |
|
437 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
438 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
439 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
440 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
441 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
442 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
443 | - * } $params |
|
444 | - * |
|
445 | - * @throws MissingParameterException if a required parameter is missing |
|
446 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
447 | - * @throws ClientResponseException if the status code of response is 4xx |
|
448 | - * @throws ServerResponseException if the status code of response is 5xx |
|
449 | - * |
|
450 | - * @return Elasticsearch|Promise |
|
451 | - */ |
|
452 | - public function unfollow(array $params = []) |
|
453 | - { |
|
454 | - $this->checkRequiredParameters(['index'], $params); |
|
455 | - $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
456 | - $method = 'POST'; |
|
457 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
458 | - $headers = ['Accept' => 'application/json']; |
|
459 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
460 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.unfollow'); |
|
461 | - return $this->client->sendRequest($request); |
|
462 | - } |
|
28 | + /** |
|
29 | + * Deletes auto-follow patterns. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
35 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws MissingParameterException if a required parameter is missing |
|
44 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
45 | + * @throws ClientResponseException if the status code of response is 4xx |
|
46 | + * @throws ServerResponseException if the status code of response is 5xx |
|
47 | + * |
|
48 | + * @return Elasticsearch|Promise |
|
49 | + */ |
|
50 | + public function deleteAutoFollowPattern(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['name'], $params); |
|
53 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
54 | + $method = 'DELETE'; |
|
55 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | + $headers = ['Accept' => 'application/json']; |
|
57 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.delete_auto_follow_pattern'); |
|
59 | + return $this->client->sendRequest($request); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Creates a new follower index configured to follow the referenced leader index. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html |
|
65 | + * |
|
66 | + * @param array{ |
|
67 | + * index: string, // (REQUIRED) The name of the follower index |
|
68 | + * wait_for_active_shards: string, // Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) |
|
69 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | + * body: array, // (REQUIRED) The name of the leader index and other optional ccr related parameters |
|
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 follow(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
88 | + $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
89 | + $method = 'PUT'; |
|
90 | + $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
91 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
92 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
93 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow'); |
|
94 | + return $this->client->sendRequest($request); |
|
95 | + } |
|
96 | + /** |
|
97 | + * Retrieves information about all follower indices, including parameters and status for each follower index |
|
98 | + * |
|
99 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html |
|
100 | + * |
|
101 | + * @param array{ |
|
102 | + * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
103 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
104 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
105 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
106 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
107 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
108 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
109 | + * } $params |
|
110 | + * |
|
111 | + * @throws MissingParameterException if a required parameter is missing |
|
112 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
113 | + * @throws ClientResponseException if the status code of response is 4xx |
|
114 | + * @throws ServerResponseException if the status code of response is 5xx |
|
115 | + * |
|
116 | + * @return Elasticsearch|Promise |
|
117 | + */ |
|
118 | + public function followInfo(array $params = []) |
|
119 | + { |
|
120 | + $this->checkRequiredParameters(['index'], $params); |
|
121 | + $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
122 | + $method = 'GET'; |
|
123 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
124 | + $headers = ['Accept' => 'application/json']; |
|
125 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
126 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow_info'); |
|
127 | + return $this->client->sendRequest($request); |
|
128 | + } |
|
129 | + /** |
|
130 | + * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. |
|
131 | + * |
|
132 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html |
|
133 | + * |
|
134 | + * @param array{ |
|
135 | + * index: list, // (REQUIRED) A comma-separated list of index patterns; use `_all` to perform the operation on all indices |
|
136 | + * timeout: time, // Explicit operation timeout |
|
137 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
138 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
139 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
140 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
141 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
142 | + * } $params |
|
143 | + * |
|
144 | + * @throws MissingParameterException if a required parameter is missing |
|
145 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | + * @throws ClientResponseException if the status code of response is 4xx |
|
147 | + * @throws ServerResponseException if the status code of response is 5xx |
|
148 | + * |
|
149 | + * @return Elasticsearch|Promise |
|
150 | + */ |
|
151 | + public function followStats(array $params = []) |
|
152 | + { |
|
153 | + $this->checkRequiredParameters(['index'], $params); |
|
154 | + $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
155 | + $method = 'GET'; |
|
156 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | + $headers = ['Accept' => 'application/json']; |
|
158 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.follow_stats'); |
|
160 | + return $this->client->sendRequest($request); |
|
161 | + } |
|
162 | + /** |
|
163 | + * Removes the follower retention leases from the leader. |
|
164 | + * |
|
165 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html |
|
166 | + * |
|
167 | + * @param array{ |
|
168 | + * index: string, // (REQUIRED) the name of the leader index for which specified follower retention leases should be removed |
|
169 | + * timeout: time, // Explicit operation timeout |
|
170 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
171 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
172 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
173 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
174 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
175 | + * body: array, // (REQUIRED) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index |
|
176 | + * } $params |
|
177 | + * |
|
178 | + * @throws MissingParameterException if a required parameter is missing |
|
179 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
180 | + * @throws ClientResponseException if the status code of response is 4xx |
|
181 | + * @throws ServerResponseException if the status code of response is 5xx |
|
182 | + * |
|
183 | + * @return Elasticsearch|Promise |
|
184 | + */ |
|
185 | + public function forgetFollower(array $params = []) |
|
186 | + { |
|
187 | + $this->checkRequiredParameters(['index', 'body'], $params); |
|
188 | + $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
189 | + $method = 'POST'; |
|
190 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
191 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
192 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
193 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.forget_follower'); |
|
194 | + return $this->client->sendRequest($request); |
|
195 | + } |
|
196 | + /** |
|
197 | + * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. |
|
198 | + * |
|
199 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html |
|
200 | + * |
|
201 | + * @param array{ |
|
202 | + * name: string, // The name of the auto follow pattern. |
|
203 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
204 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
205 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
206 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
207 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
208 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
209 | + * } $params |
|
210 | + * |
|
211 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
212 | + * @throws ClientResponseException if the status code of response is 4xx |
|
213 | + * @throws ServerResponseException if the status code of response is 5xx |
|
214 | + * |
|
215 | + * @return Elasticsearch|Promise |
|
216 | + */ |
|
217 | + public function getAutoFollowPattern(array $params = []) |
|
218 | + { |
|
219 | + if (isset($params['name'])) { |
|
220 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
221 | + $method = 'GET'; |
|
222 | + } else { |
|
223 | + $url = '/_ccr/auto_follow'; |
|
224 | + $method = 'GET'; |
|
225 | + } |
|
226 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
227 | + $headers = ['Accept' => 'application/json']; |
|
228 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
229 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.get_auto_follow_pattern'); |
|
230 | + return $this->client->sendRequest($request); |
|
231 | + } |
|
232 | + /** |
|
233 | + * Pauses an auto-follow pattern |
|
234 | + * |
|
235 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html |
|
236 | + * |
|
237 | + * @param array{ |
|
238 | + * name: string, // (REQUIRED) The name of the auto follow pattern that should pause discovering new indices to follow. |
|
239 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
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 pauseAutoFollowPattern(array $params = []) |
|
255 | + { |
|
256 | + $this->checkRequiredParameters(['name'], $params); |
|
257 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
258 | + $method = 'POST'; |
|
259 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
260 | + $headers = ['Accept' => 'application/json']; |
|
261 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
262 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.pause_auto_follow_pattern'); |
|
263 | + return $this->client->sendRequest($request); |
|
264 | + } |
|
265 | + /** |
|
266 | + * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. |
|
267 | + * |
|
268 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html |
|
269 | + * |
|
270 | + * @param array{ |
|
271 | + * index: string, // (REQUIRED) The name of the follower index that should pause following its leader index. |
|
272 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
273 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
274 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
275 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
276 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
277 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
278 | + * } $params |
|
279 | + * |
|
280 | + * @throws MissingParameterException if a required parameter is missing |
|
281 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
282 | + * @throws ClientResponseException if the status code of response is 4xx |
|
283 | + * @throws ServerResponseException if the status code of response is 5xx |
|
284 | + * |
|
285 | + * @return Elasticsearch|Promise |
|
286 | + */ |
|
287 | + public function pauseFollow(array $params = []) |
|
288 | + { |
|
289 | + $this->checkRequiredParameters(['index'], $params); |
|
290 | + $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
291 | + $method = 'POST'; |
|
292 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
293 | + $headers = ['Accept' => 'application/json']; |
|
294 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
295 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.pause_follow'); |
|
296 | + return $this->client->sendRequest($request); |
|
297 | + } |
|
298 | + /** |
|
299 | + * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. |
|
300 | + * |
|
301 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html |
|
302 | + * |
|
303 | + * @param array{ |
|
304 | + * name: string, // (REQUIRED) The name of the auto follow pattern. |
|
305 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
306 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
307 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
308 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
309 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
310 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
311 | + * body: array, // (REQUIRED) The specification of the auto follow pattern |
|
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 putAutoFollowPattern(array $params = []) |
|
322 | + { |
|
323 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
324 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
325 | + $method = 'PUT'; |
|
326 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
328 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
329 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.put_auto_follow_pattern'); |
|
330 | + return $this->client->sendRequest($request); |
|
331 | + } |
|
332 | + /** |
|
333 | + * Resumes an auto-follow pattern that has been paused |
|
334 | + * |
|
335 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html |
|
336 | + * |
|
337 | + * @param array{ |
|
338 | + * name: string, // (REQUIRED) The name of the auto follow pattern to resume discovering new indices to follow. |
|
339 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
340 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
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 resumeAutoFollowPattern(array $params = []) |
|
355 | + { |
|
356 | + $this->checkRequiredParameters(['name'], $params); |
|
357 | + $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
358 | + $method = 'POST'; |
|
359 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | + $headers = ['Accept' => 'application/json']; |
|
361 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
362 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'ccr.resume_auto_follow_pattern'); |
|
363 | + return $this->client->sendRequest($request); |
|
364 | + } |
|
365 | + /** |
|
366 | + * Resumes a follower index that has been paused |
|
367 | + * |
|
368 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html |
|
369 | + * |
|
370 | + * @param array{ |
|
371 | + * index: string, // (REQUIRED) The name of the follow index to resume following. |
|
372 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
373 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
374 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
375 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
376 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
377 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
378 | + * body: array, // The name of the leader index and other optional ccr related parameters |
|
379 | + * } $params |
|
380 | + * |
|
381 | + * @throws MissingParameterException if a required parameter is missing |
|
382 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
383 | + * @throws ClientResponseException if the status code of response is 4xx |
|
384 | + * @throws ServerResponseException if the status code of response is 5xx |
|
385 | + * |
|
386 | + * @return Elasticsearch|Promise |
|
387 | + */ |
|
388 | + public function resumeFollow(array $params = []) |
|
389 | + { |
|
390 | + $this->checkRequiredParameters(['index'], $params); |
|
391 | + $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
392 | + $method = 'POST'; |
|
393 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
395 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
396 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.resume_follow'); |
|
397 | + return $this->client->sendRequest($request); |
|
398 | + } |
|
399 | + /** |
|
400 | + * Gets all stats related to cross-cluster replication. |
|
401 | + * |
|
402 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html |
|
403 | + * |
|
404 | + * @param array{ |
|
405 | + * timeout: time, // Explicit operation timeout |
|
406 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
407 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
408 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
409 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
410 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
411 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
412 | + * } $params |
|
413 | + * |
|
414 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
415 | + * @throws ClientResponseException if the status code of response is 4xx |
|
416 | + * @throws ServerResponseException if the status code of response is 5xx |
|
417 | + * |
|
418 | + * @return Elasticsearch|Promise |
|
419 | + */ |
|
420 | + public function stats(array $params = []) |
|
421 | + { |
|
422 | + $url = '/_ccr/stats'; |
|
423 | + $method = 'GET'; |
|
424 | + $url = $this->addQueryString($url, $params, ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
425 | + $headers = ['Accept' => 'application/json']; |
|
426 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
427 | + $request = $this->addOtelAttributes($params, [], $request, 'ccr.stats'); |
|
428 | + return $this->client->sendRequest($request); |
|
429 | + } |
|
430 | + /** |
|
431 | + * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. |
|
432 | + * |
|
433 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html |
|
434 | + * |
|
435 | + * @param array{ |
|
436 | + * index: string, // (REQUIRED) The name of the follower index that should be turned into a regular index. |
|
437 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
438 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
439 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
440 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
441 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
442 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
443 | + * } $params |
|
444 | + * |
|
445 | + * @throws MissingParameterException if a required parameter is missing |
|
446 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
447 | + * @throws ClientResponseException if the status code of response is 4xx |
|
448 | + * @throws ServerResponseException if the status code of response is 5xx |
|
449 | + * |
|
450 | + * @return Elasticsearch|Promise |
|
451 | + */ |
|
452 | + public function unfollow(array $params = []) |
|
453 | + { |
|
454 | + $this->checkRequiredParameters(['index'], $params); |
|
455 | + $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
456 | + $method = 'POST'; |
|
457 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
458 | + $headers = ['Accept' => 'application/json']; |
|
459 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
460 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'ccr.unfollow'); |
|
461 | + return $this->client->sendRequest($request); |
|
462 | + } |
|
463 | 463 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function deleteAutoFollowPattern(array $params = []) |
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['name'], $params); |
53 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
53 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
54 | 54 | $method = 'DELETE'; |
55 | 55 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function follow(array $params = []) |
86 | 86 | { |
87 | 87 | $this->checkRequiredParameters(['index', 'body'], $params); |
88 | - $url = '/' . $this->encode($params['index']) . '/_ccr/follow'; |
|
88 | + $url = '/'.$this->encode($params['index']).'/_ccr/follow'; |
|
89 | 89 | $method = 'PUT'; |
90 | 90 | $url = $this->addQueryString($url, $params, ['wait_for_active_shards', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
91 | 91 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public function followInfo(array $params = []) |
119 | 119 | { |
120 | 120 | $this->checkRequiredParameters(['index'], $params); |
121 | - $url = '/' . $this->encode($params['index']) . '/_ccr/info'; |
|
121 | + $url = '/'.$this->encode($params['index']).'/_ccr/info'; |
|
122 | 122 | $method = 'GET'; |
123 | 123 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
124 | 124 | $headers = ['Accept' => 'application/json']; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function followStats(array $params = []) |
152 | 152 | { |
153 | 153 | $this->checkRequiredParameters(['index'], $params); |
154 | - $url = '/' . $this->encode($params['index']) . '/_ccr/stats'; |
|
154 | + $url = '/'.$this->encode($params['index']).'/_ccr/stats'; |
|
155 | 155 | $method = 'GET'; |
156 | 156 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
157 | 157 | $headers = ['Accept' => 'application/json']; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | public function forgetFollower(array $params = []) |
186 | 186 | { |
187 | 187 | $this->checkRequiredParameters(['index', 'body'], $params); |
188 | - $url = '/' . $this->encode($params['index']) . '/_ccr/forget_follower'; |
|
188 | + $url = '/'.$this->encode($params['index']).'/_ccr/forget_follower'; |
|
189 | 189 | $method = 'POST'; |
190 | 190 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
191 | 191 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function getAutoFollowPattern(array $params = []) |
218 | 218 | { |
219 | 219 | if (isset($params['name'])) { |
220 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
220 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
221 | 221 | $method = 'GET'; |
222 | 222 | } else { |
223 | 223 | $url = '/_ccr/auto_follow'; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | public function pauseAutoFollowPattern(array $params = []) |
255 | 255 | { |
256 | 256 | $this->checkRequiredParameters(['name'], $params); |
257 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/pause'; |
|
257 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']).'/pause'; |
|
258 | 258 | $method = 'POST'; |
259 | 259 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
260 | 260 | $headers = ['Accept' => 'application/json']; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | public function pauseFollow(array $params = []) |
288 | 288 | { |
289 | 289 | $this->checkRequiredParameters(['index'], $params); |
290 | - $url = '/' . $this->encode($params['index']) . '/_ccr/pause_follow'; |
|
290 | + $url = '/'.$this->encode($params['index']).'/_ccr/pause_follow'; |
|
291 | 291 | $method = 'POST'; |
292 | 292 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
293 | 293 | $headers = ['Accept' => 'application/json']; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function putAutoFollowPattern(array $params = []) |
322 | 322 | { |
323 | 323 | $this->checkRequiredParameters(['name', 'body'], $params); |
324 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']); |
|
324 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']); |
|
325 | 325 | $method = 'PUT'; |
326 | 326 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
327 | 327 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | public function resumeAutoFollowPattern(array $params = []) |
355 | 355 | { |
356 | 356 | $this->checkRequiredParameters(['name'], $params); |
357 | - $url = '/_ccr/auto_follow/' . $this->encode($params['name']) . '/resume'; |
|
357 | + $url = '/_ccr/auto_follow/'.$this->encode($params['name']).'/resume'; |
|
358 | 358 | $method = 'POST'; |
359 | 359 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
360 | 360 | $headers = ['Accept' => 'application/json']; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | public function resumeFollow(array $params = []) |
389 | 389 | { |
390 | 390 | $this->checkRequiredParameters(['index'], $params); |
391 | - $url = '/' . $this->encode($params['index']) . '/_ccr/resume_follow'; |
|
391 | + $url = '/'.$this->encode($params['index']).'/_ccr/resume_follow'; |
|
392 | 392 | $method = 'POST'; |
393 | 393 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
394 | 394 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | public function unfollow(array $params = []) |
453 | 453 | { |
454 | 454 | $this->checkRequiredParameters(['index'], $params); |
455 | - $url = '/' . $this->encode($params['index']) . '/_ccr/unfollow'; |
|
455 | + $url = '/'.$this->encode($params['index']).'/_ccr/unfollow'; |
|
456 | 456 | $method = 'POST'; |
457 | 457 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
458 | 458 | $headers = ['Accept' => 'application/json']; |
@@ -25,1018 +25,1018 @@ |
||
25 | 25 | */ |
26 | 26 | class Connector extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Updates the last_seen timestamp in the connector document. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
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 checkIn(array $params = []) |
|
51 | - { |
|
52 | - $this->checkRequiredParameters(['connector_id'], $params); |
|
53 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in'; |
|
54 | - $method = 'PUT'; |
|
55 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | - $headers = ['Accept' => 'application/json']; |
|
57 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.check_in'); |
|
59 | - return $this->client->sendRequest($request); |
|
60 | - } |
|
61 | - /** |
|
62 | - * Deletes a connector. |
|
63 | - * |
|
64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html |
|
65 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
66 | - * |
|
67 | - * @param array{ |
|
68 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be deleted. |
|
69 | - * delete_sync_jobs: boolean, // Determines whether associated sync jobs are also deleted. |
|
70 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | - * } $params |
|
76 | - * |
|
77 | - * @throws MissingParameterException if a required parameter is missing |
|
78 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
79 | - * @throws ClientResponseException if the status code of response is 4xx |
|
80 | - * @throws ServerResponseException if the status code of response is 5xx |
|
81 | - * |
|
82 | - * @return Elasticsearch|Promise |
|
83 | - */ |
|
84 | - public function delete(array $params = []) |
|
85 | - { |
|
86 | - $this->checkRequiredParameters(['connector_id'], $params); |
|
87 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
88 | - $method = 'DELETE'; |
|
89 | - $url = $this->addQueryString($url, $params, ['delete_sync_jobs', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
90 | - $headers = ['Accept' => 'application/json']; |
|
91 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
92 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.delete'); |
|
93 | - return $this->client->sendRequest($request); |
|
94 | - } |
|
95 | - /** |
|
96 | - * Returns the details about a connector. |
|
97 | - * |
|
98 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html |
|
99 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
100 | - * |
|
101 | - * @param array{ |
|
102 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be returned. |
|
103 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | - * } $params |
|
109 | - * |
|
110 | - * @throws MissingParameterException if a required parameter is missing |
|
111 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
112 | - * @throws ClientResponseException if the status code of response is 4xx |
|
113 | - * @throws ServerResponseException if the status code of response is 5xx |
|
114 | - * |
|
115 | - * @return Elasticsearch|Promise |
|
116 | - */ |
|
117 | - public function get(array $params = []) |
|
118 | - { |
|
119 | - $this->checkRequiredParameters(['connector_id'], $params); |
|
120 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
121 | - $method = 'GET'; |
|
122 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
123 | - $headers = ['Accept' => 'application/json']; |
|
124 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
125 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.get'); |
|
126 | - return $this->client->sendRequest($request); |
|
127 | - } |
|
128 | - /** |
|
129 | - * Updates the stats of last sync in the connector document. |
|
130 | - * |
|
131 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html |
|
132 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
133 | - * |
|
134 | - * @param array{ |
|
135 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
136 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
137 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
138 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
139 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
140 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
141 | - * body: array, // (REQUIRED) Object with stats related to the last connector sync run. |
|
142 | - * } $params |
|
143 | - * |
|
144 | - * @throws MissingParameterException if a required parameter is missing |
|
145 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | - * @throws ClientResponseException if the status code of response is 4xx |
|
147 | - * @throws ServerResponseException if the status code of response is 5xx |
|
148 | - * |
|
149 | - * @return Elasticsearch|Promise |
|
150 | - */ |
|
151 | - public function lastSync(array $params = []) |
|
152 | - { |
|
153 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
154 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync'; |
|
155 | - $method = 'PUT'; |
|
156 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.last_sync'); |
|
160 | - return $this->client->sendRequest($request); |
|
161 | - } |
|
162 | - /** |
|
163 | - * Lists all connectors. |
|
164 | - * |
|
165 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html |
|
166 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
167 | - * |
|
168 | - * @param array{ |
|
169 | - * from: int, // Starting offset (default: 0) |
|
170 | - * size: int, // Specifies a max number of results to get (default: 100) |
|
171 | - * index_name: list, // A comma-separated list of connector index names to fetch connector documents for |
|
172 | - * connector_name: list, // A comma-separated list of connector names to fetch connector documents for |
|
173 | - * service_type: list, // A comma-separated list of connector service types to fetch connector documents for |
|
174 | - * query: string, // A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names |
|
175 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
176 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
177 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
178 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
179 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
180 | - * } $params |
|
181 | - * |
|
182 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
183 | - * @throws ClientResponseException if the status code of response is 4xx |
|
184 | - * @throws ServerResponseException if the status code of response is 5xx |
|
185 | - * |
|
186 | - * @return Elasticsearch|Promise |
|
187 | - */ |
|
188 | - public function list(array $params = []) |
|
189 | - { |
|
190 | - $url = '/_connector'; |
|
191 | - $method = 'GET'; |
|
192 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'index_name', 'connector_name', 'service_type', 'query', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
193 | - $headers = ['Accept' => 'application/json']; |
|
194 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
195 | - $request = $this->addOtelAttributes($params, [], $request, 'connector.list'); |
|
196 | - return $this->client->sendRequest($request); |
|
197 | - } |
|
198 | - /** |
|
199 | - * Creates a connector. |
|
200 | - * |
|
201 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html |
|
202 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
203 | - * |
|
204 | - * @param array{ |
|
205 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
206 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
207 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
208 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
209 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
210 | - * body: array, // The connector configuration. |
|
211 | - * } $params |
|
212 | - * |
|
213 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
214 | - * @throws ClientResponseException if the status code of response is 4xx |
|
215 | - * @throws ServerResponseException if the status code of response is 5xx |
|
216 | - * |
|
217 | - * @return Elasticsearch|Promise |
|
218 | - */ |
|
219 | - public function post(array $params = []) |
|
220 | - { |
|
221 | - $url = '/_connector'; |
|
222 | - $method = 'POST'; |
|
223 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
224 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
225 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
226 | - $request = $this->addOtelAttributes($params, [], $request, 'connector.post'); |
|
227 | - return $this->client->sendRequest($request); |
|
228 | - } |
|
229 | - /** |
|
230 | - * Creates or updates a connector. |
|
231 | - * |
|
232 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html |
|
233 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
234 | - * |
|
235 | - * @param array{ |
|
236 | - * connector_id: string, // The unique identifier of the connector to be created or updated. |
|
237 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
238 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
239 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
240 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
241 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
242 | - * body: array, // The connector configuration. |
|
243 | - * } $params |
|
244 | - * |
|
245 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
246 | - * @throws ClientResponseException if the status code of response is 4xx |
|
247 | - * @throws ServerResponseException if the status code of response is 5xx |
|
248 | - * |
|
249 | - * @return Elasticsearch|Promise |
|
250 | - */ |
|
251 | - public function put(array $params = []) |
|
252 | - { |
|
253 | - if (isset($params['connector_id'])) { |
|
254 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
255 | - $method = 'PUT'; |
|
256 | - } else { |
|
257 | - $url = '/_connector'; |
|
258 | - $method = 'PUT'; |
|
259 | - } |
|
260 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
261 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
262 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
263 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.put'); |
|
264 | - return $this->client->sendRequest($request); |
|
265 | - } |
|
266 | - /** |
|
267 | - * Cancels a connector sync job. |
|
268 | - * |
|
269 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html |
|
270 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
271 | - * |
|
272 | - * @param array{ |
|
273 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be canceled |
|
274 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
275 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
276 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
277 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
278 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
279 | - * } $params |
|
280 | - * |
|
281 | - * @throws MissingParameterException if a required parameter is missing |
|
282 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
283 | - * @throws ClientResponseException if the status code of response is 4xx |
|
284 | - * @throws ServerResponseException if the status code of response is 5xx |
|
285 | - * |
|
286 | - * @return Elasticsearch|Promise |
|
287 | - */ |
|
288 | - public function syncJobCancel(array $params = []) |
|
289 | - { |
|
290 | - $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
291 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_cancel'; |
|
292 | - $method = 'PUT'; |
|
293 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
294 | - $headers = ['Accept' => 'application/json']; |
|
295 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
296 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_cancel'); |
|
297 | - return $this->client->sendRequest($request); |
|
298 | - } |
|
299 | - /** |
|
300 | - * Checks in a connector sync job (refreshes 'last_seen'). |
|
301 | - * |
|
302 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-sync-job-api.html |
|
303 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
304 | - * |
|
305 | - * @param array{ |
|
306 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be checked in |
|
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 syncJobCheckIn(array $params = []) |
|
322 | - { |
|
323 | - $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
324 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_check_in'; |
|
325 | - $method = 'PUT'; |
|
326 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | - $headers = ['Accept' => 'application/json']; |
|
328 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
329 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_check_in'); |
|
330 | - return $this->client->sendRequest($request); |
|
331 | - } |
|
332 | - /** |
|
333 | - * Claims a connector sync job. |
|
334 | - * |
|
335 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/claim-connector-sync-job-api.html |
|
336 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
337 | - * |
|
338 | - * @param array{ |
|
339 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be claimed. |
|
340 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
345 | - * body: array, // (REQUIRED) Data to claim a sync job. |
|
346 | - * } $params |
|
347 | - * |
|
348 | - * @throws MissingParameterException if a required parameter is missing |
|
349 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
350 | - * @throws ClientResponseException if the status code of response is 4xx |
|
351 | - * @throws ServerResponseException if the status code of response is 5xx |
|
352 | - * |
|
353 | - * @return Elasticsearch|Promise |
|
354 | - */ |
|
355 | - public function syncJobClaim(array $params = []) |
|
356 | - { |
|
357 | - $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
358 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_claim'; |
|
359 | - $method = 'PUT'; |
|
360 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
361 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
362 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
363 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_claim'); |
|
364 | - return $this->client->sendRequest($request); |
|
365 | - } |
|
366 | - /** |
|
367 | - * Deletes a connector sync job. |
|
368 | - * |
|
369 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html |
|
370 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
371 | - * |
|
372 | - * @param array{ |
|
373 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be deleted. |
|
374 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
375 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
376 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
377 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
378 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
379 | - * } $params |
|
380 | - * |
|
381 | - * @throws MissingParameterException if a required parameter is missing |
|
382 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
383 | - * @throws ClientResponseException if the status code of response is 4xx |
|
384 | - * @throws ServerResponseException if the status code of response is 5xx |
|
385 | - * |
|
386 | - * @return Elasticsearch|Promise |
|
387 | - */ |
|
388 | - public function syncJobDelete(array $params = []) |
|
389 | - { |
|
390 | - $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
391 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
392 | - $method = 'DELETE'; |
|
393 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | - $headers = ['Accept' => 'application/json']; |
|
395 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
396 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_delete'); |
|
397 | - return $this->client->sendRequest($request); |
|
398 | - } |
|
399 | - /** |
|
400 | - * Sets an error for a connector sync job. |
|
401 | - * |
|
402 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html |
|
403 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
404 | - * |
|
405 | - * @param array{ |
|
406 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to set an error for. |
|
407 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
408 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
409 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
410 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
411 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
412 | - * body: array, // (REQUIRED) The error to set in the connector sync job. |
|
413 | - * } $params |
|
414 | - * |
|
415 | - * @throws MissingParameterException if a required parameter is missing |
|
416 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
417 | - * @throws ClientResponseException if the status code of response is 4xx |
|
418 | - * @throws ServerResponseException if the status code of response is 5xx |
|
419 | - * |
|
420 | - * @return Elasticsearch|Promise |
|
421 | - */ |
|
422 | - public function syncJobError(array $params = []) |
|
423 | - { |
|
424 | - $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
425 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_error'; |
|
426 | - $method = 'PUT'; |
|
427 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
428 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
429 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
430 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_error'); |
|
431 | - return $this->client->sendRequest($request); |
|
432 | - } |
|
433 | - /** |
|
434 | - * Returns the details about a connector sync job. |
|
435 | - * |
|
436 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html |
|
437 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
438 | - * |
|
439 | - * @param array{ |
|
440 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be returned. |
|
441 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
442 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
443 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
444 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
445 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
446 | - * } $params |
|
447 | - * |
|
448 | - * @throws MissingParameterException if a required parameter is missing |
|
449 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
450 | - * @throws ClientResponseException if the status code of response is 4xx |
|
451 | - * @throws ServerResponseException if the status code of response is 5xx |
|
452 | - * |
|
453 | - * @return Elasticsearch|Promise |
|
454 | - */ |
|
455 | - public function syncJobGet(array $params = []) |
|
456 | - { |
|
457 | - $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
458 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
459 | - $method = 'GET'; |
|
460 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
461 | - $headers = ['Accept' => 'application/json']; |
|
462 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
463 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_get'); |
|
464 | - return $this->client->sendRequest($request); |
|
465 | - } |
|
466 | - /** |
|
467 | - * Lists all connector sync jobs. |
|
468 | - * |
|
469 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html |
|
470 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
471 | - * |
|
472 | - * @param array{ |
|
473 | - * from: int, // Starting offset (default: 0) |
|
474 | - * size: int, // specifies a max number of results to get (default: 100) |
|
475 | - * status: string, // Sync job status, which sync jobs are fetched for |
|
476 | - * connector_id: string, // Id of the connector to fetch the sync jobs for |
|
477 | - * job_type: list, // A comma-separated list of job types |
|
478 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
479 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
480 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
481 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
482 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
483 | - * } $params |
|
484 | - * |
|
485 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
486 | - * @throws ClientResponseException if the status code of response is 4xx |
|
487 | - * @throws ServerResponseException if the status code of response is 5xx |
|
488 | - * |
|
489 | - * @return Elasticsearch|Promise |
|
490 | - */ |
|
491 | - public function syncJobList(array $params = []) |
|
492 | - { |
|
493 | - $url = '/_connector/_sync_job'; |
|
494 | - $method = 'GET'; |
|
495 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'status', 'connector_id', 'job_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
496 | - $headers = ['Accept' => 'application/json']; |
|
497 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
498 | - $request = $this->addOtelAttributes($params, [], $request, 'connector.sync_job_list'); |
|
499 | - return $this->client->sendRequest($request); |
|
500 | - } |
|
501 | - /** |
|
502 | - * Creates a connector sync job. |
|
503 | - * |
|
504 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html |
|
505 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
506 | - * |
|
507 | - * @param array{ |
|
508 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
509 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
510 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
511 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
512 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
513 | - * body: array, // (REQUIRED) The connector sync job data. |
|
514 | - * } $params |
|
515 | - * |
|
516 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
517 | - * @throws ClientResponseException if the status code of response is 4xx |
|
518 | - * @throws ServerResponseException if the status code of response is 5xx |
|
519 | - * |
|
520 | - * @return Elasticsearch|Promise |
|
521 | - */ |
|
522 | - public function syncJobPost(array $params = []) |
|
523 | - { |
|
524 | - $this->checkRequiredParameters(['body'], $params); |
|
525 | - $url = '/_connector/_sync_job'; |
|
526 | - $method = 'POST'; |
|
527 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
528 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
529 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
530 | - $request = $this->addOtelAttributes($params, [], $request, 'connector.sync_job_post'); |
|
531 | - return $this->client->sendRequest($request); |
|
532 | - } |
|
533 | - /** |
|
534 | - * Updates the stats fields in the connector sync job document. |
|
535 | - * |
|
536 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html |
|
537 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
538 | - * |
|
539 | - * @param array{ |
|
540 | - * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be updated. |
|
541 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
542 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
543 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
544 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
545 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
546 | - * body: array, // (REQUIRED) The stats to update for the connector sync job. |
|
547 | - * } $params |
|
548 | - * |
|
549 | - * @throws MissingParameterException if a required parameter is missing |
|
550 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
551 | - * @throws ClientResponseException if the status code of response is 4xx |
|
552 | - * @throws ServerResponseException if the status code of response is 5xx |
|
553 | - * |
|
554 | - * @return Elasticsearch|Promise |
|
555 | - */ |
|
556 | - public function syncJobUpdateStats(array $params = []) |
|
557 | - { |
|
558 | - $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
559 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_stats'; |
|
560 | - $method = 'PUT'; |
|
561 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
562 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
563 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
564 | - $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_update_stats'); |
|
565 | - return $this->client->sendRequest($request); |
|
566 | - } |
|
567 | - /** |
|
568 | - * Activates the draft filtering rules if they are in a validated state. |
|
569 | - * |
|
570 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
571 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
572 | - * |
|
573 | - * @param array{ |
|
574 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
575 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
576 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
577 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
578 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
579 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
580 | - * } $params |
|
581 | - * |
|
582 | - * @throws MissingParameterException if a required parameter is missing |
|
583 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
584 | - * @throws ClientResponseException if the status code of response is 4xx |
|
585 | - * @throws ServerResponseException if the status code of response is 5xx |
|
586 | - * |
|
587 | - * @return Elasticsearch|Promise |
|
588 | - */ |
|
589 | - public function updateActiveFiltering(array $params = []) |
|
590 | - { |
|
591 | - $this->checkRequiredParameters(['connector_id'], $params); |
|
592 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_activate'; |
|
593 | - $method = 'PUT'; |
|
594 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
595 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
596 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
597 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_active_filtering'); |
|
598 | - return $this->client->sendRequest($request); |
|
599 | - } |
|
600 | - /** |
|
601 | - * Updates the API key id and/or API key secret id fields in the connector document. |
|
602 | - * |
|
603 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html |
|
604 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
605 | - * |
|
606 | - * @param array{ |
|
607 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
608 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
609 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
610 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
611 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
612 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
613 | - * body: array, // (REQUIRED) An object containing the connector's API key id and/or Connector Secret document id for that API key. |
|
614 | - * } $params |
|
615 | - * |
|
616 | - * @throws MissingParameterException if a required parameter is missing |
|
617 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
618 | - * @throws ClientResponseException if the status code of response is 4xx |
|
619 | - * @throws ServerResponseException if the status code of response is 5xx |
|
620 | - * |
|
621 | - * @return Elasticsearch|Promise |
|
622 | - */ |
|
623 | - public function updateApiKeyId(array $params = []) |
|
624 | - { |
|
625 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
626 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id'; |
|
627 | - $method = 'PUT'; |
|
628 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
629 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
630 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
631 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_api_key_id'); |
|
632 | - return $this->client->sendRequest($request); |
|
633 | - } |
|
634 | - /** |
|
635 | - * Updates the connector configuration. |
|
636 | - * |
|
637 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html |
|
638 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
639 | - * |
|
640 | - * @param array{ |
|
641 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
642 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
643 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
644 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
645 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
646 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
647 | - * body: array, // (REQUIRED) Mapping between field names to configuration. |
|
648 | - * } $params |
|
649 | - * |
|
650 | - * @throws MissingParameterException if a required parameter is missing |
|
651 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
652 | - * @throws ClientResponseException if the status code of response is 4xx |
|
653 | - * @throws ServerResponseException if the status code of response is 5xx |
|
654 | - * |
|
655 | - * @return Elasticsearch|Promise |
|
656 | - */ |
|
657 | - public function updateConfiguration(array $params = []) |
|
658 | - { |
|
659 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
660 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration'; |
|
661 | - $method = 'PUT'; |
|
662 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
663 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
664 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
665 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_configuration'); |
|
666 | - return $this->client->sendRequest($request); |
|
667 | - } |
|
668 | - /** |
|
669 | - * Updates the error field in the connector document. |
|
670 | - * |
|
671 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html |
|
672 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
673 | - * |
|
674 | - * @param array{ |
|
675 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
676 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
677 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
678 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
679 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
680 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
681 | - * body: array, // (REQUIRED) An object containing the connector's error. |
|
682 | - * } $params |
|
683 | - * |
|
684 | - * @throws MissingParameterException if a required parameter is missing |
|
685 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
686 | - * @throws ClientResponseException if the status code of response is 4xx |
|
687 | - * @throws ServerResponseException if the status code of response is 5xx |
|
688 | - * |
|
689 | - * @return Elasticsearch|Promise |
|
690 | - */ |
|
691 | - public function updateError(array $params = []) |
|
692 | - { |
|
693 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
694 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_error'; |
|
695 | - $method = 'PUT'; |
|
696 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
697 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
698 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
699 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_error'); |
|
700 | - return $this->client->sendRequest($request); |
|
701 | - } |
|
702 | - /** |
|
703 | - * Updates the connector features in the connector document. |
|
704 | - * |
|
705 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-features-api.html |
|
706 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
707 | - * |
|
708 | - * @param array{ |
|
709 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
710 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
711 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
712 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
713 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
714 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
715 | - * body: array, // (REQUIRED) An object containing the connector's features definition. |
|
716 | - * } $params |
|
717 | - * |
|
718 | - * @throws MissingParameterException if a required parameter is missing |
|
719 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
720 | - * @throws ClientResponseException if the status code of response is 4xx |
|
721 | - * @throws ServerResponseException if the status code of response is 5xx |
|
722 | - * |
|
723 | - * @return Elasticsearch|Promise |
|
724 | - */ |
|
725 | - public function updateFeatures(array $params = []) |
|
726 | - { |
|
727 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
728 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_features'; |
|
729 | - $method = 'PUT'; |
|
730 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
731 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
732 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
733 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_features'); |
|
734 | - return $this->client->sendRequest($request); |
|
735 | - } |
|
736 | - /** |
|
737 | - * Updates the filtering field in the connector document. |
|
738 | - * |
|
739 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
740 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
741 | - * |
|
742 | - * @param array{ |
|
743 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
744 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
745 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
746 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
747 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
748 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
749 | - * body: array, // (REQUIRED) A list of connector filtering configurations. |
|
750 | - * } $params |
|
751 | - * |
|
752 | - * @throws MissingParameterException if a required parameter is missing |
|
753 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
754 | - * @throws ClientResponseException if the status code of response is 4xx |
|
755 | - * @throws ServerResponseException if the status code of response is 5xx |
|
756 | - * |
|
757 | - * @return Elasticsearch|Promise |
|
758 | - */ |
|
759 | - public function updateFiltering(array $params = []) |
|
760 | - { |
|
761 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
762 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering'; |
|
763 | - $method = 'PUT'; |
|
764 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
765 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
766 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
767 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_filtering'); |
|
768 | - return $this->client->sendRequest($request); |
|
769 | - } |
|
770 | - /** |
|
771 | - * Updates the validation info of the draft filtering rules. |
|
772 | - * |
|
773 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
774 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
775 | - * |
|
776 | - * @param array{ |
|
777 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
778 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
779 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
780 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
781 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
782 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
783 | - * body: array, // (REQUIRED) Validation info for the draft filtering rules |
|
784 | - * } $params |
|
785 | - * |
|
786 | - * @throws MissingParameterException if a required parameter is missing |
|
787 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
788 | - * @throws ClientResponseException if the status code of response is 4xx |
|
789 | - * @throws ServerResponseException if the status code of response is 5xx |
|
790 | - * |
|
791 | - * @return Elasticsearch|Promise |
|
792 | - */ |
|
793 | - public function updateFilteringValidation(array $params = []) |
|
794 | - { |
|
795 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
796 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_validation'; |
|
797 | - $method = 'PUT'; |
|
798 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
799 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
800 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
801 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_filtering_validation'); |
|
802 | - return $this->client->sendRequest($request); |
|
803 | - } |
|
804 | - /** |
|
805 | - * Updates the index name of the connector. |
|
806 | - * |
|
807 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html |
|
808 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
809 | - * |
|
810 | - * @param array{ |
|
811 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
812 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
813 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
814 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
815 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
816 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
817 | - * body: array, // (REQUIRED) An object containing the connector's index name. |
|
818 | - * } $params |
|
819 | - * |
|
820 | - * @throws MissingParameterException if a required parameter is missing |
|
821 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
822 | - * @throws ClientResponseException if the status code of response is 4xx |
|
823 | - * @throws ServerResponseException if the status code of response is 5xx |
|
824 | - * |
|
825 | - * @return Elasticsearch|Promise |
|
826 | - */ |
|
827 | - public function updateIndexName(array $params = []) |
|
828 | - { |
|
829 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
830 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name'; |
|
831 | - $method = 'PUT'; |
|
832 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
833 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
834 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
835 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_index_name'); |
|
836 | - return $this->client->sendRequest($request); |
|
837 | - } |
|
838 | - /** |
|
839 | - * Updates the name and/or description fields in the connector document. |
|
840 | - * |
|
841 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html |
|
842 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
843 | - * |
|
844 | - * @param array{ |
|
845 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
846 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
847 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
848 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
849 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
850 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
851 | - * body: array, // (REQUIRED) An object containing the connector's name and/or description. |
|
852 | - * } $params |
|
853 | - * |
|
854 | - * @throws MissingParameterException if a required parameter is missing |
|
855 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
856 | - * @throws ClientResponseException if the status code of response is 4xx |
|
857 | - * @throws ServerResponseException if the status code of response is 5xx |
|
858 | - * |
|
859 | - * @return Elasticsearch|Promise |
|
860 | - */ |
|
861 | - public function updateName(array $params = []) |
|
862 | - { |
|
863 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
864 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_name'; |
|
865 | - $method = 'PUT'; |
|
866 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
867 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
868 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
869 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_name'); |
|
870 | - return $this->client->sendRequest($request); |
|
871 | - } |
|
872 | - /** |
|
873 | - * Updates the is_native flag of the connector. |
|
874 | - * |
|
875 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html |
|
876 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
877 | - * |
|
878 | - * @param array{ |
|
879 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
880 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
881 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
882 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
883 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
884 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
885 | - * body: array, // (REQUIRED) An object containing the connector's is_native flag |
|
886 | - * } $params |
|
887 | - * |
|
888 | - * @throws MissingParameterException if a required parameter is missing |
|
889 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
890 | - * @throws ClientResponseException if the status code of response is 4xx |
|
891 | - * @throws ServerResponseException if the status code of response is 5xx |
|
892 | - * |
|
893 | - * @return Elasticsearch|Promise |
|
894 | - */ |
|
895 | - public function updateNative(array $params = []) |
|
896 | - { |
|
897 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
898 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_native'; |
|
899 | - $method = 'PUT'; |
|
900 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
901 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
902 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
903 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_native'); |
|
904 | - return $this->client->sendRequest($request); |
|
905 | - } |
|
906 | - /** |
|
907 | - * Updates the pipeline field in the connector document. |
|
908 | - * |
|
909 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html |
|
910 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
911 | - * |
|
912 | - * @param array{ |
|
913 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
914 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
915 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
916 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
917 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
918 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
919 | - * body: array, // (REQUIRED) An object with connector ingest pipeline configuration. |
|
920 | - * } $params |
|
921 | - * |
|
922 | - * @throws MissingParameterException if a required parameter is missing |
|
923 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
924 | - * @throws ClientResponseException if the status code of response is 4xx |
|
925 | - * @throws ServerResponseException if the status code of response is 5xx |
|
926 | - * |
|
927 | - * @return Elasticsearch|Promise |
|
928 | - */ |
|
929 | - public function updatePipeline(array $params = []) |
|
930 | - { |
|
931 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
932 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline'; |
|
933 | - $method = 'PUT'; |
|
934 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
935 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
936 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
937 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_pipeline'); |
|
938 | - return $this->client->sendRequest($request); |
|
939 | - } |
|
940 | - /** |
|
941 | - * Updates the scheduling field in the connector document. |
|
942 | - * |
|
943 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html |
|
944 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
945 | - * |
|
946 | - * @param array{ |
|
947 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
948 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
949 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
950 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
951 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
952 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
953 | - * body: array, // (REQUIRED) An object containing the connector's scheduling configuration. |
|
954 | - * } $params |
|
955 | - * |
|
956 | - * @throws MissingParameterException if a required parameter is missing |
|
957 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
958 | - * @throws ClientResponseException if the status code of response is 4xx |
|
959 | - * @throws ServerResponseException if the status code of response is 5xx |
|
960 | - * |
|
961 | - * @return Elasticsearch|Promise |
|
962 | - */ |
|
963 | - public function updateScheduling(array $params = []) |
|
964 | - { |
|
965 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
966 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling'; |
|
967 | - $method = 'PUT'; |
|
968 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
969 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
970 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
971 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_scheduling'); |
|
972 | - return $this->client->sendRequest($request); |
|
973 | - } |
|
974 | - /** |
|
975 | - * Updates the service type of the connector. |
|
976 | - * |
|
977 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html |
|
978 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
979 | - * |
|
980 | - * @param array{ |
|
981 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
982 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
983 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
984 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
985 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
986 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
987 | - * body: array, // (REQUIRED) An object containing the connector's service type. |
|
988 | - * } $params |
|
989 | - * |
|
990 | - * @throws MissingParameterException if a required parameter is missing |
|
991 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
992 | - * @throws ClientResponseException if the status code of response is 4xx |
|
993 | - * @throws ServerResponseException if the status code of response is 5xx |
|
994 | - * |
|
995 | - * @return Elasticsearch|Promise |
|
996 | - */ |
|
997 | - public function updateServiceType(array $params = []) |
|
998 | - { |
|
999 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
1000 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type'; |
|
1001 | - $method = 'PUT'; |
|
1002 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1003 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1004 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1005 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_service_type'); |
|
1006 | - return $this->client->sendRequest($request); |
|
1007 | - } |
|
1008 | - /** |
|
1009 | - * Updates the status of the connector. |
|
1010 | - * |
|
1011 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html |
|
1012 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
1013 | - * |
|
1014 | - * @param array{ |
|
1015 | - * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
1016 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1017 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1018 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1019 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1020 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1021 | - * body: array, // (REQUIRED) An object containing the connector's status. |
|
1022 | - * } $params |
|
1023 | - * |
|
1024 | - * @throws MissingParameterException if a required parameter is missing |
|
1025 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1026 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1027 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1028 | - * |
|
1029 | - * @return Elasticsearch|Promise |
|
1030 | - */ |
|
1031 | - public function updateStatus(array $params = []) |
|
1032 | - { |
|
1033 | - $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
1034 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_status'; |
|
1035 | - $method = 'PUT'; |
|
1036 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1037 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1038 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1039 | - $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_status'); |
|
1040 | - return $this->client->sendRequest($request); |
|
1041 | - } |
|
28 | + /** |
|
29 | + * Updates the last_seen timestamp in the connector document. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
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 checkIn(array $params = []) |
|
51 | + { |
|
52 | + $this->checkRequiredParameters(['connector_id'], $params); |
|
53 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in'; |
|
54 | + $method = 'PUT'; |
|
55 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
56 | + $headers = ['Accept' => 'application/json']; |
|
57 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
58 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.check_in'); |
|
59 | + return $this->client->sendRequest($request); |
|
60 | + } |
|
61 | + /** |
|
62 | + * Deletes a connector. |
|
63 | + * |
|
64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html |
|
65 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
66 | + * |
|
67 | + * @param array{ |
|
68 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be deleted. |
|
69 | + * delete_sync_jobs: boolean, // Determines whether associated sync jobs are also deleted. |
|
70 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
71 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
72 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
73 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
74 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
75 | + * } $params |
|
76 | + * |
|
77 | + * @throws MissingParameterException if a required parameter is missing |
|
78 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
79 | + * @throws ClientResponseException if the status code of response is 4xx |
|
80 | + * @throws ServerResponseException if the status code of response is 5xx |
|
81 | + * |
|
82 | + * @return Elasticsearch|Promise |
|
83 | + */ |
|
84 | + public function delete(array $params = []) |
|
85 | + { |
|
86 | + $this->checkRequiredParameters(['connector_id'], $params); |
|
87 | + $url = '/_connector/' . $this->encode($params['connector_id']); |
|
88 | + $method = 'DELETE'; |
|
89 | + $url = $this->addQueryString($url, $params, ['delete_sync_jobs', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
90 | + $headers = ['Accept' => 'application/json']; |
|
91 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
92 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.delete'); |
|
93 | + return $this->client->sendRequest($request); |
|
94 | + } |
|
95 | + /** |
|
96 | + * Returns the details about a connector. |
|
97 | + * |
|
98 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html |
|
99 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
100 | + * |
|
101 | + * @param array{ |
|
102 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be returned. |
|
103 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
104 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
105 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
106 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
107 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
108 | + * } $params |
|
109 | + * |
|
110 | + * @throws MissingParameterException if a required parameter is missing |
|
111 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
112 | + * @throws ClientResponseException if the status code of response is 4xx |
|
113 | + * @throws ServerResponseException if the status code of response is 5xx |
|
114 | + * |
|
115 | + * @return Elasticsearch|Promise |
|
116 | + */ |
|
117 | + public function get(array $params = []) |
|
118 | + { |
|
119 | + $this->checkRequiredParameters(['connector_id'], $params); |
|
120 | + $url = '/_connector/' . $this->encode($params['connector_id']); |
|
121 | + $method = 'GET'; |
|
122 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
123 | + $headers = ['Accept' => 'application/json']; |
|
124 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
125 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.get'); |
|
126 | + return $this->client->sendRequest($request); |
|
127 | + } |
|
128 | + /** |
|
129 | + * Updates the stats of last sync in the connector document. |
|
130 | + * |
|
131 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-last-sync-api.html |
|
132 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
133 | + * |
|
134 | + * @param array{ |
|
135 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
136 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
137 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
138 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
139 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
140 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
141 | + * body: array, // (REQUIRED) Object with stats related to the last connector sync run. |
|
142 | + * } $params |
|
143 | + * |
|
144 | + * @throws MissingParameterException if a required parameter is missing |
|
145 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
146 | + * @throws ClientResponseException if the status code of response is 4xx |
|
147 | + * @throws ServerResponseException if the status code of response is 5xx |
|
148 | + * |
|
149 | + * @return Elasticsearch|Promise |
|
150 | + */ |
|
151 | + public function lastSync(array $params = []) |
|
152 | + { |
|
153 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
154 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync'; |
|
155 | + $method = 'PUT'; |
|
156 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
157 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
158 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
159 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.last_sync'); |
|
160 | + return $this->client->sendRequest($request); |
|
161 | + } |
|
162 | + /** |
|
163 | + * Lists all connectors. |
|
164 | + * |
|
165 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html |
|
166 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
167 | + * |
|
168 | + * @param array{ |
|
169 | + * from: int, // Starting offset (default: 0) |
|
170 | + * size: int, // Specifies a max number of results to get (default: 100) |
|
171 | + * index_name: list, // A comma-separated list of connector index names to fetch connector documents for |
|
172 | + * connector_name: list, // A comma-separated list of connector names to fetch connector documents for |
|
173 | + * service_type: list, // A comma-separated list of connector service types to fetch connector documents for |
|
174 | + * query: string, // A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names |
|
175 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
176 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
177 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
178 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
179 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
180 | + * } $params |
|
181 | + * |
|
182 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
183 | + * @throws ClientResponseException if the status code of response is 4xx |
|
184 | + * @throws ServerResponseException if the status code of response is 5xx |
|
185 | + * |
|
186 | + * @return Elasticsearch|Promise |
|
187 | + */ |
|
188 | + public function list(array $params = []) |
|
189 | + { |
|
190 | + $url = '/_connector'; |
|
191 | + $method = 'GET'; |
|
192 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'index_name', 'connector_name', 'service_type', 'query', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
193 | + $headers = ['Accept' => 'application/json']; |
|
194 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
195 | + $request = $this->addOtelAttributes($params, [], $request, 'connector.list'); |
|
196 | + return $this->client->sendRequest($request); |
|
197 | + } |
|
198 | + /** |
|
199 | + * Creates a connector. |
|
200 | + * |
|
201 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html |
|
202 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
203 | + * |
|
204 | + * @param array{ |
|
205 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
206 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
207 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
208 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
209 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
210 | + * body: array, // The connector configuration. |
|
211 | + * } $params |
|
212 | + * |
|
213 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
214 | + * @throws ClientResponseException if the status code of response is 4xx |
|
215 | + * @throws ServerResponseException if the status code of response is 5xx |
|
216 | + * |
|
217 | + * @return Elasticsearch|Promise |
|
218 | + */ |
|
219 | + public function post(array $params = []) |
|
220 | + { |
|
221 | + $url = '/_connector'; |
|
222 | + $method = 'POST'; |
|
223 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
224 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
225 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
226 | + $request = $this->addOtelAttributes($params, [], $request, 'connector.post'); |
|
227 | + return $this->client->sendRequest($request); |
|
228 | + } |
|
229 | + /** |
|
230 | + * Creates or updates a connector. |
|
231 | + * |
|
232 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html |
|
233 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
234 | + * |
|
235 | + * @param array{ |
|
236 | + * connector_id: string, // The unique identifier of the connector to be created or updated. |
|
237 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
238 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
239 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
240 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
241 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
242 | + * body: array, // The connector configuration. |
|
243 | + * } $params |
|
244 | + * |
|
245 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
246 | + * @throws ClientResponseException if the status code of response is 4xx |
|
247 | + * @throws ServerResponseException if the status code of response is 5xx |
|
248 | + * |
|
249 | + * @return Elasticsearch|Promise |
|
250 | + */ |
|
251 | + public function put(array $params = []) |
|
252 | + { |
|
253 | + if (isset($params['connector_id'])) { |
|
254 | + $url = '/_connector/' . $this->encode($params['connector_id']); |
|
255 | + $method = 'PUT'; |
|
256 | + } else { |
|
257 | + $url = '/_connector'; |
|
258 | + $method = 'PUT'; |
|
259 | + } |
|
260 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
261 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
262 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
263 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.put'); |
|
264 | + return $this->client->sendRequest($request); |
|
265 | + } |
|
266 | + /** |
|
267 | + * Cancels a connector sync job. |
|
268 | + * |
|
269 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html |
|
270 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
271 | + * |
|
272 | + * @param array{ |
|
273 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be canceled |
|
274 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
275 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
276 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
277 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
278 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
279 | + * } $params |
|
280 | + * |
|
281 | + * @throws MissingParameterException if a required parameter is missing |
|
282 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
283 | + * @throws ClientResponseException if the status code of response is 4xx |
|
284 | + * @throws ServerResponseException if the status code of response is 5xx |
|
285 | + * |
|
286 | + * @return Elasticsearch|Promise |
|
287 | + */ |
|
288 | + public function syncJobCancel(array $params = []) |
|
289 | + { |
|
290 | + $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
291 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_cancel'; |
|
292 | + $method = 'PUT'; |
|
293 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
294 | + $headers = ['Accept' => 'application/json']; |
|
295 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
296 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_cancel'); |
|
297 | + return $this->client->sendRequest($request); |
|
298 | + } |
|
299 | + /** |
|
300 | + * Checks in a connector sync job (refreshes 'last_seen'). |
|
301 | + * |
|
302 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-sync-job-api.html |
|
303 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
304 | + * |
|
305 | + * @param array{ |
|
306 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be checked in |
|
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 syncJobCheckIn(array $params = []) |
|
322 | + { |
|
323 | + $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
324 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_check_in'; |
|
325 | + $method = 'PUT'; |
|
326 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
327 | + $headers = ['Accept' => 'application/json']; |
|
328 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
329 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_check_in'); |
|
330 | + return $this->client->sendRequest($request); |
|
331 | + } |
|
332 | + /** |
|
333 | + * Claims a connector sync job. |
|
334 | + * |
|
335 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/claim-connector-sync-job-api.html |
|
336 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
337 | + * |
|
338 | + * @param array{ |
|
339 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be claimed. |
|
340 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
345 | + * body: array, // (REQUIRED) Data to claim a sync job. |
|
346 | + * } $params |
|
347 | + * |
|
348 | + * @throws MissingParameterException if a required parameter is missing |
|
349 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
350 | + * @throws ClientResponseException if the status code of response is 4xx |
|
351 | + * @throws ServerResponseException if the status code of response is 5xx |
|
352 | + * |
|
353 | + * @return Elasticsearch|Promise |
|
354 | + */ |
|
355 | + public function syncJobClaim(array $params = []) |
|
356 | + { |
|
357 | + $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
358 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_claim'; |
|
359 | + $method = 'PUT'; |
|
360 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
361 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
362 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
363 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_claim'); |
|
364 | + return $this->client->sendRequest($request); |
|
365 | + } |
|
366 | + /** |
|
367 | + * Deletes a connector sync job. |
|
368 | + * |
|
369 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html |
|
370 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
371 | + * |
|
372 | + * @param array{ |
|
373 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be deleted. |
|
374 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
375 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
376 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
377 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
378 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
379 | + * } $params |
|
380 | + * |
|
381 | + * @throws MissingParameterException if a required parameter is missing |
|
382 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
383 | + * @throws ClientResponseException if the status code of response is 4xx |
|
384 | + * @throws ServerResponseException if the status code of response is 5xx |
|
385 | + * |
|
386 | + * @return Elasticsearch|Promise |
|
387 | + */ |
|
388 | + public function syncJobDelete(array $params = []) |
|
389 | + { |
|
390 | + $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
391 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
392 | + $method = 'DELETE'; |
|
393 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
394 | + $headers = ['Accept' => 'application/json']; |
|
395 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
396 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_delete'); |
|
397 | + return $this->client->sendRequest($request); |
|
398 | + } |
|
399 | + /** |
|
400 | + * Sets an error for a connector sync job. |
|
401 | + * |
|
402 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html |
|
403 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
404 | + * |
|
405 | + * @param array{ |
|
406 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to set an error for. |
|
407 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
408 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
409 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
410 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
411 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
412 | + * body: array, // (REQUIRED) The error to set in the connector sync job. |
|
413 | + * } $params |
|
414 | + * |
|
415 | + * @throws MissingParameterException if a required parameter is missing |
|
416 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
417 | + * @throws ClientResponseException if the status code of response is 4xx |
|
418 | + * @throws ServerResponseException if the status code of response is 5xx |
|
419 | + * |
|
420 | + * @return Elasticsearch|Promise |
|
421 | + */ |
|
422 | + public function syncJobError(array $params = []) |
|
423 | + { |
|
424 | + $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
425 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_error'; |
|
426 | + $method = 'PUT'; |
|
427 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
428 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
429 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
430 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_error'); |
|
431 | + return $this->client->sendRequest($request); |
|
432 | + } |
|
433 | + /** |
|
434 | + * Returns the details about a connector sync job. |
|
435 | + * |
|
436 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html |
|
437 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
438 | + * |
|
439 | + * @param array{ |
|
440 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be returned. |
|
441 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
442 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
443 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
444 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
445 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
446 | + * } $params |
|
447 | + * |
|
448 | + * @throws MissingParameterException if a required parameter is missing |
|
449 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
450 | + * @throws ClientResponseException if the status code of response is 4xx |
|
451 | + * @throws ServerResponseException if the status code of response is 5xx |
|
452 | + * |
|
453 | + * @return Elasticsearch|Promise |
|
454 | + */ |
|
455 | + public function syncJobGet(array $params = []) |
|
456 | + { |
|
457 | + $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
|
458 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
459 | + $method = 'GET'; |
|
460 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
461 | + $headers = ['Accept' => 'application/json']; |
|
462 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
463 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_get'); |
|
464 | + return $this->client->sendRequest($request); |
|
465 | + } |
|
466 | + /** |
|
467 | + * Lists all connector sync jobs. |
|
468 | + * |
|
469 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html |
|
470 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
471 | + * |
|
472 | + * @param array{ |
|
473 | + * from: int, // Starting offset (default: 0) |
|
474 | + * size: int, // specifies a max number of results to get (default: 100) |
|
475 | + * status: string, // Sync job status, which sync jobs are fetched for |
|
476 | + * connector_id: string, // Id of the connector to fetch the sync jobs for |
|
477 | + * job_type: list, // A comma-separated list of job types |
|
478 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
479 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
480 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
481 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
482 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
483 | + * } $params |
|
484 | + * |
|
485 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
486 | + * @throws ClientResponseException if the status code of response is 4xx |
|
487 | + * @throws ServerResponseException if the status code of response is 5xx |
|
488 | + * |
|
489 | + * @return Elasticsearch|Promise |
|
490 | + */ |
|
491 | + public function syncJobList(array $params = []) |
|
492 | + { |
|
493 | + $url = '/_connector/_sync_job'; |
|
494 | + $method = 'GET'; |
|
495 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'status', 'connector_id', 'job_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
496 | + $headers = ['Accept' => 'application/json']; |
|
497 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
498 | + $request = $this->addOtelAttributes($params, [], $request, 'connector.sync_job_list'); |
|
499 | + return $this->client->sendRequest($request); |
|
500 | + } |
|
501 | + /** |
|
502 | + * Creates a connector sync job. |
|
503 | + * |
|
504 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html |
|
505 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
506 | + * |
|
507 | + * @param array{ |
|
508 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
509 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
510 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
511 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
512 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
513 | + * body: array, // (REQUIRED) The connector sync job data. |
|
514 | + * } $params |
|
515 | + * |
|
516 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
517 | + * @throws ClientResponseException if the status code of response is 4xx |
|
518 | + * @throws ServerResponseException if the status code of response is 5xx |
|
519 | + * |
|
520 | + * @return Elasticsearch|Promise |
|
521 | + */ |
|
522 | + public function syncJobPost(array $params = []) |
|
523 | + { |
|
524 | + $this->checkRequiredParameters(['body'], $params); |
|
525 | + $url = '/_connector/_sync_job'; |
|
526 | + $method = 'POST'; |
|
527 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
528 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
529 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
530 | + $request = $this->addOtelAttributes($params, [], $request, 'connector.sync_job_post'); |
|
531 | + return $this->client->sendRequest($request); |
|
532 | + } |
|
533 | + /** |
|
534 | + * Updates the stats fields in the connector sync job document. |
|
535 | + * |
|
536 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html |
|
537 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
538 | + * |
|
539 | + * @param array{ |
|
540 | + * connector_sync_job_id: string, // (REQUIRED) The unique identifier of the connector sync job to be updated. |
|
541 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
542 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
543 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
544 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
545 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
546 | + * body: array, // (REQUIRED) The stats to update for the connector sync job. |
|
547 | + * } $params |
|
548 | + * |
|
549 | + * @throws MissingParameterException if a required parameter is missing |
|
550 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
551 | + * @throws ClientResponseException if the status code of response is 4xx |
|
552 | + * @throws ServerResponseException if the status code of response is 5xx |
|
553 | + * |
|
554 | + * @return Elasticsearch|Promise |
|
555 | + */ |
|
556 | + public function syncJobUpdateStats(array $params = []) |
|
557 | + { |
|
558 | + $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
|
559 | + $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_stats'; |
|
560 | + $method = 'PUT'; |
|
561 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
562 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
563 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
564 | + $request = $this->addOtelAttributes($params, ['connector_sync_job_id'], $request, 'connector.sync_job_update_stats'); |
|
565 | + return $this->client->sendRequest($request); |
|
566 | + } |
|
567 | + /** |
|
568 | + * Activates the draft filtering rules if they are in a validated state. |
|
569 | + * |
|
570 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
571 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
572 | + * |
|
573 | + * @param array{ |
|
574 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
575 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
576 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
577 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
578 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
579 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
580 | + * } $params |
|
581 | + * |
|
582 | + * @throws MissingParameterException if a required parameter is missing |
|
583 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
584 | + * @throws ClientResponseException if the status code of response is 4xx |
|
585 | + * @throws ServerResponseException if the status code of response is 5xx |
|
586 | + * |
|
587 | + * @return Elasticsearch|Promise |
|
588 | + */ |
|
589 | + public function updateActiveFiltering(array $params = []) |
|
590 | + { |
|
591 | + $this->checkRequiredParameters(['connector_id'], $params); |
|
592 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_activate'; |
|
593 | + $method = 'PUT'; |
|
594 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
595 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
596 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
597 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_active_filtering'); |
|
598 | + return $this->client->sendRequest($request); |
|
599 | + } |
|
600 | + /** |
|
601 | + * Updates the API key id and/or API key secret id fields in the connector document. |
|
602 | + * |
|
603 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html |
|
604 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
605 | + * |
|
606 | + * @param array{ |
|
607 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
608 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
609 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
610 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
611 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
612 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
613 | + * body: array, // (REQUIRED) An object containing the connector's API key id and/or Connector Secret document id for that API key. |
|
614 | + * } $params |
|
615 | + * |
|
616 | + * @throws MissingParameterException if a required parameter is missing |
|
617 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
618 | + * @throws ClientResponseException if the status code of response is 4xx |
|
619 | + * @throws ServerResponseException if the status code of response is 5xx |
|
620 | + * |
|
621 | + * @return Elasticsearch|Promise |
|
622 | + */ |
|
623 | + public function updateApiKeyId(array $params = []) |
|
624 | + { |
|
625 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
626 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id'; |
|
627 | + $method = 'PUT'; |
|
628 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
629 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
630 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
631 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_api_key_id'); |
|
632 | + return $this->client->sendRequest($request); |
|
633 | + } |
|
634 | + /** |
|
635 | + * Updates the connector configuration. |
|
636 | + * |
|
637 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html |
|
638 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
639 | + * |
|
640 | + * @param array{ |
|
641 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
642 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
643 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
644 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
645 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
646 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
647 | + * body: array, // (REQUIRED) Mapping between field names to configuration. |
|
648 | + * } $params |
|
649 | + * |
|
650 | + * @throws MissingParameterException if a required parameter is missing |
|
651 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
652 | + * @throws ClientResponseException if the status code of response is 4xx |
|
653 | + * @throws ServerResponseException if the status code of response is 5xx |
|
654 | + * |
|
655 | + * @return Elasticsearch|Promise |
|
656 | + */ |
|
657 | + public function updateConfiguration(array $params = []) |
|
658 | + { |
|
659 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
660 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration'; |
|
661 | + $method = 'PUT'; |
|
662 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
663 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
664 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
665 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_configuration'); |
|
666 | + return $this->client->sendRequest($request); |
|
667 | + } |
|
668 | + /** |
|
669 | + * Updates the error field in the connector document. |
|
670 | + * |
|
671 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html |
|
672 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
673 | + * |
|
674 | + * @param array{ |
|
675 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
676 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
677 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
678 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
679 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
680 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
681 | + * body: array, // (REQUIRED) An object containing the connector's error. |
|
682 | + * } $params |
|
683 | + * |
|
684 | + * @throws MissingParameterException if a required parameter is missing |
|
685 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
686 | + * @throws ClientResponseException if the status code of response is 4xx |
|
687 | + * @throws ServerResponseException if the status code of response is 5xx |
|
688 | + * |
|
689 | + * @return Elasticsearch|Promise |
|
690 | + */ |
|
691 | + public function updateError(array $params = []) |
|
692 | + { |
|
693 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
694 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_error'; |
|
695 | + $method = 'PUT'; |
|
696 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
697 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
698 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
699 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_error'); |
|
700 | + return $this->client->sendRequest($request); |
|
701 | + } |
|
702 | + /** |
|
703 | + * Updates the connector features in the connector document. |
|
704 | + * |
|
705 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-features-api.html |
|
706 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
707 | + * |
|
708 | + * @param array{ |
|
709 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
710 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
711 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
712 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
713 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
714 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
715 | + * body: array, // (REQUIRED) An object containing the connector's features definition. |
|
716 | + * } $params |
|
717 | + * |
|
718 | + * @throws MissingParameterException if a required parameter is missing |
|
719 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
720 | + * @throws ClientResponseException if the status code of response is 4xx |
|
721 | + * @throws ServerResponseException if the status code of response is 5xx |
|
722 | + * |
|
723 | + * @return Elasticsearch|Promise |
|
724 | + */ |
|
725 | + public function updateFeatures(array $params = []) |
|
726 | + { |
|
727 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
728 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_features'; |
|
729 | + $method = 'PUT'; |
|
730 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
731 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
732 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
733 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_features'); |
|
734 | + return $this->client->sendRequest($request); |
|
735 | + } |
|
736 | + /** |
|
737 | + * Updates the filtering field in the connector document. |
|
738 | + * |
|
739 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
740 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
741 | + * |
|
742 | + * @param array{ |
|
743 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
744 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
745 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
746 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
747 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
748 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
749 | + * body: array, // (REQUIRED) A list of connector filtering configurations. |
|
750 | + * } $params |
|
751 | + * |
|
752 | + * @throws MissingParameterException if a required parameter is missing |
|
753 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
754 | + * @throws ClientResponseException if the status code of response is 4xx |
|
755 | + * @throws ServerResponseException if the status code of response is 5xx |
|
756 | + * |
|
757 | + * @return Elasticsearch|Promise |
|
758 | + */ |
|
759 | + public function updateFiltering(array $params = []) |
|
760 | + { |
|
761 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
762 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering'; |
|
763 | + $method = 'PUT'; |
|
764 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
765 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
766 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
767 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_filtering'); |
|
768 | + return $this->client->sendRequest($request); |
|
769 | + } |
|
770 | + /** |
|
771 | + * Updates the validation info of the draft filtering rules. |
|
772 | + * |
|
773 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html |
|
774 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
775 | + * |
|
776 | + * @param array{ |
|
777 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
778 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
779 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
780 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
781 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
782 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
783 | + * body: array, // (REQUIRED) Validation info for the draft filtering rules |
|
784 | + * } $params |
|
785 | + * |
|
786 | + * @throws MissingParameterException if a required parameter is missing |
|
787 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
788 | + * @throws ClientResponseException if the status code of response is 4xx |
|
789 | + * @throws ServerResponseException if the status code of response is 5xx |
|
790 | + * |
|
791 | + * @return Elasticsearch|Promise |
|
792 | + */ |
|
793 | + public function updateFilteringValidation(array $params = []) |
|
794 | + { |
|
795 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
796 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_validation'; |
|
797 | + $method = 'PUT'; |
|
798 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
799 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
800 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
801 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_filtering_validation'); |
|
802 | + return $this->client->sendRequest($request); |
|
803 | + } |
|
804 | + /** |
|
805 | + * Updates the index name of the connector. |
|
806 | + * |
|
807 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html |
|
808 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
809 | + * |
|
810 | + * @param array{ |
|
811 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
812 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
813 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
814 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
815 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
816 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
817 | + * body: array, // (REQUIRED) An object containing the connector's index name. |
|
818 | + * } $params |
|
819 | + * |
|
820 | + * @throws MissingParameterException if a required parameter is missing |
|
821 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
822 | + * @throws ClientResponseException if the status code of response is 4xx |
|
823 | + * @throws ServerResponseException if the status code of response is 5xx |
|
824 | + * |
|
825 | + * @return Elasticsearch|Promise |
|
826 | + */ |
|
827 | + public function updateIndexName(array $params = []) |
|
828 | + { |
|
829 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
830 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name'; |
|
831 | + $method = 'PUT'; |
|
832 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
833 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
834 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
835 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_index_name'); |
|
836 | + return $this->client->sendRequest($request); |
|
837 | + } |
|
838 | + /** |
|
839 | + * Updates the name and/or description fields in the connector document. |
|
840 | + * |
|
841 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html |
|
842 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
843 | + * |
|
844 | + * @param array{ |
|
845 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
846 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
847 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
848 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
849 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
850 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
851 | + * body: array, // (REQUIRED) An object containing the connector's name and/or description. |
|
852 | + * } $params |
|
853 | + * |
|
854 | + * @throws MissingParameterException if a required parameter is missing |
|
855 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
856 | + * @throws ClientResponseException if the status code of response is 4xx |
|
857 | + * @throws ServerResponseException if the status code of response is 5xx |
|
858 | + * |
|
859 | + * @return Elasticsearch|Promise |
|
860 | + */ |
|
861 | + public function updateName(array $params = []) |
|
862 | + { |
|
863 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
864 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_name'; |
|
865 | + $method = 'PUT'; |
|
866 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
867 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
868 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
869 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_name'); |
|
870 | + return $this->client->sendRequest($request); |
|
871 | + } |
|
872 | + /** |
|
873 | + * Updates the is_native flag of the connector. |
|
874 | + * |
|
875 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html |
|
876 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
877 | + * |
|
878 | + * @param array{ |
|
879 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
880 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
881 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
882 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
883 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
884 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
885 | + * body: array, // (REQUIRED) An object containing the connector's is_native flag |
|
886 | + * } $params |
|
887 | + * |
|
888 | + * @throws MissingParameterException if a required parameter is missing |
|
889 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
890 | + * @throws ClientResponseException if the status code of response is 4xx |
|
891 | + * @throws ServerResponseException if the status code of response is 5xx |
|
892 | + * |
|
893 | + * @return Elasticsearch|Promise |
|
894 | + */ |
|
895 | + public function updateNative(array $params = []) |
|
896 | + { |
|
897 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
898 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_native'; |
|
899 | + $method = 'PUT'; |
|
900 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
901 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
902 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
903 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_native'); |
|
904 | + return $this->client->sendRequest($request); |
|
905 | + } |
|
906 | + /** |
|
907 | + * Updates the pipeline field in the connector document. |
|
908 | + * |
|
909 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html |
|
910 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
911 | + * |
|
912 | + * @param array{ |
|
913 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
914 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
915 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
916 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
917 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
918 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
919 | + * body: array, // (REQUIRED) An object with connector ingest pipeline configuration. |
|
920 | + * } $params |
|
921 | + * |
|
922 | + * @throws MissingParameterException if a required parameter is missing |
|
923 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
924 | + * @throws ClientResponseException if the status code of response is 4xx |
|
925 | + * @throws ServerResponseException if the status code of response is 5xx |
|
926 | + * |
|
927 | + * @return Elasticsearch|Promise |
|
928 | + */ |
|
929 | + public function updatePipeline(array $params = []) |
|
930 | + { |
|
931 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
932 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline'; |
|
933 | + $method = 'PUT'; |
|
934 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
935 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
936 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
937 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_pipeline'); |
|
938 | + return $this->client->sendRequest($request); |
|
939 | + } |
|
940 | + /** |
|
941 | + * Updates the scheduling field in the connector document. |
|
942 | + * |
|
943 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html |
|
944 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
945 | + * |
|
946 | + * @param array{ |
|
947 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
948 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
949 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
950 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
951 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
952 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
953 | + * body: array, // (REQUIRED) An object containing the connector's scheduling configuration. |
|
954 | + * } $params |
|
955 | + * |
|
956 | + * @throws MissingParameterException if a required parameter is missing |
|
957 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
958 | + * @throws ClientResponseException if the status code of response is 4xx |
|
959 | + * @throws ServerResponseException if the status code of response is 5xx |
|
960 | + * |
|
961 | + * @return Elasticsearch|Promise |
|
962 | + */ |
|
963 | + public function updateScheduling(array $params = []) |
|
964 | + { |
|
965 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
966 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling'; |
|
967 | + $method = 'PUT'; |
|
968 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
969 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
970 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
971 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_scheduling'); |
|
972 | + return $this->client->sendRequest($request); |
|
973 | + } |
|
974 | + /** |
|
975 | + * Updates the service type of the connector. |
|
976 | + * |
|
977 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html |
|
978 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
979 | + * |
|
980 | + * @param array{ |
|
981 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
982 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
983 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
984 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
985 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
986 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
987 | + * body: array, // (REQUIRED) An object containing the connector's service type. |
|
988 | + * } $params |
|
989 | + * |
|
990 | + * @throws MissingParameterException if a required parameter is missing |
|
991 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
992 | + * @throws ClientResponseException if the status code of response is 4xx |
|
993 | + * @throws ServerResponseException if the status code of response is 5xx |
|
994 | + * |
|
995 | + * @return Elasticsearch|Promise |
|
996 | + */ |
|
997 | + public function updateServiceType(array $params = []) |
|
998 | + { |
|
999 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
1000 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type'; |
|
1001 | + $method = 'PUT'; |
|
1002 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1003 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1004 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1005 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_service_type'); |
|
1006 | + return $this->client->sendRequest($request); |
|
1007 | + } |
|
1008 | + /** |
|
1009 | + * Updates the status of the connector. |
|
1010 | + * |
|
1011 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html |
|
1012 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
1013 | + * |
|
1014 | + * @param array{ |
|
1015 | + * connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated. |
|
1016 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1017 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1018 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1019 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1020 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1021 | + * body: array, // (REQUIRED) An object containing the connector's status. |
|
1022 | + * } $params |
|
1023 | + * |
|
1024 | + * @throws MissingParameterException if a required parameter is missing |
|
1025 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1026 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1027 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1028 | + * |
|
1029 | + * @return Elasticsearch|Promise |
|
1030 | + */ |
|
1031 | + public function updateStatus(array $params = []) |
|
1032 | + { |
|
1033 | + $this->checkRequiredParameters(['connector_id', 'body'], $params); |
|
1034 | + $url = '/_connector/' . $this->encode($params['connector_id']) . '/_status'; |
|
1035 | + $method = 'PUT'; |
|
1036 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1037 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1038 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1039 | + $request = $this->addOtelAttributes($params, ['connector_id'], $request, 'connector.update_status'); |
|
1040 | + return $this->client->sendRequest($request); |
|
1041 | + } |
|
1042 | 1042 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function checkIn(array $params = []) |
51 | 51 | { |
52 | 52 | $this->checkRequiredParameters(['connector_id'], $params); |
53 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_check_in'; |
|
53 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_check_in'; |
|
54 | 54 | $method = 'PUT'; |
55 | 55 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
56 | 56 | $headers = ['Accept' => 'application/json']; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function delete(array $params = []) |
85 | 85 | { |
86 | 86 | $this->checkRequiredParameters(['connector_id'], $params); |
87 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
87 | + $url = '/_connector/'.$this->encode($params['connector_id']); |
|
88 | 88 | $method = 'DELETE'; |
89 | 89 | $url = $this->addQueryString($url, $params, ['delete_sync_jobs', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
90 | 90 | $headers = ['Accept' => 'application/json']; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | public function get(array $params = []) |
118 | 118 | { |
119 | 119 | $this->checkRequiredParameters(['connector_id'], $params); |
120 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
120 | + $url = '/_connector/'.$this->encode($params['connector_id']); |
|
121 | 121 | $method = 'GET'; |
122 | 122 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
123 | 123 | $headers = ['Accept' => 'application/json']; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function lastSync(array $params = []) |
152 | 152 | { |
153 | 153 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
154 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_last_sync'; |
|
154 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_last_sync'; |
|
155 | 155 | $method = 'PUT'; |
156 | 156 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
157 | 157 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | public function put(array $params = []) |
252 | 252 | { |
253 | 253 | if (isset($params['connector_id'])) { |
254 | - $url = '/_connector/' . $this->encode($params['connector_id']); |
|
254 | + $url = '/_connector/'.$this->encode($params['connector_id']); |
|
255 | 255 | $method = 'PUT'; |
256 | 256 | } else { |
257 | 257 | $url = '/_connector'; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | public function syncJobCancel(array $params = []) |
289 | 289 | { |
290 | 290 | $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
291 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_cancel'; |
|
291 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']).'/_cancel'; |
|
292 | 292 | $method = 'PUT'; |
293 | 293 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
294 | 294 | $headers = ['Accept' => 'application/json']; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function syncJobCheckIn(array $params = []) |
322 | 322 | { |
323 | 323 | $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
324 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_check_in'; |
|
324 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']).'/_check_in'; |
|
325 | 325 | $method = 'PUT'; |
326 | 326 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
327 | 327 | $headers = ['Accept' => 'application/json']; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | public function syncJobClaim(array $params = []) |
356 | 356 | { |
357 | 357 | $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
358 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_claim'; |
|
358 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']).'/_claim'; |
|
359 | 359 | $method = 'PUT'; |
360 | 360 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
361 | 361 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | public function syncJobDelete(array $params = []) |
389 | 389 | { |
390 | 390 | $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
391 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
391 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']); |
|
392 | 392 | $method = 'DELETE'; |
393 | 393 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
394 | 394 | $headers = ['Accept' => 'application/json']; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | public function syncJobError(array $params = []) |
423 | 423 | { |
424 | 424 | $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
425 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_error'; |
|
425 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']).'/_error'; |
|
426 | 426 | $method = 'PUT'; |
427 | 427 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
428 | 428 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | public function syncJobGet(array $params = []) |
456 | 456 | { |
457 | 457 | $this->checkRequiredParameters(['connector_sync_job_id'], $params); |
458 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']); |
|
458 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']); |
|
459 | 459 | $method = 'GET'; |
460 | 460 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
461 | 461 | $headers = ['Accept' => 'application/json']; |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | public function syncJobUpdateStats(array $params = []) |
557 | 557 | { |
558 | 558 | $this->checkRequiredParameters(['connector_sync_job_id', 'body'], $params); |
559 | - $url = '/_connector/_sync_job/' . $this->encode($params['connector_sync_job_id']) . '/_stats'; |
|
559 | + $url = '/_connector/_sync_job/'.$this->encode($params['connector_sync_job_id']).'/_stats'; |
|
560 | 560 | $method = 'PUT'; |
561 | 561 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
562 | 562 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | public function updateActiveFiltering(array $params = []) |
590 | 590 | { |
591 | 591 | $this->checkRequiredParameters(['connector_id'], $params); |
592 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_activate'; |
|
592 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_filtering/_activate'; |
|
593 | 593 | $method = 'PUT'; |
594 | 594 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
595 | 595 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | public function updateApiKeyId(array $params = []) |
624 | 624 | { |
625 | 625 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
626 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id'; |
|
626 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_api_key_id'; |
|
627 | 627 | $method = 'PUT'; |
628 | 628 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
629 | 629 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | public function updateConfiguration(array $params = []) |
658 | 658 | { |
659 | 659 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
660 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_configuration'; |
|
660 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_configuration'; |
|
661 | 661 | $method = 'PUT'; |
662 | 662 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
663 | 663 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | public function updateError(array $params = []) |
692 | 692 | { |
693 | 693 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
694 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_error'; |
|
694 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_error'; |
|
695 | 695 | $method = 'PUT'; |
696 | 696 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
697 | 697 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | public function updateFeatures(array $params = []) |
726 | 726 | { |
727 | 727 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
728 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_features'; |
|
728 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_features'; |
|
729 | 729 | $method = 'PUT'; |
730 | 730 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
731 | 731 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | public function updateFiltering(array $params = []) |
760 | 760 | { |
761 | 761 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
762 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering'; |
|
762 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_filtering'; |
|
763 | 763 | $method = 'PUT'; |
764 | 764 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
765 | 765 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | public function updateFilteringValidation(array $params = []) |
794 | 794 | { |
795 | 795 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
796 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_filtering/_validation'; |
|
796 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_filtering/_validation'; |
|
797 | 797 | $method = 'PUT'; |
798 | 798 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
799 | 799 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | public function updateIndexName(array $params = []) |
828 | 828 | { |
829 | 829 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
830 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name'; |
|
830 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_index_name'; |
|
831 | 831 | $method = 'PUT'; |
832 | 832 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
833 | 833 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | public function updateName(array $params = []) |
862 | 862 | { |
863 | 863 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
864 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_name'; |
|
864 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_name'; |
|
865 | 865 | $method = 'PUT'; |
866 | 866 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
867 | 867 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | public function updateNative(array $params = []) |
896 | 896 | { |
897 | 897 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
898 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_native'; |
|
898 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_native'; |
|
899 | 899 | $method = 'PUT'; |
900 | 900 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
901 | 901 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | public function updatePipeline(array $params = []) |
930 | 930 | { |
931 | 931 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
932 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_pipeline'; |
|
932 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_pipeline'; |
|
933 | 933 | $method = 'PUT'; |
934 | 934 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
935 | 935 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | public function updateScheduling(array $params = []) |
964 | 964 | { |
965 | 965 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
966 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_scheduling'; |
|
966 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_scheduling'; |
|
967 | 967 | $method = 'PUT'; |
968 | 968 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
969 | 969 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | public function updateServiceType(array $params = []) |
998 | 998 | { |
999 | 999 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
1000 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type'; |
|
1000 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_service_type'; |
|
1001 | 1001 | $method = 'PUT'; |
1002 | 1002 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1003 | 1003 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | public function updateStatus(array $params = []) |
1032 | 1032 | { |
1033 | 1033 | $this->checkRequiredParameters(['connector_id', 'body'], $params); |
1034 | - $url = '/_connector/' . $this->encode($params['connector_id']) . '/_status'; |
|
1034 | + $url = '/_connector/'.$this->encode($params['connector_id']).'/_status'; |
|
1035 | 1035 | $method = 'PUT'; |
1036 | 1036 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
1037 | 1037 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -25,107 +25,107 @@ |
||
25 | 25 | */ |
26 | 26 | class Esql extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Executes an ESQL request asynchronously |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
35 | - * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
36 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | - * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
43 | - * } $params |
|
44 | - * |
|
45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
48 | - * |
|
49 | - * @return Elasticsearch|Promise |
|
50 | - */ |
|
51 | - public function asyncQuery(array $params = []) |
|
52 | - { |
|
53 | - $this->checkRequiredParameters(['body'], $params); |
|
54 | - $url = '/_query/async'; |
|
55 | - $method = 'POST'; |
|
56 | - $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
58 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | - $request = $this->addOtelAttributes($params, [], $request, 'esql.async_query'); |
|
60 | - return $this->client->sendRequest($request); |
|
61 | - } |
|
62 | - /** |
|
63 | - * Retrieves the results of a previously submitted async query request given its ID. |
|
64 | - * |
|
65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html |
|
66 | - * |
|
67 | - * @param array{ |
|
68 | - * id: string, // (REQUIRED) The async query ID |
|
69 | - * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
70 | - * keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available |
|
71 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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 MissingParameterException if a required parameter is missing |
|
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 asyncQueryGet(array $params = []) |
|
87 | - { |
|
88 | - $this->checkRequiredParameters(['id'], $params); |
|
89 | - $url = '/_query/async/' . $this->encode($params['id']); |
|
90 | - $method = 'GET'; |
|
91 | - $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
92 | - $headers = ['Accept' => 'application/json']; |
|
93 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
94 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'esql.async_query_get'); |
|
95 | - return $this->client->sendRequest($request); |
|
96 | - } |
|
97 | - /** |
|
98 | - * Executes an ESQL request |
|
99 | - * |
|
100 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html |
|
101 | - * |
|
102 | - * @param array{ |
|
103 | - * format: string, // a short version of the Accept header, e.g. json, yaml |
|
104 | - * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
105 | - * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
106 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
107 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
108 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
109 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
110 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
111 | - * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
112 | - * } $params |
|
113 | - * |
|
114 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
115 | - * @throws ClientResponseException if the status code of response is 4xx |
|
116 | - * @throws ServerResponseException if the status code of response is 5xx |
|
117 | - * |
|
118 | - * @return Elasticsearch|Promise |
|
119 | - */ |
|
120 | - public function query(array $params = []) |
|
121 | - { |
|
122 | - $this->checkRequiredParameters(['body'], $params); |
|
123 | - $url = '/_query'; |
|
124 | - $method = 'POST'; |
|
125 | - $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
127 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | - $request = $this->addOtelAttributes($params, [], $request, 'esql.query'); |
|
129 | - return $this->client->sendRequest($request); |
|
130 | - } |
|
28 | + /** |
|
29 | + * Executes an ESQL request asynchronously |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
35 | + * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
36 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | + * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
43 | + * } $params |
|
44 | + * |
|
45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
48 | + * |
|
49 | + * @return Elasticsearch|Promise |
|
50 | + */ |
|
51 | + public function asyncQuery(array $params = []) |
|
52 | + { |
|
53 | + $this->checkRequiredParameters(['body'], $params); |
|
54 | + $url = '/_query/async'; |
|
55 | + $method = 'POST'; |
|
56 | + $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
58 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | + $request = $this->addOtelAttributes($params, [], $request, 'esql.async_query'); |
|
60 | + return $this->client->sendRequest($request); |
|
61 | + } |
|
62 | + /** |
|
63 | + * Retrieves the results of a previously submitted async query request given its ID. |
|
64 | + * |
|
65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html |
|
66 | + * |
|
67 | + * @param array{ |
|
68 | + * id: string, // (REQUIRED) The async query ID |
|
69 | + * wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response |
|
70 | + * keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available |
|
71 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
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 MissingParameterException if a required parameter is missing |
|
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 asyncQueryGet(array $params = []) |
|
87 | + { |
|
88 | + $this->checkRequiredParameters(['id'], $params); |
|
89 | + $url = '/_query/async/' . $this->encode($params['id']); |
|
90 | + $method = 'GET'; |
|
91 | + $url = $this->addQueryString($url, $params, ['wait_for_completion_timeout', 'keep_alive', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
92 | + $headers = ['Accept' => 'application/json']; |
|
93 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
94 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'esql.async_query_get'); |
|
95 | + return $this->client->sendRequest($request); |
|
96 | + } |
|
97 | + /** |
|
98 | + * Executes an ESQL request |
|
99 | + * |
|
100 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html |
|
101 | + * |
|
102 | + * @param array{ |
|
103 | + * format: string, // a short version of the Accept header, e.g. json, yaml |
|
104 | + * delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format. |
|
105 | + * drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. |
|
106 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
107 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
108 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
109 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
110 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
111 | + * body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. |
|
112 | + * } $params |
|
113 | + * |
|
114 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
115 | + * @throws ClientResponseException if the status code of response is 4xx |
|
116 | + * @throws ServerResponseException if the status code of response is 5xx |
|
117 | + * |
|
118 | + * @return Elasticsearch|Promise |
|
119 | + */ |
|
120 | + public function query(array $params = []) |
|
121 | + { |
|
122 | + $this->checkRequiredParameters(['body'], $params); |
|
123 | + $url = '/_query'; |
|
124 | + $method = 'POST'; |
|
125 | + $url = $this->addQueryString($url, $params, ['format', 'delimiter', 'drop_null_columns', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
126 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
127 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
128 | + $request = $this->addOtelAttributes($params, [], $request, 'esql.query'); |
|
129 | + return $this->client->sendRequest($request); |
|
130 | + } |
|
131 | 131 | } |