@@ -25,97 +25,97 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class DanglingIndices extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Deletes the specified dangling index |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
| 35 | - * accept_data_loss: boolean, // Must be set to true in order to delete the dangling index |
|
| 36 | - * timeout: time, // Explicit operation timeout |
|
| 37 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 38 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 39 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 40 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 41 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 42 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 43 | - * } $params |
|
| 44 | - * |
|
| 45 | - * @throws MissingParameterException if a required parameter is missing |
|
| 46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 49 | - * |
|
| 50 | - * @return Elasticsearch|Promise |
|
| 51 | - */ |
|
| 52 | - public function deleteDanglingIndex(array $params = []) |
|
| 53 | - { |
|
| 54 | - $this->checkRequiredParameters(['index_uuid'], $params); |
|
| 55 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 56 | - $method = 'DELETE'; |
|
| 57 | - $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | - $headers = ['Accept' => 'application/json']; |
|
| 59 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 60 | - } |
|
| 61 | - /** |
|
| 62 | - * Imports the specified dangling index |
|
| 63 | - * |
|
| 64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 65 | - * |
|
| 66 | - * @param array{ |
|
| 67 | - * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
| 68 | - * accept_data_loss: boolean, // Must be set to true in order to import the dangling index |
|
| 69 | - * timeout: time, // Explicit operation timeout |
|
| 70 | - * master_timeout: time, // Specify timeout for connection to master |
|
| 71 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 72 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 73 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 74 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 75 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 76 | - * } $params |
|
| 77 | - * |
|
| 78 | - * @throws MissingParameterException if a required parameter is missing |
|
| 79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | - * |
|
| 83 | - * @return Elasticsearch|Promise |
|
| 84 | - */ |
|
| 85 | - public function importDanglingIndex(array $params = []) |
|
| 86 | - { |
|
| 87 | - $this->checkRequiredParameters(['index_uuid'], $params); |
|
| 88 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 89 | - $method = 'POST'; |
|
| 90 | - $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | - $headers = ['Accept' => 'application/json']; |
|
| 92 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 93 | - } |
|
| 94 | - /** |
|
| 95 | - * Returns all dangling indices. |
|
| 96 | - * |
|
| 97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 98 | - * |
|
| 99 | - * @param array{ |
|
| 100 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 101 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 102 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 103 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 104 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 105 | - * } $params |
|
| 106 | - * |
|
| 107 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 108 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 109 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 110 | - * |
|
| 111 | - * @return Elasticsearch|Promise |
|
| 112 | - */ |
|
| 113 | - public function listDanglingIndices(array $params = []) |
|
| 114 | - { |
|
| 115 | - $url = '/_dangling'; |
|
| 116 | - $method = 'GET'; |
|
| 117 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 118 | - $headers = ['Accept' => 'application/json']; |
|
| 119 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 120 | - } |
|
| 28 | + /** |
|
| 29 | + * Deletes the specified dangling index |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
| 35 | + * accept_data_loss: boolean, // Must be set to true in order to delete the dangling index |
|
| 36 | + * timeout: time, // Explicit operation timeout |
|
| 37 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 38 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 39 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 40 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 41 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 42 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 43 | + * } $params |
|
| 44 | + * |
|
| 45 | + * @throws MissingParameterException if a required parameter is missing |
|
| 46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 49 | + * |
|
| 50 | + * @return Elasticsearch|Promise |
|
| 51 | + */ |
|
| 52 | + public function deleteDanglingIndex(array $params = []) |
|
| 53 | + { |
|
| 54 | + $this->checkRequiredParameters(['index_uuid'], $params); |
|
| 55 | + $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 56 | + $method = 'DELETE'; |
|
| 57 | + $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | + $headers = ['Accept' => 'application/json']; |
|
| 59 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 60 | + } |
|
| 61 | + /** |
|
| 62 | + * Imports the specified dangling index |
|
| 63 | + * |
|
| 64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 65 | + * |
|
| 66 | + * @param array{ |
|
| 67 | + * index_uuid: string, // (REQUIRED) The UUID of the dangling index |
|
| 68 | + * accept_data_loss: boolean, // Must be set to true in order to import the dangling index |
|
| 69 | + * timeout: time, // Explicit operation timeout |
|
| 70 | + * master_timeout: time, // Specify timeout for connection to master |
|
| 71 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 72 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 73 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 74 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 75 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 76 | + * } $params |
|
| 77 | + * |
|
| 78 | + * @throws MissingParameterException if a required parameter is missing |
|
| 79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | + * |
|
| 83 | + * @return Elasticsearch|Promise |
|
| 84 | + */ |
|
| 85 | + public function importDanglingIndex(array $params = []) |
|
| 86 | + { |
|
| 87 | + $this->checkRequiredParameters(['index_uuid'], $params); |
|
| 88 | + $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 89 | + $method = 'POST'; |
|
| 90 | + $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | + $headers = ['Accept' => 'application/json']; |
|
| 92 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 93 | + } |
|
| 94 | + /** |
|
| 95 | + * Returns all dangling indices. |
|
| 96 | + * |
|
| 97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html |
|
| 98 | + * |
|
| 99 | + * @param array{ |
|
| 100 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 101 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 102 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 103 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 104 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 105 | + * } $params |
|
| 106 | + * |
|
| 107 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 108 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 109 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 110 | + * |
|
| 111 | + * @return Elasticsearch|Promise |
|
| 112 | + */ |
|
| 113 | + public function listDanglingIndices(array $params = []) |
|
| 114 | + { |
|
| 115 | + $url = '/_dangling'; |
|
| 116 | + $method = 'GET'; |
|
| 117 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 118 | + $headers = ['Accept' => 'application/json']; |
|
| 119 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 120 | + } |
|
| 121 | 121 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function deleteDanglingIndex(array $params = []) |
| 53 | 53 | { |
| 54 | 54 | $this->checkRequiredParameters(['index_uuid'], $params); |
| 55 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 55 | + $url = '/_dangling/'.$this->encode($params['index_uuid']); |
|
| 56 | 56 | $method = 'DELETE'; |
| 57 | 57 | $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 58 | 58 | $headers = ['Accept' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function importDanglingIndex(array $params = []) |
| 86 | 86 | { |
| 87 | 87 | $this->checkRequiredParameters(['index_uuid'], $params); |
| 88 | - $url = '/_dangling/' . $this->encode($params['index_uuid']); |
|
| 88 | + $url = '/_dangling/'.$this->encode($params['index_uuid']); |
|
| 89 | 89 | $method = 'POST'; |
| 90 | 90 | $url = $this->addQueryString($url, $params, ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 91 | 91 | $headers = ['Accept' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class DanglingIndices extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class DanglingIndices extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Deletes the specified dangling index |
| 30 | 29 | * |
@@ -25,61 +25,61 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Xpack extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Retrieves information about the installed X-Pack features. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
| 35 | - * accept_enterprise: boolean, // If this param is used it must be set to true |
|
| 36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | - * } $params |
|
| 42 | - * |
|
| 43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | - * |
|
| 47 | - * @return Elasticsearch|Promise |
|
| 48 | - */ |
|
| 49 | - public function info(array $params = []) |
|
| 50 | - { |
|
| 51 | - $url = '/_xpack'; |
|
| 52 | - $method = 'GET'; |
|
| 53 | - $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | - $headers = ['Accept' => 'application/json']; |
|
| 55 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 56 | - } |
|
| 57 | - /** |
|
| 58 | - * Retrieves usage information about the installed X-Pack features. |
|
| 59 | - * |
|
| 60 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
| 61 | - * |
|
| 62 | - * @param array{ |
|
| 63 | - * master_timeout: time, // Specify timeout for watch write operation |
|
| 64 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 65 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 66 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 67 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 68 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 69 | - * } $params |
|
| 70 | - * |
|
| 71 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 72 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 73 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 74 | - * |
|
| 75 | - * @return Elasticsearch|Promise |
|
| 76 | - */ |
|
| 77 | - public function usage(array $params = []) |
|
| 78 | - { |
|
| 79 | - $url = '/_xpack/usage'; |
|
| 80 | - $method = 'GET'; |
|
| 81 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 82 | - $headers = ['Accept' => 'application/json']; |
|
| 83 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 84 | - } |
|
| 28 | + /** |
|
| 29 | + * Retrieves information about the installed X-Pack features. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * categories: list, // Comma-separated list of info categories. Can be any of: build, license, features |
|
| 35 | + * accept_enterprise: boolean, // If this param is used it must be set to true |
|
| 36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | + * } $params |
|
| 42 | + * |
|
| 43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | + * |
|
| 47 | + * @return Elasticsearch|Promise |
|
| 48 | + */ |
|
| 49 | + public function info(array $params = []) |
|
| 50 | + { |
|
| 51 | + $url = '/_xpack'; |
|
| 52 | + $method = 'GET'; |
|
| 53 | + $url = $this->addQueryString($url, $params, ['categories', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | + $headers = ['Accept' => 'application/json']; |
|
| 55 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 56 | + } |
|
| 57 | + /** |
|
| 58 | + * Retrieves usage information about the installed X-Pack features. |
|
| 59 | + * |
|
| 60 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html |
|
| 61 | + * |
|
| 62 | + * @param array{ |
|
| 63 | + * master_timeout: time, // Specify timeout for watch write operation |
|
| 64 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 65 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 66 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 67 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 68 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 69 | + * } $params |
|
| 70 | + * |
|
| 71 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 72 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 73 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 74 | + * |
|
| 75 | + * @return Elasticsearch|Promise |
|
| 76 | + */ |
|
| 77 | + public function usage(array $params = []) |
|
| 78 | + { |
|
| 79 | + $url = '/_xpack/usage'; |
|
| 80 | + $method = 'GET'; |
|
| 81 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 82 | + $headers = ['Accept' => 'application/json']; |
|
| 83 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 84 | + } |
|
| 85 | 85 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Xpack extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Xpack extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Retrieves information about the installed X-Pack features. |
| 30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -25,31 +25,31 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Ssl extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | - * } $params |
|
| 40 | - * |
|
| 41 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 42 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 43 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 44 | - * |
|
| 45 | - * @return Elasticsearch|Promise |
|
| 46 | - */ |
|
| 47 | - public function certificates(array $params = []) |
|
| 48 | - { |
|
| 49 | - $url = '/_ssl/certificates'; |
|
| 50 | - $method = 'GET'; |
|
| 51 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 52 | - $headers = ['Accept' => 'application/json']; |
|
| 53 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 54 | - } |
|
| 28 | + /** |
|
| 29 | + * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | + * } $params |
|
| 40 | + * |
|
| 41 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 42 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 43 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 44 | + * |
|
| 45 | + * @return Elasticsearch|Promise |
|
| 46 | + */ |
|
| 47 | + public function certificates(array $params = []) |
|
| 48 | + { |
|
| 49 | + $url = '/_ssl/certificates'; |
|
| 50 | + $method = 'GET'; |
|
| 51 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 52 | + $headers = ['Accept' => 'application/json']; |
|
| 53 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Ssl extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Ssl extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. |
| 30 | 29 | * |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait; |
| 19 | 19 | abstract class AbstractEndpoint |
| 20 | 20 | { |
| 21 | - use EndpointTrait; |
|
| 22 | - protected ClientInterface $client; |
|
| 23 | - public function __construct(ClientInterface $client) |
|
| 24 | - { |
|
| 25 | - $this->client = $client; |
|
| 26 | - } |
|
| 21 | + use EndpointTrait; |
|
| 22 | + protected ClientInterface $client; |
|
| 23 | + public function __construct(ClientInterface $client) |
|
| 24 | + { |
|
| 25 | + $this->client = $client; |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface; |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\ClientInterface; |
| 18 | 18 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Traits\EndpointTrait; |
| 19 | -abstract class AbstractEndpoint |
|
| 20 | -{ |
|
| 19 | +abstract class AbstractEndpoint { |
|
| 21 | 20 | use EndpointTrait; |
| 22 | 21 | protected ClientInterface $client; |
| 23 | 22 | public function __construct(ClientInterface $client) |
@@ -25,263 +25,263 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Slm extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Deletes an existing snapshot lifecycle policy. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
| 35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | - * } $params |
|
| 41 | - * |
|
| 42 | - * @throws MissingParameterException if a required parameter is missing |
|
| 43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | - * |
|
| 47 | - * @return Elasticsearch|Promise |
|
| 48 | - */ |
|
| 49 | - public function deleteLifecycle(array $params = []) |
|
| 50 | - { |
|
| 51 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
| 52 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 53 | - $method = 'DELETE'; |
|
| 54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 55 | - $headers = ['Accept' => 'application/json']; |
|
| 56 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 57 | - } |
|
| 58 | - /** |
|
| 59 | - * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
| 60 | - * |
|
| 61 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
| 62 | - * |
|
| 63 | - * @param array{ |
|
| 64 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
| 65 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 66 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 67 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 68 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 69 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 70 | - * } $params |
|
| 71 | - * |
|
| 72 | - * @throws MissingParameterException if a required parameter is missing |
|
| 73 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | - * |
|
| 77 | - * @return Elasticsearch|Promise |
|
| 78 | - */ |
|
| 79 | - public function executeLifecycle(array $params = []) |
|
| 80 | - { |
|
| 81 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
| 82 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
| 83 | - $method = 'PUT'; |
|
| 84 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 85 | - $headers = ['Accept' => 'application/json']; |
|
| 86 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 87 | - } |
|
| 88 | - /** |
|
| 89 | - * Deletes any snapshots that are expired according to the policy's retention rules. |
|
| 90 | - * |
|
| 91 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
| 92 | - * |
|
| 93 | - * @param array{ |
|
| 94 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 95 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 96 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 97 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 98 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 99 | - * } $params |
|
| 100 | - * |
|
| 101 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 102 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 103 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 104 | - * |
|
| 105 | - * @return Elasticsearch|Promise |
|
| 106 | - */ |
|
| 107 | - public function executeRetention(array $params = []) |
|
| 108 | - { |
|
| 109 | - $url = '/_slm/_execute_retention'; |
|
| 110 | - $method = 'POST'; |
|
| 111 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 112 | - $headers = ['Accept' => 'application/json']; |
|
| 113 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 114 | - } |
|
| 115 | - /** |
|
| 116 | - * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
| 117 | - * |
|
| 118 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
| 119 | - * |
|
| 120 | - * @param array{ |
|
| 121 | - * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
| 122 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 123 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 124 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 125 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 126 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 127 | - * } $params |
|
| 128 | - * |
|
| 129 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 130 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 131 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 132 | - * |
|
| 133 | - * @return Elasticsearch|Promise |
|
| 134 | - */ |
|
| 135 | - public function getLifecycle(array $params = []) |
|
| 136 | - { |
|
| 137 | - if (isset($params['policy_id'])) { |
|
| 138 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 139 | - $method = 'GET'; |
|
| 140 | - } else { |
|
| 141 | - $url = '/_slm/policy'; |
|
| 142 | - $method = 'GET'; |
|
| 143 | - } |
|
| 144 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 145 | - $headers = ['Accept' => 'application/json']; |
|
| 146 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 147 | - } |
|
| 148 | - /** |
|
| 149 | - * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
| 150 | - * |
|
| 151 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
| 152 | - * |
|
| 153 | - * @param array{ |
|
| 154 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 155 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 156 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 157 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 158 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 159 | - * } $params |
|
| 160 | - * |
|
| 161 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 162 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 163 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 164 | - * |
|
| 165 | - * @return Elasticsearch|Promise |
|
| 166 | - */ |
|
| 167 | - public function getStats(array $params = []) |
|
| 168 | - { |
|
| 169 | - $url = '/_slm/stats'; |
|
| 170 | - $method = 'GET'; |
|
| 171 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 172 | - $headers = ['Accept' => 'application/json']; |
|
| 173 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 174 | - } |
|
| 175 | - /** |
|
| 176 | - * Retrieves the status of snapshot lifecycle management (SLM). |
|
| 177 | - * |
|
| 178 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
| 179 | - * |
|
| 180 | - * @param array{ |
|
| 181 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 182 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 183 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 184 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 185 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 186 | - * } $params |
|
| 187 | - * |
|
| 188 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 189 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 190 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 191 | - * |
|
| 192 | - * @return Elasticsearch|Promise |
|
| 193 | - */ |
|
| 194 | - public function getStatus(array $params = []) |
|
| 195 | - { |
|
| 196 | - $url = '/_slm/status'; |
|
| 197 | - $method = 'GET'; |
|
| 198 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 199 | - $headers = ['Accept' => 'application/json']; |
|
| 200 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 201 | - } |
|
| 202 | - /** |
|
| 203 | - * Creates or updates a snapshot lifecycle policy. |
|
| 204 | - * |
|
| 205 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
| 206 | - * |
|
| 207 | - * @param array{ |
|
| 208 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
| 209 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 210 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 211 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 212 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 213 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 214 | - * body: array, // The snapshot lifecycle policy definition to register |
|
| 215 | - * } $params |
|
| 216 | - * |
|
| 217 | - * @throws MissingParameterException if a required parameter is missing |
|
| 218 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 219 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 220 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 221 | - * |
|
| 222 | - * @return Elasticsearch|Promise |
|
| 223 | - */ |
|
| 224 | - public function putLifecycle(array $params = []) |
|
| 225 | - { |
|
| 226 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
| 227 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 228 | - $method = 'PUT'; |
|
| 229 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 230 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 231 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 232 | - } |
|
| 233 | - /** |
|
| 234 | - * Turns on snapshot lifecycle management (SLM). |
|
| 235 | - * |
|
| 236 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
| 237 | - * |
|
| 238 | - * @param array{ |
|
| 239 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 240 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 241 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 242 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 243 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 244 | - * } $params |
|
| 245 | - * |
|
| 246 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 247 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 248 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 249 | - * |
|
| 250 | - * @return Elasticsearch|Promise |
|
| 251 | - */ |
|
| 252 | - public function start(array $params = []) |
|
| 253 | - { |
|
| 254 | - $url = '/_slm/start'; |
|
| 255 | - $method = 'POST'; |
|
| 256 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 257 | - $headers = ['Accept' => 'application/json']; |
|
| 258 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 259 | - } |
|
| 260 | - /** |
|
| 261 | - * Turns off snapshot lifecycle management (SLM). |
|
| 262 | - * |
|
| 263 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
| 264 | - * |
|
| 265 | - * @param array{ |
|
| 266 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 267 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 268 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 269 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 270 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 271 | - * } $params |
|
| 272 | - * |
|
| 273 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 274 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 275 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 276 | - * |
|
| 277 | - * @return Elasticsearch|Promise |
|
| 278 | - */ |
|
| 279 | - public function stop(array $params = []) |
|
| 280 | - { |
|
| 281 | - $url = '/_slm/stop'; |
|
| 282 | - $method = 'POST'; |
|
| 283 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 284 | - $headers = ['Accept' => 'application/json']; |
|
| 285 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 286 | - } |
|
| 28 | + /** |
|
| 29 | + * Deletes an existing snapshot lifecycle policy. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
| 35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 40 | + * } $params |
|
| 41 | + * |
|
| 42 | + * @throws MissingParameterException if a required parameter is missing |
|
| 43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | + * |
|
| 47 | + * @return Elasticsearch|Promise |
|
| 48 | + */ |
|
| 49 | + public function deleteLifecycle(array $params = []) |
|
| 50 | + { |
|
| 51 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
| 52 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 53 | + $method = 'DELETE'; |
|
| 54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 55 | + $headers = ['Accept' => 'application/json']; |
|
| 56 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 57 | + } |
|
| 58 | + /** |
|
| 59 | + * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
| 60 | + * |
|
| 61 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
| 62 | + * |
|
| 63 | + * @param array{ |
|
| 64 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
| 65 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 66 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 67 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 68 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 69 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 70 | + * } $params |
|
| 71 | + * |
|
| 72 | + * @throws MissingParameterException if a required parameter is missing |
|
| 73 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 74 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 75 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 76 | + * |
|
| 77 | + * @return Elasticsearch|Promise |
|
| 78 | + */ |
|
| 79 | + public function executeLifecycle(array $params = []) |
|
| 80 | + { |
|
| 81 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
| 82 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
| 83 | + $method = 'PUT'; |
|
| 84 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 85 | + $headers = ['Accept' => 'application/json']; |
|
| 86 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 87 | + } |
|
| 88 | + /** |
|
| 89 | + * Deletes any snapshots that are expired according to the policy's retention rules. |
|
| 90 | + * |
|
| 91 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
| 92 | + * |
|
| 93 | + * @param array{ |
|
| 94 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 95 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 96 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 97 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 98 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 99 | + * } $params |
|
| 100 | + * |
|
| 101 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 102 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 103 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 104 | + * |
|
| 105 | + * @return Elasticsearch|Promise |
|
| 106 | + */ |
|
| 107 | + public function executeRetention(array $params = []) |
|
| 108 | + { |
|
| 109 | + $url = '/_slm/_execute_retention'; |
|
| 110 | + $method = 'POST'; |
|
| 111 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 112 | + $headers = ['Accept' => 'application/json']; |
|
| 113 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 114 | + } |
|
| 115 | + /** |
|
| 116 | + * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
| 117 | + * |
|
| 118 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
| 119 | + * |
|
| 120 | + * @param array{ |
|
| 121 | + * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
| 122 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 123 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 124 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 125 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 126 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 127 | + * } $params |
|
| 128 | + * |
|
| 129 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 130 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 131 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 132 | + * |
|
| 133 | + * @return Elasticsearch|Promise |
|
| 134 | + */ |
|
| 135 | + public function getLifecycle(array $params = []) |
|
| 136 | + { |
|
| 137 | + if (isset($params['policy_id'])) { |
|
| 138 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 139 | + $method = 'GET'; |
|
| 140 | + } else { |
|
| 141 | + $url = '/_slm/policy'; |
|
| 142 | + $method = 'GET'; |
|
| 143 | + } |
|
| 144 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 145 | + $headers = ['Accept' => 'application/json']; |
|
| 146 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 147 | + } |
|
| 148 | + /** |
|
| 149 | + * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
| 150 | + * |
|
| 151 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
| 152 | + * |
|
| 153 | + * @param array{ |
|
| 154 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 155 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 156 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 157 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 158 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 159 | + * } $params |
|
| 160 | + * |
|
| 161 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 162 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 163 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 164 | + * |
|
| 165 | + * @return Elasticsearch|Promise |
|
| 166 | + */ |
|
| 167 | + public function getStats(array $params = []) |
|
| 168 | + { |
|
| 169 | + $url = '/_slm/stats'; |
|
| 170 | + $method = 'GET'; |
|
| 171 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 172 | + $headers = ['Accept' => 'application/json']; |
|
| 173 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 174 | + } |
|
| 175 | + /** |
|
| 176 | + * Retrieves the status of snapshot lifecycle management (SLM). |
|
| 177 | + * |
|
| 178 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
| 179 | + * |
|
| 180 | + * @param array{ |
|
| 181 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 182 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 183 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 184 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 185 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 186 | + * } $params |
|
| 187 | + * |
|
| 188 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 189 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 190 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 191 | + * |
|
| 192 | + * @return Elasticsearch|Promise |
|
| 193 | + */ |
|
| 194 | + public function getStatus(array $params = []) |
|
| 195 | + { |
|
| 196 | + $url = '/_slm/status'; |
|
| 197 | + $method = 'GET'; |
|
| 198 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 199 | + $headers = ['Accept' => 'application/json']; |
|
| 200 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 201 | + } |
|
| 202 | + /** |
|
| 203 | + * Creates or updates a snapshot lifecycle policy. |
|
| 204 | + * |
|
| 205 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
| 206 | + * |
|
| 207 | + * @param array{ |
|
| 208 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
| 209 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 210 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 211 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 212 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 213 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 214 | + * body: array, // The snapshot lifecycle policy definition to register |
|
| 215 | + * } $params |
|
| 216 | + * |
|
| 217 | + * @throws MissingParameterException if a required parameter is missing |
|
| 218 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 219 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 220 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 221 | + * |
|
| 222 | + * @return Elasticsearch|Promise |
|
| 223 | + */ |
|
| 224 | + public function putLifecycle(array $params = []) |
|
| 225 | + { |
|
| 226 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
| 227 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 228 | + $method = 'PUT'; |
|
| 229 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 230 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 231 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 232 | + } |
|
| 233 | + /** |
|
| 234 | + * Turns on snapshot lifecycle management (SLM). |
|
| 235 | + * |
|
| 236 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
| 237 | + * |
|
| 238 | + * @param array{ |
|
| 239 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 240 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 241 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 242 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 243 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 244 | + * } $params |
|
| 245 | + * |
|
| 246 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 247 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 248 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 249 | + * |
|
| 250 | + * @return Elasticsearch|Promise |
|
| 251 | + */ |
|
| 252 | + public function start(array $params = []) |
|
| 253 | + { |
|
| 254 | + $url = '/_slm/start'; |
|
| 255 | + $method = 'POST'; |
|
| 256 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 257 | + $headers = ['Accept' => 'application/json']; |
|
| 258 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 259 | + } |
|
| 260 | + /** |
|
| 261 | + * Turns off snapshot lifecycle management (SLM). |
|
| 262 | + * |
|
| 263 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
| 264 | + * |
|
| 265 | + * @param array{ |
|
| 266 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 267 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 268 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 269 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 270 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 271 | + * } $params |
|
| 272 | + * |
|
| 273 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 274 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 275 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 276 | + * |
|
| 277 | + * @return Elasticsearch|Promise |
|
| 278 | + */ |
|
| 279 | + public function stop(array $params = []) |
|
| 280 | + { |
|
| 281 | + $url = '/_slm/stop'; |
|
| 282 | + $method = 'POST'; |
|
| 283 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 284 | + $headers = ['Accept' => 'application/json']; |
|
| 285 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 286 | + } |
|
| 287 | 287 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function deleteLifecycle(array $params = []) |
| 50 | 50 | { |
| 51 | 51 | $this->checkRequiredParameters(['policy_id'], $params); |
| 52 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 52 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']); |
|
| 53 | 53 | $method = 'DELETE'; |
| 54 | 54 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 55 | 55 | $headers = ['Accept' => 'application/json']; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function executeLifecycle(array $params = []) |
| 80 | 80 | { |
| 81 | 81 | $this->checkRequiredParameters(['policy_id'], $params); |
| 82 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
| 82 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']).'/_execute'; |
|
| 83 | 83 | $method = 'PUT'; |
| 84 | 84 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 85 | 85 | $headers = ['Accept' => 'application/json']; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function getLifecycle(array $params = []) |
| 136 | 136 | { |
| 137 | 137 | if (isset($params['policy_id'])) { |
| 138 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 138 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']); |
|
| 139 | 139 | $method = 'GET'; |
| 140 | 140 | } else { |
| 141 | 141 | $url = '/_slm/policy'; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public function putLifecycle(array $params = []) |
| 225 | 225 | { |
| 226 | 226 | $this->checkRequiredParameters(['policy_id'], $params); |
| 227 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
| 227 | + $url = '/_slm/policy/'.$this->encode($params['policy_id']); |
|
| 228 | 228 | $method = 'PUT'; |
| 229 | 229 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 230 | 230 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Slm extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Slm extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Deletes an existing snapshot lifecycle policy. |
| 30 | 29 | * |
@@ -25,144 +25,144 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class SearchableSnapshots extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Retrieve node-level cache statistics about searchable snapshots. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | - * |
|
| 34 | - * @param array{ |
|
| 35 | - * node_id: list, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes |
|
| 36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | - * } $params |
|
| 42 | - * |
|
| 43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | - * |
|
| 47 | - * @return Elasticsearch|Promise |
|
| 48 | - */ |
|
| 49 | - public function cacheStats(array $params = []) |
|
| 50 | - { |
|
| 51 | - if (isset($params['node_id'])) { |
|
| 52 | - $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
| 53 | - $method = 'GET'; |
|
| 54 | - } else { |
|
| 55 | - $url = '/_searchable_snapshots/cache/stats'; |
|
| 56 | - $method = 'GET'; |
|
| 57 | - } |
|
| 58 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 59 | - $headers = ['Accept' => 'application/json']; |
|
| 60 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 61 | - } |
|
| 62 | - /** |
|
| 63 | - * Clear the cache of searchable snapshots. |
|
| 64 | - * |
|
| 65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 66 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 67 | - * |
|
| 68 | - * @param array{ |
|
| 69 | - * index: list, // A comma-separated list of index names |
|
| 70 | - * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
| 71 | - * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
| 72 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 73 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 74 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 75 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 76 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 77 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 78 | - * } $params |
|
| 79 | - * |
|
| 80 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 81 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 82 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 83 | - * |
|
| 84 | - * @return Elasticsearch|Promise |
|
| 85 | - */ |
|
| 86 | - public function clearCache(array $params = []) |
|
| 87 | - { |
|
| 88 | - if (isset($params['index'])) { |
|
| 89 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
| 90 | - $method = 'POST'; |
|
| 91 | - } else { |
|
| 92 | - $url = '/_searchable_snapshots/cache/clear'; |
|
| 93 | - $method = 'POST'; |
|
| 94 | - } |
|
| 95 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 96 | - $headers = ['Accept' => 'application/json']; |
|
| 97 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 98 | - } |
|
| 99 | - /** |
|
| 100 | - * Mount a snapshot as a searchable index. |
|
| 101 | - * |
|
| 102 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
| 103 | - * |
|
| 104 | - * @param array{ |
|
| 105 | - * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
| 106 | - * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
| 107 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 108 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 109 | - * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
| 110 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 111 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 112 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 113 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 114 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 115 | - * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
| 116 | - * } $params |
|
| 117 | - * |
|
| 118 | - * @throws MissingParameterException if a required parameter is missing |
|
| 119 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 120 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 121 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 122 | - * |
|
| 123 | - * @return Elasticsearch|Promise |
|
| 124 | - */ |
|
| 125 | - public function mount(array $params = []) |
|
| 126 | - { |
|
| 127 | - $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
| 128 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
| 129 | - $method = 'POST'; |
|
| 130 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 131 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 132 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 133 | - } |
|
| 134 | - /** |
|
| 135 | - * Retrieve shard-level statistics about searchable snapshots. |
|
| 136 | - * |
|
| 137 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 138 | - * |
|
| 139 | - * @param array{ |
|
| 140 | - * index: list, // A comma-separated list of index names |
|
| 141 | - * level: enum, // Return stats aggregated at cluster, index or shard level |
|
| 142 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 143 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 144 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 145 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 146 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 147 | - * } $params |
|
| 148 | - * |
|
| 149 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 150 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 151 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 152 | - * |
|
| 153 | - * @return Elasticsearch|Promise |
|
| 154 | - */ |
|
| 155 | - public function stats(array $params = []) |
|
| 156 | - { |
|
| 157 | - if (isset($params['index'])) { |
|
| 158 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
| 159 | - $method = 'GET'; |
|
| 160 | - } else { |
|
| 161 | - $url = '/_searchable_snapshots/stats'; |
|
| 162 | - $method = 'GET'; |
|
| 163 | - } |
|
| 164 | - $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 165 | - $headers = ['Accept' => 'application/json']; |
|
| 166 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 167 | - } |
|
| 28 | + /** |
|
| 29 | + * Retrieve node-level cache statistics about searchable snapshots. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 33 | + * |
|
| 34 | + * @param array{ |
|
| 35 | + * node_id: list, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes |
|
| 36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | + * } $params |
|
| 42 | + * |
|
| 43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 46 | + * |
|
| 47 | + * @return Elasticsearch|Promise |
|
| 48 | + */ |
|
| 49 | + public function cacheStats(array $params = []) |
|
| 50 | + { |
|
| 51 | + if (isset($params['node_id'])) { |
|
| 52 | + $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
| 53 | + $method = 'GET'; |
|
| 54 | + } else { |
|
| 55 | + $url = '/_searchable_snapshots/cache/stats'; |
|
| 56 | + $method = 'GET'; |
|
| 57 | + } |
|
| 58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 59 | + $headers = ['Accept' => 'application/json']; |
|
| 60 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 61 | + } |
|
| 62 | + /** |
|
| 63 | + * Clear the cache of searchable snapshots. |
|
| 64 | + * |
|
| 65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 66 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
| 67 | + * |
|
| 68 | + * @param array{ |
|
| 69 | + * index: list, // A comma-separated list of index names |
|
| 70 | + * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
| 71 | + * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
| 72 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
| 73 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 74 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 75 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 76 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 77 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 78 | + * } $params |
|
| 79 | + * |
|
| 80 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 81 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 82 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 83 | + * |
|
| 84 | + * @return Elasticsearch|Promise |
|
| 85 | + */ |
|
| 86 | + public function clearCache(array $params = []) |
|
| 87 | + { |
|
| 88 | + if (isset($params['index'])) { |
|
| 89 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
| 90 | + $method = 'POST'; |
|
| 91 | + } else { |
|
| 92 | + $url = '/_searchable_snapshots/cache/clear'; |
|
| 93 | + $method = 'POST'; |
|
| 94 | + } |
|
| 95 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 96 | + $headers = ['Accept' => 'application/json']; |
|
| 97 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 98 | + } |
|
| 99 | + /** |
|
| 100 | + * Mount a snapshot as a searchable index. |
|
| 101 | + * |
|
| 102 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
| 103 | + * |
|
| 104 | + * @param array{ |
|
| 105 | + * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
| 106 | + * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
| 107 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
| 108 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
| 109 | + * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
| 110 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 111 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 112 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 113 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 114 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 115 | + * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
| 116 | + * } $params |
|
| 117 | + * |
|
| 118 | + * @throws MissingParameterException if a required parameter is missing |
|
| 119 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 120 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 121 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 122 | + * |
|
| 123 | + * @return Elasticsearch|Promise |
|
| 124 | + */ |
|
| 125 | + public function mount(array $params = []) |
|
| 126 | + { |
|
| 127 | + $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
| 128 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
| 129 | + $method = 'POST'; |
|
| 130 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 131 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 132 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 133 | + } |
|
| 134 | + /** |
|
| 135 | + * Retrieve shard-level statistics about searchable snapshots. |
|
| 136 | + * |
|
| 137 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
| 138 | + * |
|
| 139 | + * @param array{ |
|
| 140 | + * index: list, // A comma-separated list of index names |
|
| 141 | + * level: enum, // Return stats aggregated at cluster, index or shard level |
|
| 142 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 143 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 144 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 145 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 146 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 147 | + * } $params |
|
| 148 | + * |
|
| 149 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 150 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 151 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 152 | + * |
|
| 153 | + * @return Elasticsearch|Promise |
|
| 154 | + */ |
|
| 155 | + public function stats(array $params = []) |
|
| 156 | + { |
|
| 157 | + if (isset($params['index'])) { |
|
| 158 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
| 159 | + $method = 'GET'; |
|
| 160 | + } else { |
|
| 161 | + $url = '/_searchable_snapshots/stats'; |
|
| 162 | + $method = 'GET'; |
|
| 163 | + } |
|
| 164 | + $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 165 | + $headers = ['Accept' => 'application/json']; |
|
| 166 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 167 | + } |
|
| 168 | 168 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function cacheStats(array $params = []) |
| 50 | 50 | { |
| 51 | 51 | if (isset($params['node_id'])) { |
| 52 | - $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
| 52 | + $url = '/_searchable_snapshots/'.$this->encode($params['node_id']).'/cache/stats'; |
|
| 53 | 53 | $method = 'GET'; |
| 54 | 54 | } else { |
| 55 | 55 | $url = '/_searchable_snapshots/cache/stats'; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public function clearCache(array $params = []) |
| 87 | 87 | { |
| 88 | 88 | if (isset($params['index'])) { |
| 89 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
| 89 | + $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/cache/clear'; |
|
| 90 | 90 | $method = 'POST'; |
| 91 | 91 | } else { |
| 92 | 92 | $url = '/_searchable_snapshots/cache/clear'; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function mount(array $params = []) |
| 126 | 126 | { |
| 127 | 127 | $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
| 128 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
| 128 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_mount'; |
|
| 129 | 129 | $method = 'POST'; |
| 130 | 130 | $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 131 | 131 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | public function stats(array $params = []) |
| 156 | 156 | { |
| 157 | 157 | if (isset($params['index'])) { |
| 158 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
| 158 | + $url = '/'.$this->encode($params['index']).'/_searchable_snapshots/stats'; |
|
| 159 | 159 | $method = 'GET'; |
| 160 | 160 | } else { |
| 161 | 161 | $url = '/_searchable_snapshots/stats'; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class SearchableSnapshots extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class SearchableSnapshots extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Retrieve node-level cache statistics about searchable snapshots. |
| 30 | 29 | * |
@@ -25,368 +25,368 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Transform extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Deletes an existing transform. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * transform_id: string, // (REQUIRED) The id of the transform to delete |
|
| 35 | - * force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. |
|
| 36 | - * delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. |
|
| 37 | - * timeout: time, // Controls the time to wait for the transform deletion |
|
| 38 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 39 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 40 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 41 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 42 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 43 | - * } $params |
|
| 44 | - * |
|
| 45 | - * @throws MissingParameterException if a required parameter is missing |
|
| 46 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 47 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 48 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 49 | - * |
|
| 50 | - * @return Elasticsearch|Promise |
|
| 51 | - */ |
|
| 52 | - public function deleteTransform(array $params = []) |
|
| 53 | - { |
|
| 54 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 55 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 56 | - $method = 'DELETE'; |
|
| 57 | - $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | - $headers = ['Accept' => 'application/json']; |
|
| 59 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 60 | - } |
|
| 61 | - /** |
|
| 62 | - * Retrieves configuration information for transforms. |
|
| 63 | - * |
|
| 64 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html |
|
| 65 | - * |
|
| 66 | - * @param array{ |
|
| 67 | - * transform_id: string, // The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms |
|
| 68 | - * from: int, // skips a number of transform configs, defaults to 0 |
|
| 69 | - * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
| 70 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 71 | - * exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT |
|
| 72 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 73 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 74 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 75 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 76 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 77 | - * } $params |
|
| 78 | - * |
|
| 79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | - * |
|
| 83 | - * @return Elasticsearch|Promise |
|
| 84 | - */ |
|
| 85 | - public function getTransform(array $params = []) |
|
| 86 | - { |
|
| 87 | - if (isset($params['transform_id'])) { |
|
| 88 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 89 | - $method = 'GET'; |
|
| 90 | - } else { |
|
| 91 | - $url = '/_transform'; |
|
| 92 | - $method = 'GET'; |
|
| 93 | - } |
|
| 94 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 95 | - $headers = ['Accept' => 'application/json']; |
|
| 96 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 97 | - } |
|
| 98 | - /** |
|
| 99 | - * Retrieves usage information for transforms. |
|
| 100 | - * |
|
| 101 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html |
|
| 102 | - * |
|
| 103 | - * @param array{ |
|
| 104 | - * transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
| 105 | - * from: number, // skips a number of transform stats, defaults to 0 |
|
| 106 | - * size: number, // specifies a max number of transform stats to get, defaults to 100 |
|
| 107 | - * timeout: time, // Controls the time to wait for the stats |
|
| 108 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 109 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 110 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 111 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 112 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 113 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 114 | - * } $params |
|
| 115 | - * |
|
| 116 | - * @throws MissingParameterException if a required parameter is missing |
|
| 117 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 118 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 119 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 120 | - * |
|
| 121 | - * @return Elasticsearch|Promise |
|
| 122 | - */ |
|
| 123 | - public function getTransformStats(array $params = []) |
|
| 124 | - { |
|
| 125 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 126 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
| 127 | - $method = 'GET'; |
|
| 128 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 129 | - $headers = ['Accept' => 'application/json']; |
|
| 130 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 131 | - } |
|
| 132 | - /** |
|
| 133 | - * Previews a transform. |
|
| 134 | - * |
|
| 135 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html |
|
| 136 | - * |
|
| 137 | - * @param array{ |
|
| 138 | - * transform_id: string, // The id of the transform to preview. |
|
| 139 | - * timeout: time, // Controls the time to wait for the preview |
|
| 140 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 141 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 142 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 143 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 144 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 145 | - * body: array, // The definition for the transform to preview |
|
| 146 | - * } $params |
|
| 147 | - * |
|
| 148 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 149 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 150 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 151 | - * |
|
| 152 | - * @return Elasticsearch|Promise |
|
| 153 | - */ |
|
| 154 | - public function previewTransform(array $params = []) |
|
| 155 | - { |
|
| 156 | - if (isset($params['transform_id'])) { |
|
| 157 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
| 158 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 159 | - } else { |
|
| 160 | - $url = '/_transform/_preview'; |
|
| 161 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 162 | - } |
|
| 163 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 164 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 165 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 166 | - } |
|
| 167 | - /** |
|
| 168 | - * Instantiates a transform. |
|
| 169 | - * |
|
| 170 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html |
|
| 171 | - * |
|
| 172 | - * @param array{ |
|
| 173 | - * transform_id: string, // (REQUIRED) The id of the new transform. |
|
| 174 | - * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
| 175 | - * timeout: time, // Controls the time to wait for the transform to start |
|
| 176 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 177 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 178 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 179 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 180 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 181 | - * body: array, // (REQUIRED) The transform definition |
|
| 182 | - * } $params |
|
| 183 | - * |
|
| 184 | - * @throws MissingParameterException if a required parameter is missing |
|
| 185 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 186 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 187 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 188 | - * |
|
| 189 | - * @return Elasticsearch|Promise |
|
| 190 | - */ |
|
| 191 | - public function putTransform(array $params = []) |
|
| 192 | - { |
|
| 193 | - $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
| 194 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 195 | - $method = 'PUT'; |
|
| 196 | - $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 197 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 198 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 199 | - } |
|
| 200 | - /** |
|
| 201 | - * Resets an existing transform. |
|
| 202 | - * |
|
| 203 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html |
|
| 204 | - * |
|
| 205 | - * @param array{ |
|
| 206 | - * transform_id: string, // (REQUIRED) The id of the transform to reset |
|
| 207 | - * force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. |
|
| 208 | - * timeout: time, // Controls the time to wait for the transform to reset |
|
| 209 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 210 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 211 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 212 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 213 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 214 | - * } $params |
|
| 215 | - * |
|
| 216 | - * @throws MissingParameterException if a required parameter is missing |
|
| 217 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 218 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 219 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 220 | - * |
|
| 221 | - * @return Elasticsearch|Promise |
|
| 222 | - */ |
|
| 223 | - public function resetTransform(array $params = []) |
|
| 224 | - { |
|
| 225 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 226 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
| 227 | - $method = 'POST'; |
|
| 228 | - $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 229 | - $headers = ['Accept' => 'application/json']; |
|
| 230 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 231 | - } |
|
| 232 | - /** |
|
| 233 | - * Schedules now a transform. |
|
| 234 | - * |
|
| 235 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html |
|
| 236 | - * |
|
| 237 | - * @param array{ |
|
| 238 | - * transform_id: string, // (REQUIRED) The id of the transform. |
|
| 239 | - * timeout: time, // Controls the time to wait for the scheduling to take place |
|
| 240 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 241 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 242 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 243 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 244 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 245 | - * } $params |
|
| 246 | - * |
|
| 247 | - * @throws MissingParameterException if a required parameter is missing |
|
| 248 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 249 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 250 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 251 | - * |
|
| 252 | - * @return Elasticsearch|Promise |
|
| 253 | - */ |
|
| 254 | - public function scheduleNowTransform(array $params = []) |
|
| 255 | - { |
|
| 256 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 257 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
| 258 | - $method = 'POST'; |
|
| 259 | - $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 260 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 261 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 262 | - } |
|
| 263 | - /** |
|
| 264 | - * Starts one or more transforms. |
|
| 265 | - * |
|
| 266 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html |
|
| 267 | - * |
|
| 268 | - * @param array{ |
|
| 269 | - * transform_id: string, // (REQUIRED) The id of the transform to start |
|
| 270 | - * from: string, // Restricts the set of transformed entities to those changed after this time |
|
| 271 | - * timeout: time, // Controls the time to wait for the transform to start |
|
| 272 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 273 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 274 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 275 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 276 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 277 | - * } $params |
|
| 278 | - * |
|
| 279 | - * @throws MissingParameterException if a required parameter is missing |
|
| 280 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 281 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 282 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 283 | - * |
|
| 284 | - * @return Elasticsearch|Promise |
|
| 285 | - */ |
|
| 286 | - public function startTransform(array $params = []) |
|
| 287 | - { |
|
| 288 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 289 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
| 290 | - $method = 'POST'; |
|
| 291 | - $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 292 | - $headers = ['Accept' => 'application/json']; |
|
| 293 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 294 | - } |
|
| 295 | - /** |
|
| 296 | - * Stops one or more transforms. |
|
| 297 | - * |
|
| 298 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html |
|
| 299 | - * |
|
| 300 | - * @param array{ |
|
| 301 | - * transform_id: string, // (REQUIRED) The id of the transform to stop |
|
| 302 | - * force: boolean, // Whether to force stop a failed transform or not. Default to false |
|
| 303 | - * wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false |
|
| 304 | - * timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds |
|
| 305 | - * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 306 | - * wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false |
|
| 307 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 308 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 309 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 310 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 311 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 312 | - * } $params |
|
| 313 | - * |
|
| 314 | - * @throws MissingParameterException if a required parameter is missing |
|
| 315 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 316 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 317 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 318 | - * |
|
| 319 | - * @return Elasticsearch|Promise |
|
| 320 | - */ |
|
| 321 | - public function stopTransform(array $params = []) |
|
| 322 | - { |
|
| 323 | - $this->checkRequiredParameters(['transform_id'], $params); |
|
| 324 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
| 325 | - $method = 'POST'; |
|
| 326 | - $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 327 | - $headers = ['Accept' => 'application/json']; |
|
| 328 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 329 | - } |
|
| 330 | - /** |
|
| 331 | - * Updates certain properties of a transform. |
|
| 332 | - * |
|
| 333 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html |
|
| 334 | - * |
|
| 335 | - * @param array{ |
|
| 336 | - * transform_id: string, // (REQUIRED) The id of the transform. |
|
| 337 | - * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
| 338 | - * timeout: time, // Controls the time to wait for the update |
|
| 339 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 340 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 341 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 342 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 343 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 344 | - * body: array, // (REQUIRED) The update transform definition |
|
| 345 | - * } $params |
|
| 346 | - * |
|
| 347 | - * @throws MissingParameterException if a required parameter is missing |
|
| 348 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 349 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 350 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 351 | - * |
|
| 352 | - * @return Elasticsearch|Promise |
|
| 353 | - */ |
|
| 354 | - public function updateTransform(array $params = []) |
|
| 355 | - { |
|
| 356 | - $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
| 357 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
| 358 | - $method = 'POST'; |
|
| 359 | - $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 360 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 361 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 362 | - } |
|
| 363 | - /** |
|
| 364 | - * Upgrades all transforms. |
|
| 365 | - * |
|
| 366 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html |
|
| 367 | - * |
|
| 368 | - * @param array{ |
|
| 369 | - * dry_run: boolean, // Whether to only check for updates but don't execute |
|
| 370 | - * timeout: time, // Controls the time to wait for the upgrade |
|
| 371 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 372 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 373 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 374 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 375 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 376 | - * } $params |
|
| 377 | - * |
|
| 378 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 379 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 380 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 381 | - * |
|
| 382 | - * @return Elasticsearch|Promise |
|
| 383 | - */ |
|
| 384 | - public function upgradeTransforms(array $params = []) |
|
| 385 | - { |
|
| 386 | - $url = '/_transform/_upgrade'; |
|
| 387 | - $method = 'POST'; |
|
| 388 | - $url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 389 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 390 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 391 | - } |
|
| 28 | + /** |
|
| 29 | + * Deletes an existing transform. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * transform_id: string, // (REQUIRED) The id of the transform to delete |
|
| 35 | + * force: boolean, // When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. |
|
| 36 | + * delete_dest_index: boolean, // When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. |
|
| 37 | + * timeout: time, // Controls the time to wait for the transform deletion |
|
| 38 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 39 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 40 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 41 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 42 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 43 | + * } $params |
|
| 44 | + * |
|
| 45 | + * @throws MissingParameterException if a required parameter is missing |
|
| 46 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 47 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 48 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 49 | + * |
|
| 50 | + * @return Elasticsearch|Promise |
|
| 51 | + */ |
|
| 52 | + public function deleteTransform(array $params = []) |
|
| 53 | + { |
|
| 54 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 55 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 56 | + $method = 'DELETE'; |
|
| 57 | + $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 58 | + $headers = ['Accept' => 'application/json']; |
|
| 59 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 60 | + } |
|
| 61 | + /** |
|
| 62 | + * Retrieves configuration information for transforms. |
|
| 63 | + * |
|
| 64 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html |
|
| 65 | + * |
|
| 66 | + * @param array{ |
|
| 67 | + * transform_id: string, // The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms |
|
| 68 | + * from: int, // skips a number of transform configs, defaults to 0 |
|
| 69 | + * size: int, // specifies a max number of transforms to get, defaults to 100 |
|
| 70 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 71 | + * exclude_generated: boolean, // Omits fields that are illegal to set on transform PUT |
|
| 72 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 73 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 74 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 75 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 76 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 77 | + * } $params |
|
| 78 | + * |
|
| 79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | + * |
|
| 83 | + * @return Elasticsearch|Promise |
|
| 84 | + */ |
|
| 85 | + public function getTransform(array $params = []) |
|
| 86 | + { |
|
| 87 | + if (isset($params['transform_id'])) { |
|
| 88 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 89 | + $method = 'GET'; |
|
| 90 | + } else { |
|
| 91 | + $url = '/_transform'; |
|
| 92 | + $method = 'GET'; |
|
| 93 | + } |
|
| 94 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'allow_no_match', 'exclude_generated', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 95 | + $headers = ['Accept' => 'application/json']; |
|
| 96 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 97 | + } |
|
| 98 | + /** |
|
| 99 | + * Retrieves usage information for transforms. |
|
| 100 | + * |
|
| 101 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html |
|
| 102 | + * |
|
| 103 | + * @param array{ |
|
| 104 | + * transform_id: string, // (REQUIRED) The id of the transform for which to get stats. '_all' or '*' implies all transforms |
|
| 105 | + * from: number, // skips a number of transform stats, defaults to 0 |
|
| 106 | + * size: number, // specifies a max number of transform stats to get, defaults to 100 |
|
| 107 | + * timeout: time, // Controls the time to wait for the stats |
|
| 108 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 109 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 110 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 111 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 112 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 113 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 114 | + * } $params |
|
| 115 | + * |
|
| 116 | + * @throws MissingParameterException if a required parameter is missing |
|
| 117 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 118 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 119 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 120 | + * |
|
| 121 | + * @return Elasticsearch|Promise |
|
| 122 | + */ |
|
| 123 | + public function getTransformStats(array $params = []) |
|
| 124 | + { |
|
| 125 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 126 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
| 127 | + $method = 'GET'; |
|
| 128 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 129 | + $headers = ['Accept' => 'application/json']; |
|
| 130 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 131 | + } |
|
| 132 | + /** |
|
| 133 | + * Previews a transform. |
|
| 134 | + * |
|
| 135 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html |
|
| 136 | + * |
|
| 137 | + * @param array{ |
|
| 138 | + * transform_id: string, // The id of the transform to preview. |
|
| 139 | + * timeout: time, // Controls the time to wait for the preview |
|
| 140 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 141 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 142 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 143 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 144 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 145 | + * body: array, // The definition for the transform to preview |
|
| 146 | + * } $params |
|
| 147 | + * |
|
| 148 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 149 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 150 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 151 | + * |
|
| 152 | + * @return Elasticsearch|Promise |
|
| 153 | + */ |
|
| 154 | + public function previewTransform(array $params = []) |
|
| 155 | + { |
|
| 156 | + if (isset($params['transform_id'])) { |
|
| 157 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
| 158 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 159 | + } else { |
|
| 160 | + $url = '/_transform/_preview'; |
|
| 161 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 162 | + } |
|
| 163 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 164 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 165 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 166 | + } |
|
| 167 | + /** |
|
| 168 | + * Instantiates a transform. |
|
| 169 | + * |
|
| 170 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html |
|
| 171 | + * |
|
| 172 | + * @param array{ |
|
| 173 | + * transform_id: string, // (REQUIRED) The id of the new transform. |
|
| 174 | + * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
| 175 | + * timeout: time, // Controls the time to wait for the transform to start |
|
| 176 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 177 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 178 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 179 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 180 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 181 | + * body: array, // (REQUIRED) The transform definition |
|
| 182 | + * } $params |
|
| 183 | + * |
|
| 184 | + * @throws MissingParameterException if a required parameter is missing |
|
| 185 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 186 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 187 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 188 | + * |
|
| 189 | + * @return Elasticsearch|Promise |
|
| 190 | + */ |
|
| 191 | + public function putTransform(array $params = []) |
|
| 192 | + { |
|
| 193 | + $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
| 194 | + $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 195 | + $method = 'PUT'; |
|
| 196 | + $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 197 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 198 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 199 | + } |
|
| 200 | + /** |
|
| 201 | + * Resets an existing transform. |
|
| 202 | + * |
|
| 203 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html |
|
| 204 | + * |
|
| 205 | + * @param array{ |
|
| 206 | + * transform_id: string, // (REQUIRED) The id of the transform to reset |
|
| 207 | + * force: boolean, // When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. |
|
| 208 | + * timeout: time, // Controls the time to wait for the transform to reset |
|
| 209 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 210 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 211 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 212 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 213 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 214 | + * } $params |
|
| 215 | + * |
|
| 216 | + * @throws MissingParameterException if a required parameter is missing |
|
| 217 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 218 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 219 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 220 | + * |
|
| 221 | + * @return Elasticsearch|Promise |
|
| 222 | + */ |
|
| 223 | + public function resetTransform(array $params = []) |
|
| 224 | + { |
|
| 225 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 226 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
| 227 | + $method = 'POST'; |
|
| 228 | + $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 229 | + $headers = ['Accept' => 'application/json']; |
|
| 230 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 231 | + } |
|
| 232 | + /** |
|
| 233 | + * Schedules now a transform. |
|
| 234 | + * |
|
| 235 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html |
|
| 236 | + * |
|
| 237 | + * @param array{ |
|
| 238 | + * transform_id: string, // (REQUIRED) The id of the transform. |
|
| 239 | + * timeout: time, // Controls the time to wait for the scheduling to take place |
|
| 240 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 241 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 242 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 243 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 244 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 245 | + * } $params |
|
| 246 | + * |
|
| 247 | + * @throws MissingParameterException if a required parameter is missing |
|
| 248 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 249 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 250 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 251 | + * |
|
| 252 | + * @return Elasticsearch|Promise |
|
| 253 | + */ |
|
| 254 | + public function scheduleNowTransform(array $params = []) |
|
| 255 | + { |
|
| 256 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 257 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
| 258 | + $method = 'POST'; |
|
| 259 | + $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 260 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 261 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 262 | + } |
|
| 263 | + /** |
|
| 264 | + * Starts one or more transforms. |
|
| 265 | + * |
|
| 266 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html |
|
| 267 | + * |
|
| 268 | + * @param array{ |
|
| 269 | + * transform_id: string, // (REQUIRED) The id of the transform to start |
|
| 270 | + * from: string, // Restricts the set of transformed entities to those changed after this time |
|
| 271 | + * timeout: time, // Controls the time to wait for the transform to start |
|
| 272 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 273 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 274 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 275 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 276 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 277 | + * } $params |
|
| 278 | + * |
|
| 279 | + * @throws MissingParameterException if a required parameter is missing |
|
| 280 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 281 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 282 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 283 | + * |
|
| 284 | + * @return Elasticsearch|Promise |
|
| 285 | + */ |
|
| 286 | + public function startTransform(array $params = []) |
|
| 287 | + { |
|
| 288 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 289 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
| 290 | + $method = 'POST'; |
|
| 291 | + $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 292 | + $headers = ['Accept' => 'application/json']; |
|
| 293 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 294 | + } |
|
| 295 | + /** |
|
| 296 | + * Stops one or more transforms. |
|
| 297 | + * |
|
| 298 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html |
|
| 299 | + * |
|
| 300 | + * @param array{ |
|
| 301 | + * transform_id: string, // (REQUIRED) The id of the transform to stop |
|
| 302 | + * force: boolean, // Whether to force stop a failed transform or not. Default to false |
|
| 303 | + * wait_for_completion: boolean, // Whether to wait for the transform to fully stop before returning or not. Default to false |
|
| 304 | + * timeout: time, // Controls the time to wait until the transform has stopped. Default to 30 seconds |
|
| 305 | + * allow_no_match: boolean, // Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
|
| 306 | + * wait_for_checkpoint: boolean, // Whether to wait for the transform to reach a checkpoint before stopping. Default to false |
|
| 307 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 308 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 309 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 310 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 311 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 312 | + * } $params |
|
| 313 | + * |
|
| 314 | + * @throws MissingParameterException if a required parameter is missing |
|
| 315 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 316 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 317 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 318 | + * |
|
| 319 | + * @return Elasticsearch|Promise |
|
| 320 | + */ |
|
| 321 | + public function stopTransform(array $params = []) |
|
| 322 | + { |
|
| 323 | + $this->checkRequiredParameters(['transform_id'], $params); |
|
| 324 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
| 325 | + $method = 'POST'; |
|
| 326 | + $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 327 | + $headers = ['Accept' => 'application/json']; |
|
| 328 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 329 | + } |
|
| 330 | + /** |
|
| 331 | + * Updates certain properties of a transform. |
|
| 332 | + * |
|
| 333 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html |
|
| 334 | + * |
|
| 335 | + * @param array{ |
|
| 336 | + * transform_id: string, // (REQUIRED) The id of the transform. |
|
| 337 | + * defer_validation: boolean, // If validations should be deferred until transform starts, defaults to false. |
|
| 338 | + * timeout: time, // Controls the time to wait for the update |
|
| 339 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 340 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 341 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 342 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 343 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 344 | + * body: array, // (REQUIRED) The update transform definition |
|
| 345 | + * } $params |
|
| 346 | + * |
|
| 347 | + * @throws MissingParameterException if a required parameter is missing |
|
| 348 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 349 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 350 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 351 | + * |
|
| 352 | + * @return Elasticsearch|Promise |
|
| 353 | + */ |
|
| 354 | + public function updateTransform(array $params = []) |
|
| 355 | + { |
|
| 356 | + $this->checkRequiredParameters(['transform_id', 'body'], $params); |
|
| 357 | + $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
| 358 | + $method = 'POST'; |
|
| 359 | + $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 360 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 361 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 362 | + } |
|
| 363 | + /** |
|
| 364 | + * Upgrades all transforms. |
|
| 365 | + * |
|
| 366 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html |
|
| 367 | + * |
|
| 368 | + * @param array{ |
|
| 369 | + * dry_run: boolean, // Whether to only check for updates but don't execute |
|
| 370 | + * timeout: time, // Controls the time to wait for the upgrade |
|
| 371 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 372 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 373 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 374 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 375 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 376 | + * } $params |
|
| 377 | + * |
|
| 378 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 379 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 380 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 381 | + * |
|
| 382 | + * @return Elasticsearch|Promise |
|
| 383 | + */ |
|
| 384 | + public function upgradeTransforms(array $params = []) |
|
| 385 | + { |
|
| 386 | + $url = '/_transform/_upgrade'; |
|
| 387 | + $method = 'POST'; |
|
| 388 | + $url = $this->addQueryString($url, $params, ['dry_run', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 389 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 390 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 391 | + } |
|
| 392 | 392 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function deleteTransform(array $params = []) |
| 53 | 53 | { |
| 54 | 54 | $this->checkRequiredParameters(['transform_id'], $params); |
| 55 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 55 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
| 56 | 56 | $method = 'DELETE'; |
| 57 | 57 | $url = $this->addQueryString($url, $params, ['force', 'delete_dest_index', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 58 | 58 | $headers = ['Accept' => 'application/json']; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function getTransform(array $params = []) |
| 86 | 86 | { |
| 87 | 87 | if (isset($params['transform_id'])) { |
| 88 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 88 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
| 89 | 89 | $method = 'GET'; |
| 90 | 90 | } else { |
| 91 | 91 | $url = '/_transform'; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function getTransformStats(array $params = []) |
| 124 | 124 | { |
| 125 | 125 | $this->checkRequiredParameters(['transform_id'], $params); |
| 126 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stats'; |
|
| 126 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_stats'; |
|
| 127 | 127 | $method = 'GET'; |
| 128 | 128 | $url = $this->addQueryString($url, $params, ['from', 'size', 'timeout', 'allow_no_match', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 129 | 129 | $headers = ['Accept' => 'application/json']; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public function previewTransform(array $params = []) |
| 155 | 155 | { |
| 156 | 156 | if (isset($params['transform_id'])) { |
| 157 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview'; |
|
| 157 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_preview'; |
|
| 158 | 158 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 159 | 159 | } else { |
| 160 | 160 | $url = '/_transform/_preview'; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | public function putTransform(array $params = []) |
| 192 | 192 | { |
| 193 | 193 | $this->checkRequiredParameters(['transform_id', 'body'], $params); |
| 194 | - $url = '/_transform/' . $this->encode($params['transform_id']); |
|
| 194 | + $url = '/_transform/'.$this->encode($params['transform_id']); |
|
| 195 | 195 | $method = 'PUT'; |
| 196 | 196 | $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 197 | 197 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | public function resetTransform(array $params = []) |
| 224 | 224 | { |
| 225 | 225 | $this->checkRequiredParameters(['transform_id'], $params); |
| 226 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset'; |
|
| 226 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_reset'; |
|
| 227 | 227 | $method = 'POST'; |
| 228 | 228 | $url = $this->addQueryString($url, $params, ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 229 | 229 | $headers = ['Accept' => 'application/json']; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | public function scheduleNowTransform(array $params = []) |
| 255 | 255 | { |
| 256 | 256 | $this->checkRequiredParameters(['transform_id'], $params); |
| 257 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now'; |
|
| 257 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_schedule_now'; |
|
| 258 | 258 | $method = 'POST'; |
| 259 | 259 | $url = $this->addQueryString($url, $params, ['timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 260 | 260 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | public function startTransform(array $params = []) |
| 287 | 287 | { |
| 288 | 288 | $this->checkRequiredParameters(['transform_id'], $params); |
| 289 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_start'; |
|
| 289 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_start'; |
|
| 290 | 290 | $method = 'POST'; |
| 291 | 291 | $url = $this->addQueryString($url, $params, ['from', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 292 | 292 | $headers = ['Accept' => 'application/json']; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | public function stopTransform(array $params = []) |
| 322 | 322 | { |
| 323 | 323 | $this->checkRequiredParameters(['transform_id'], $params); |
| 324 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop'; |
|
| 324 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_stop'; |
|
| 325 | 325 | $method = 'POST'; |
| 326 | 326 | $url = $this->addQueryString($url, $params, ['force', 'wait_for_completion', 'timeout', 'allow_no_match', 'wait_for_checkpoint', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 327 | 327 | $headers = ['Accept' => 'application/json']; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | public function updateTransform(array $params = []) |
| 355 | 355 | { |
| 356 | 356 | $this->checkRequiredParameters(['transform_id', 'body'], $params); |
| 357 | - $url = '/_transform/' . $this->encode($params['transform_id']) . '/_update'; |
|
| 357 | + $url = '/_transform/'.$this->encode($params['transform_id']).'/_update'; |
|
| 358 | 358 | $method = 'POST'; |
| 359 | 359 | $url = $this->addQueryString($url, $params, ['defer_validation', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 360 | 360 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Transform extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Transform extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Deletes an existing transform. |
| 30 | 29 | * |
@@ -25,402 +25,402 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Watcher extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Acknowledges a watch, manually throttling the execution of the watch's actions. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * watch_id: string, // (REQUIRED) Watch ID |
|
| 35 | - * action_id: list, // A comma-separated list of the action ids to be acked |
|
| 36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | - * } $params |
|
| 42 | - * |
|
| 43 | - * @throws MissingParameterException if a required parameter is missing |
|
| 44 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 45 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 46 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 47 | - * |
|
| 48 | - * @return Elasticsearch|Promise |
|
| 49 | - */ |
|
| 50 | - public function ackWatch(array $params = []) |
|
| 51 | - { |
|
| 52 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
| 53 | - if (isset($params['action_id'])) { |
|
| 54 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
| 55 | - $method = 'PUT'; |
|
| 56 | - } else { |
|
| 57 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
| 58 | - $method = 'PUT'; |
|
| 59 | - } |
|
| 60 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 61 | - $headers = ['Accept' => 'application/json']; |
|
| 62 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 63 | - } |
|
| 64 | - /** |
|
| 65 | - * Activates a currently inactive watch. |
|
| 66 | - * |
|
| 67 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html |
|
| 68 | - * |
|
| 69 | - * @param array{ |
|
| 70 | - * watch_id: string, // (REQUIRED) Watch ID |
|
| 71 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 72 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 73 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 74 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 75 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 76 | - * } $params |
|
| 77 | - * |
|
| 78 | - * @throws MissingParameterException if a required parameter is missing |
|
| 79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | - * |
|
| 83 | - * @return Elasticsearch|Promise |
|
| 84 | - */ |
|
| 85 | - public function activateWatch(array $params = []) |
|
| 86 | - { |
|
| 87 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
| 88 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
| 89 | - $method = 'PUT'; |
|
| 90 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | - $headers = ['Accept' => 'application/json']; |
|
| 92 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 93 | - } |
|
| 94 | - /** |
|
| 95 | - * Deactivates a currently active watch. |
|
| 96 | - * |
|
| 97 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html |
|
| 98 | - * |
|
| 99 | - * @param array{ |
|
| 100 | - * watch_id: string, // (REQUIRED) Watch ID |
|
| 101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 106 | - * } $params |
|
| 107 | - * |
|
| 108 | - * @throws MissingParameterException if a required parameter is missing |
|
| 109 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 110 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 111 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 112 | - * |
|
| 113 | - * @return Elasticsearch|Promise |
|
| 114 | - */ |
|
| 115 | - public function deactivateWatch(array $params = []) |
|
| 116 | - { |
|
| 117 | - $this->checkRequiredParameters(['watch_id'], $params); |
|
| 118 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
| 119 | - $method = 'PUT'; |
|
| 120 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 121 | - $headers = ['Accept' => 'application/json']; |
|
| 122 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 123 | - } |
|
| 124 | - /** |
|
| 125 | - * Removes a watch from Watcher. |
|
| 126 | - * |
|
| 127 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html |
|
| 128 | - * |
|
| 129 | - * @param array{ |
|
| 130 | - * id: string, // (REQUIRED) Watch ID |
|
| 131 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 132 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 133 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 134 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 135 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 136 | - * } $params |
|
| 137 | - * |
|
| 138 | - * @throws MissingParameterException if a required parameter is missing |
|
| 139 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 140 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 141 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 142 | - * |
|
| 143 | - * @return Elasticsearch|Promise |
|
| 144 | - */ |
|
| 145 | - public function deleteWatch(array $params = []) |
|
| 146 | - { |
|
| 147 | - $this->checkRequiredParameters(['id'], $params); |
|
| 148 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 149 | - $method = 'DELETE'; |
|
| 150 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 151 | - $headers = ['Accept' => 'application/json']; |
|
| 152 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 153 | - } |
|
| 154 | - /** |
|
| 155 | - * Forces the execution of a stored watch. |
|
| 156 | - * |
|
| 157 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html |
|
| 158 | - * |
|
| 159 | - * @param array{ |
|
| 160 | - * id: string, // Watch ID |
|
| 161 | - * debug: boolean, // indicates whether the watch should execute in debug mode |
|
| 162 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 163 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 164 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 165 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 166 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 167 | - * body: array, // Execution control |
|
| 168 | - * } $params |
|
| 169 | - * |
|
| 170 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 171 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 172 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 173 | - * |
|
| 174 | - * @return Elasticsearch|Promise |
|
| 175 | - */ |
|
| 176 | - public function executeWatch(array $params = []) |
|
| 177 | - { |
|
| 178 | - if (isset($params['id'])) { |
|
| 179 | - $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
| 180 | - $method = 'PUT'; |
|
| 181 | - } else { |
|
| 182 | - $url = '/_watcher/watch/_execute'; |
|
| 183 | - $method = 'PUT'; |
|
| 184 | - } |
|
| 185 | - $url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 186 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 187 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 188 | - } |
|
| 189 | - /** |
|
| 190 | - * Retrieve settings for the watcher system index |
|
| 191 | - * |
|
| 192 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html |
|
| 193 | - * |
|
| 194 | - * @param array{ |
|
| 195 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 196 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 197 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 198 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 199 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 200 | - * } $params |
|
| 201 | - * |
|
| 202 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 203 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 204 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 205 | - * |
|
| 206 | - * @return Elasticsearch|Promise |
|
| 207 | - */ |
|
| 208 | - public function getSettings(array $params = []) |
|
| 209 | - { |
|
| 210 | - $url = '/_watcher/settings'; |
|
| 211 | - $method = 'GET'; |
|
| 212 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 213 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 214 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 215 | - } |
|
| 216 | - /** |
|
| 217 | - * Retrieves a watch by its ID. |
|
| 218 | - * |
|
| 219 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html |
|
| 220 | - * |
|
| 221 | - * @param array{ |
|
| 222 | - * id: string, // (REQUIRED) Watch ID |
|
| 223 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 224 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 225 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 226 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 227 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 228 | - * } $params |
|
| 229 | - * |
|
| 230 | - * @throws MissingParameterException if a required parameter is missing |
|
| 231 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 232 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 233 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 234 | - * |
|
| 235 | - * @return Elasticsearch|Promise |
|
| 236 | - */ |
|
| 237 | - public function getWatch(array $params = []) |
|
| 238 | - { |
|
| 239 | - $this->checkRequiredParameters(['id'], $params); |
|
| 240 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 241 | - $method = 'GET'; |
|
| 242 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 243 | - $headers = ['Accept' => 'application/json']; |
|
| 244 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 245 | - } |
|
| 246 | - /** |
|
| 247 | - * Creates a new watch, or updates an existing one. |
|
| 248 | - * |
|
| 249 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html |
|
| 250 | - * |
|
| 251 | - * @param array{ |
|
| 252 | - * id: string, // (REQUIRED) Watch ID |
|
| 253 | - * active: boolean, // Specify whether the watch is in/active by default |
|
| 254 | - * version: number, // Explicit version number for concurrency control |
|
| 255 | - * if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number |
|
| 256 | - * if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term |
|
| 257 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 258 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 259 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 260 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 261 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 262 | - * body: array, // The watch |
|
| 263 | - * } $params |
|
| 264 | - * |
|
| 265 | - * @throws MissingParameterException if a required parameter is missing |
|
| 266 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 267 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 268 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 269 | - * |
|
| 270 | - * @return Elasticsearch|Promise |
|
| 271 | - */ |
|
| 272 | - public function putWatch(array $params = []) |
|
| 273 | - { |
|
| 274 | - $this->checkRequiredParameters(['id'], $params); |
|
| 275 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 276 | - $method = 'PUT'; |
|
| 277 | - $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 278 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 279 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 280 | - } |
|
| 281 | - /** |
|
| 282 | - * Retrieves stored watches. |
|
| 283 | - * |
|
| 284 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html |
|
| 285 | - * |
|
| 286 | - * @param array{ |
|
| 287 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 288 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 289 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 290 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 291 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 292 | - * body: array, // From, size, query, sort and search_after |
|
| 293 | - * } $params |
|
| 294 | - * |
|
| 295 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 296 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 297 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 298 | - * |
|
| 299 | - * @return Elasticsearch|Promise |
|
| 300 | - */ |
|
| 301 | - public function queryWatches(array $params = []) |
|
| 302 | - { |
|
| 303 | - $url = '/_watcher/_query/watches'; |
|
| 304 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 305 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 306 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 307 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 308 | - } |
|
| 309 | - /** |
|
| 310 | - * Starts Watcher if it is not already running. |
|
| 311 | - * |
|
| 312 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html |
|
| 313 | - * |
|
| 314 | - * @param array{ |
|
| 315 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 316 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 317 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 318 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 319 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 320 | - * } $params |
|
| 321 | - * |
|
| 322 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 323 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 324 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 325 | - * |
|
| 326 | - * @return Elasticsearch|Promise |
|
| 327 | - */ |
|
| 328 | - public function start(array $params = []) |
|
| 329 | - { |
|
| 330 | - $url = '/_watcher/_start'; |
|
| 331 | - $method = 'POST'; |
|
| 332 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 333 | - $headers = ['Accept' => 'application/json']; |
|
| 334 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 335 | - } |
|
| 336 | - /** |
|
| 337 | - * Retrieves the current Watcher metrics. |
|
| 338 | - * |
|
| 339 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html |
|
| 340 | - * |
|
| 341 | - * @param array{ |
|
| 342 | - * metric: list, // Controls what additional stat metrics should be include in the response |
|
| 343 | - * emit_stacktraces: boolean, // Emits stack traces of currently running watches |
|
| 344 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 345 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 346 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 347 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 348 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 349 | - * } $params |
|
| 350 | - * |
|
| 351 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 352 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 353 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 354 | - * |
|
| 355 | - * @return Elasticsearch|Promise |
|
| 356 | - */ |
|
| 357 | - public function stats(array $params = []) |
|
| 358 | - { |
|
| 359 | - if (isset($params['metric'])) { |
|
| 360 | - $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
| 361 | - $method = 'GET'; |
|
| 362 | - } else { |
|
| 363 | - $url = '/_watcher/stats'; |
|
| 364 | - $method = 'GET'; |
|
| 365 | - } |
|
| 366 | - $url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 367 | - $headers = ['Accept' => 'application/json']; |
|
| 368 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 369 | - } |
|
| 370 | - /** |
|
| 371 | - * Stops Watcher if it is running. |
|
| 372 | - * |
|
| 373 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html |
|
| 374 | - * |
|
| 375 | - * @param array{ |
|
| 376 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 377 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 378 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 379 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 380 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 381 | - * } $params |
|
| 382 | - * |
|
| 383 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 384 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 385 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 386 | - * |
|
| 387 | - * @return Elasticsearch|Promise |
|
| 388 | - */ |
|
| 389 | - public function stop(array $params = []) |
|
| 390 | - { |
|
| 391 | - $url = '/_watcher/_stop'; |
|
| 392 | - $method = 'POST'; |
|
| 393 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 394 | - $headers = ['Accept' => 'application/json']; |
|
| 395 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 396 | - } |
|
| 397 | - /** |
|
| 398 | - * Update settings for the watcher system index |
|
| 399 | - * |
|
| 400 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html |
|
| 401 | - * |
|
| 402 | - * @param array{ |
|
| 403 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 404 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 405 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 406 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 407 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 408 | - * body: array, // (REQUIRED) An object with the new index settings |
|
| 409 | - * } $params |
|
| 410 | - * |
|
| 411 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 412 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 413 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 414 | - * |
|
| 415 | - * @return Elasticsearch|Promise |
|
| 416 | - */ |
|
| 417 | - public function updateSettings(array $params = []) |
|
| 418 | - { |
|
| 419 | - $this->checkRequiredParameters(['body'], $params); |
|
| 420 | - $url = '/_watcher/settings'; |
|
| 421 | - $method = 'PUT'; |
|
| 422 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 423 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 424 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 425 | - } |
|
| 28 | + /** |
|
| 29 | + * Acknowledges a watch, manually throttling the execution of the watch's actions. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * watch_id: string, // (REQUIRED) Watch ID |
|
| 35 | + * action_id: list, // A comma-separated list of the action ids to be acked |
|
| 36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 41 | + * } $params |
|
| 42 | + * |
|
| 43 | + * @throws MissingParameterException if a required parameter is missing |
|
| 44 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 45 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 46 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 47 | + * |
|
| 48 | + * @return Elasticsearch|Promise |
|
| 49 | + */ |
|
| 50 | + public function ackWatch(array $params = []) |
|
| 51 | + { |
|
| 52 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
| 53 | + if (isset($params['action_id'])) { |
|
| 54 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
| 55 | + $method = 'PUT'; |
|
| 56 | + } else { |
|
| 57 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
| 58 | + $method = 'PUT'; |
|
| 59 | + } |
|
| 60 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 61 | + $headers = ['Accept' => 'application/json']; |
|
| 62 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 63 | + } |
|
| 64 | + /** |
|
| 65 | + * Activates a currently inactive watch. |
|
| 66 | + * |
|
| 67 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html |
|
| 68 | + * |
|
| 69 | + * @param array{ |
|
| 70 | + * watch_id: string, // (REQUIRED) Watch ID |
|
| 71 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 72 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 73 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 74 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 75 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 76 | + * } $params |
|
| 77 | + * |
|
| 78 | + * @throws MissingParameterException if a required parameter is missing |
|
| 79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 82 | + * |
|
| 83 | + * @return Elasticsearch|Promise |
|
| 84 | + */ |
|
| 85 | + public function activateWatch(array $params = []) |
|
| 86 | + { |
|
| 87 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
| 88 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
| 89 | + $method = 'PUT'; |
|
| 90 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 91 | + $headers = ['Accept' => 'application/json']; |
|
| 92 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 93 | + } |
|
| 94 | + /** |
|
| 95 | + * Deactivates a currently active watch. |
|
| 96 | + * |
|
| 97 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html |
|
| 98 | + * |
|
| 99 | + * @param array{ |
|
| 100 | + * watch_id: string, // (REQUIRED) Watch ID |
|
| 101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 106 | + * } $params |
|
| 107 | + * |
|
| 108 | + * @throws MissingParameterException if a required parameter is missing |
|
| 109 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 110 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 111 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 112 | + * |
|
| 113 | + * @return Elasticsearch|Promise |
|
| 114 | + */ |
|
| 115 | + public function deactivateWatch(array $params = []) |
|
| 116 | + { |
|
| 117 | + $this->checkRequiredParameters(['watch_id'], $params); |
|
| 118 | + $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
| 119 | + $method = 'PUT'; |
|
| 120 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 121 | + $headers = ['Accept' => 'application/json']; |
|
| 122 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 123 | + } |
|
| 124 | + /** |
|
| 125 | + * Removes a watch from Watcher. |
|
| 126 | + * |
|
| 127 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html |
|
| 128 | + * |
|
| 129 | + * @param array{ |
|
| 130 | + * id: string, // (REQUIRED) Watch ID |
|
| 131 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 132 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 133 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 134 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 135 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 136 | + * } $params |
|
| 137 | + * |
|
| 138 | + * @throws MissingParameterException if a required parameter is missing |
|
| 139 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 140 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 141 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 142 | + * |
|
| 143 | + * @return Elasticsearch|Promise |
|
| 144 | + */ |
|
| 145 | + public function deleteWatch(array $params = []) |
|
| 146 | + { |
|
| 147 | + $this->checkRequiredParameters(['id'], $params); |
|
| 148 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 149 | + $method = 'DELETE'; |
|
| 150 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 151 | + $headers = ['Accept' => 'application/json']; |
|
| 152 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 153 | + } |
|
| 154 | + /** |
|
| 155 | + * Forces the execution of a stored watch. |
|
| 156 | + * |
|
| 157 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html |
|
| 158 | + * |
|
| 159 | + * @param array{ |
|
| 160 | + * id: string, // Watch ID |
|
| 161 | + * debug: boolean, // indicates whether the watch should execute in debug mode |
|
| 162 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 163 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 164 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 165 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 166 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 167 | + * body: array, // Execution control |
|
| 168 | + * } $params |
|
| 169 | + * |
|
| 170 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 171 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 172 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 173 | + * |
|
| 174 | + * @return Elasticsearch|Promise |
|
| 175 | + */ |
|
| 176 | + public function executeWatch(array $params = []) |
|
| 177 | + { |
|
| 178 | + if (isset($params['id'])) { |
|
| 179 | + $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
| 180 | + $method = 'PUT'; |
|
| 181 | + } else { |
|
| 182 | + $url = '/_watcher/watch/_execute'; |
|
| 183 | + $method = 'PUT'; |
|
| 184 | + } |
|
| 185 | + $url = $this->addQueryString($url, $params, ['debug', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 186 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 187 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 188 | + } |
|
| 189 | + /** |
|
| 190 | + * Retrieve settings for the watcher system index |
|
| 191 | + * |
|
| 192 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html |
|
| 193 | + * |
|
| 194 | + * @param array{ |
|
| 195 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 196 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 197 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 198 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 199 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 200 | + * } $params |
|
| 201 | + * |
|
| 202 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 203 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 204 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 205 | + * |
|
| 206 | + * @return Elasticsearch|Promise |
|
| 207 | + */ |
|
| 208 | + public function getSettings(array $params = []) |
|
| 209 | + { |
|
| 210 | + $url = '/_watcher/settings'; |
|
| 211 | + $method = 'GET'; |
|
| 212 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 213 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 214 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 215 | + } |
|
| 216 | + /** |
|
| 217 | + * Retrieves a watch by its ID. |
|
| 218 | + * |
|
| 219 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html |
|
| 220 | + * |
|
| 221 | + * @param array{ |
|
| 222 | + * id: string, // (REQUIRED) Watch ID |
|
| 223 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 224 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 225 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 226 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 227 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 228 | + * } $params |
|
| 229 | + * |
|
| 230 | + * @throws MissingParameterException if a required parameter is missing |
|
| 231 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 232 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 233 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 234 | + * |
|
| 235 | + * @return Elasticsearch|Promise |
|
| 236 | + */ |
|
| 237 | + public function getWatch(array $params = []) |
|
| 238 | + { |
|
| 239 | + $this->checkRequiredParameters(['id'], $params); |
|
| 240 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 241 | + $method = 'GET'; |
|
| 242 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 243 | + $headers = ['Accept' => 'application/json']; |
|
| 244 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 245 | + } |
|
| 246 | + /** |
|
| 247 | + * Creates a new watch, or updates an existing one. |
|
| 248 | + * |
|
| 249 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html |
|
| 250 | + * |
|
| 251 | + * @param array{ |
|
| 252 | + * id: string, // (REQUIRED) Watch ID |
|
| 253 | + * active: boolean, // Specify whether the watch is in/active by default |
|
| 254 | + * version: number, // Explicit version number for concurrency control |
|
| 255 | + * if_seq_no: number, // only update the watch if the last operation that has changed the watch has the specified sequence number |
|
| 256 | + * if_primary_term: number, // only update the watch if the last operation that has changed the watch has the specified primary term |
|
| 257 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 258 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 259 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 260 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 261 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 262 | + * body: array, // The watch |
|
| 263 | + * } $params |
|
| 264 | + * |
|
| 265 | + * @throws MissingParameterException if a required parameter is missing |
|
| 266 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 267 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 268 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 269 | + * |
|
| 270 | + * @return Elasticsearch|Promise |
|
| 271 | + */ |
|
| 272 | + public function putWatch(array $params = []) |
|
| 273 | + { |
|
| 274 | + $this->checkRequiredParameters(['id'], $params); |
|
| 275 | + $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 276 | + $method = 'PUT'; |
|
| 277 | + $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 278 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 279 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 280 | + } |
|
| 281 | + /** |
|
| 282 | + * Retrieves stored watches. |
|
| 283 | + * |
|
| 284 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html |
|
| 285 | + * |
|
| 286 | + * @param array{ |
|
| 287 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 288 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 289 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 290 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 291 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 292 | + * body: array, // From, size, query, sort and search_after |
|
| 293 | + * } $params |
|
| 294 | + * |
|
| 295 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 296 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 297 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 298 | + * |
|
| 299 | + * @return Elasticsearch|Promise |
|
| 300 | + */ |
|
| 301 | + public function queryWatches(array $params = []) |
|
| 302 | + { |
|
| 303 | + $url = '/_watcher/_query/watches'; |
|
| 304 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 305 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 306 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 307 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 308 | + } |
|
| 309 | + /** |
|
| 310 | + * Starts Watcher if it is not already running. |
|
| 311 | + * |
|
| 312 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html |
|
| 313 | + * |
|
| 314 | + * @param array{ |
|
| 315 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 316 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 317 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 318 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 319 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 320 | + * } $params |
|
| 321 | + * |
|
| 322 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 323 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 324 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 325 | + * |
|
| 326 | + * @return Elasticsearch|Promise |
|
| 327 | + */ |
|
| 328 | + public function start(array $params = []) |
|
| 329 | + { |
|
| 330 | + $url = '/_watcher/_start'; |
|
| 331 | + $method = 'POST'; |
|
| 332 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 333 | + $headers = ['Accept' => 'application/json']; |
|
| 334 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 335 | + } |
|
| 336 | + /** |
|
| 337 | + * Retrieves the current Watcher metrics. |
|
| 338 | + * |
|
| 339 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html |
|
| 340 | + * |
|
| 341 | + * @param array{ |
|
| 342 | + * metric: list, // Controls what additional stat metrics should be include in the response |
|
| 343 | + * emit_stacktraces: boolean, // Emits stack traces of currently running watches |
|
| 344 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 345 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 346 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 347 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 348 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 349 | + * } $params |
|
| 350 | + * |
|
| 351 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 352 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 353 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 354 | + * |
|
| 355 | + * @return Elasticsearch|Promise |
|
| 356 | + */ |
|
| 357 | + public function stats(array $params = []) |
|
| 358 | + { |
|
| 359 | + if (isset($params['metric'])) { |
|
| 360 | + $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
| 361 | + $method = 'GET'; |
|
| 362 | + } else { |
|
| 363 | + $url = '/_watcher/stats'; |
|
| 364 | + $method = 'GET'; |
|
| 365 | + } |
|
| 366 | + $url = $this->addQueryString($url, $params, ['emit_stacktraces', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 367 | + $headers = ['Accept' => 'application/json']; |
|
| 368 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 369 | + } |
|
| 370 | + /** |
|
| 371 | + * Stops Watcher if it is running. |
|
| 372 | + * |
|
| 373 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html |
|
| 374 | + * |
|
| 375 | + * @param array{ |
|
| 376 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 377 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 378 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 379 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 380 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 381 | + * } $params |
|
| 382 | + * |
|
| 383 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 384 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 385 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 386 | + * |
|
| 387 | + * @return Elasticsearch|Promise |
|
| 388 | + */ |
|
| 389 | + public function stop(array $params = []) |
|
| 390 | + { |
|
| 391 | + $url = '/_watcher/_stop'; |
|
| 392 | + $method = 'POST'; |
|
| 393 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 394 | + $headers = ['Accept' => 'application/json']; |
|
| 395 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 396 | + } |
|
| 397 | + /** |
|
| 398 | + * Update settings for the watcher system index |
|
| 399 | + * |
|
| 400 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html |
|
| 401 | + * |
|
| 402 | + * @param array{ |
|
| 403 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 404 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 405 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 406 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 407 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 408 | + * body: array, // (REQUIRED) An object with the new index settings |
|
| 409 | + * } $params |
|
| 410 | + * |
|
| 411 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 412 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 413 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 414 | + * |
|
| 415 | + * @return Elasticsearch|Promise |
|
| 416 | + */ |
|
| 417 | + public function updateSettings(array $params = []) |
|
| 418 | + { |
|
| 419 | + $this->checkRequiredParameters(['body'], $params); |
|
| 420 | + $url = '/_watcher/settings'; |
|
| 421 | + $method = 'PUT'; |
|
| 422 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 423 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 424 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 425 | + } |
|
| 426 | 426 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
| 12 | 12 | * See the LICENSE file in the project root for more information. |
| 13 | 13 | */ |
| 14 | -declare (strict_types=1); |
|
| 14 | +declare(strict_types=1); |
|
| 15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
| 16 | 16 | |
| 17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $this->checkRequiredParameters(['watch_id'], $params); |
| 53 | 53 | if (isset($params['action_id'])) { |
| 54 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack/' . $this->encode($params['action_id']); |
|
| 54 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack/'.$this->encode($params['action_id']); |
|
| 55 | 55 | $method = 'PUT'; |
| 56 | 56 | } else { |
| 57 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_ack'; |
|
| 57 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_ack'; |
|
| 58 | 58 | $method = 'PUT'; |
| 59 | 59 | } |
| 60 | 60 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function activateWatch(array $params = []) |
| 86 | 86 | { |
| 87 | 87 | $this->checkRequiredParameters(['watch_id'], $params); |
| 88 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_activate'; |
|
| 88 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_activate'; |
|
| 89 | 89 | $method = 'PUT'; |
| 90 | 90 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 91 | 91 | $headers = ['Accept' => 'application/json']; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | public function deactivateWatch(array $params = []) |
| 116 | 116 | { |
| 117 | 117 | $this->checkRequiredParameters(['watch_id'], $params); |
| 118 | - $url = '/_watcher/watch/' . $this->encode($params['watch_id']) . '/_deactivate'; |
|
| 118 | + $url = '/_watcher/watch/'.$this->encode($params['watch_id']).'/_deactivate'; |
|
| 119 | 119 | $method = 'PUT'; |
| 120 | 120 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 121 | 121 | $headers = ['Accept' => 'application/json']; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | public function deleteWatch(array $params = []) |
| 146 | 146 | { |
| 147 | 147 | $this->checkRequiredParameters(['id'], $params); |
| 148 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 148 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
| 149 | 149 | $method = 'DELETE'; |
| 150 | 150 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 151 | 151 | $headers = ['Accept' => 'application/json']; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | public function executeWatch(array $params = []) |
| 177 | 177 | { |
| 178 | 178 | if (isset($params['id'])) { |
| 179 | - $url = '/_watcher/watch/' . $this->encode($params['id']) . '/_execute'; |
|
| 179 | + $url = '/_watcher/watch/'.$this->encode($params['id']).'/_execute'; |
|
| 180 | 180 | $method = 'PUT'; |
| 181 | 181 | } else { |
| 182 | 182 | $url = '/_watcher/watch/_execute'; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | public function getWatch(array $params = []) |
| 238 | 238 | { |
| 239 | 239 | $this->checkRequiredParameters(['id'], $params); |
| 240 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 240 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
| 241 | 241 | $method = 'GET'; |
| 242 | 242 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 243 | 243 | $headers = ['Accept' => 'application/json']; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | public function putWatch(array $params = []) |
| 273 | 273 | { |
| 274 | 274 | $this->checkRequiredParameters(['id'], $params); |
| 275 | - $url = '/_watcher/watch/' . $this->encode($params['id']); |
|
| 275 | + $url = '/_watcher/watch/'.$this->encode($params['id']); |
|
| 276 | 276 | $method = 'PUT'; |
| 277 | 277 | $url = $this->addQueryString($url, $params, ['active', 'version', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 278 | 278 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | public function stats(array $params = []) |
| 358 | 358 | { |
| 359 | 359 | if (isset($params['metric'])) { |
| 360 | - $url = '/_watcher/stats/' . $this->encode($params['metric']); |
|
| 360 | + $url = '/_watcher/stats/'.$this->encode($params['metric']); |
|
| 361 | 361 | $method = 'GET'; |
| 362 | 362 | } else { |
| 363 | 363 | $url = '/_watcher/stats'; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Watcher extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Watcher extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Acknowledges a watch, manually throttling the execution of the watch's actions. |
| 30 | 29 | * |
@@ -25,1843 +25,1843 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Security extends AbstractEndpoint |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * Creates or updates the user profile on behalf of another user. |
|
| 30 | - * |
|
| 31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html |
|
| 32 | - * |
|
| 33 | - * @param array{ |
|
| 34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | - * body: array, // (REQUIRED) The grant type and user's credential |
|
| 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 activateUserProfile(array $params = []) |
|
| 49 | - { |
|
| 50 | - $this->checkRequiredParameters(['body'], $params); |
|
| 51 | - $url = '/_security/profile/_activate'; |
|
| 52 | - $method = 'POST'; |
|
| 53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 55 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 56 | - } |
|
| 57 | - /** |
|
| 58 | - * Enables authentication as a user and retrieve information about the authenticated user. |
|
| 59 | - * |
|
| 60 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html |
|
| 61 | - * |
|
| 62 | - * @param array{ |
|
| 63 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 64 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 65 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 66 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 67 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 68 | - * } $params |
|
| 69 | - * |
|
| 70 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 71 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 72 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 73 | - * |
|
| 74 | - * @return Elasticsearch|Promise |
|
| 75 | - */ |
|
| 76 | - public function authenticate(array $params = []) |
|
| 77 | - { |
|
| 78 | - $url = '/_security/_authenticate'; |
|
| 79 | - $method = 'GET'; |
|
| 80 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 81 | - $headers = ['Accept' => 'application/json']; |
|
| 82 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 83 | - } |
|
| 84 | - /** |
|
| 85 | - * Updates the attributes of multiple existing API keys. |
|
| 86 | - * |
|
| 87 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html |
|
| 88 | - * |
|
| 89 | - * @param array{ |
|
| 90 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 91 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 92 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 93 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 94 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 95 | - * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys. |
|
| 96 | - * } $params |
|
| 97 | - * |
|
| 98 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 99 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 100 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 101 | - * |
|
| 102 | - * @return Elasticsearch|Promise |
|
| 103 | - */ |
|
| 104 | - public function bulkUpdateApiKeys(array $params = []) |
|
| 105 | - { |
|
| 106 | - $this->checkRequiredParameters(['body'], $params); |
|
| 107 | - $url = '/_security/api_key/_bulk_update'; |
|
| 108 | - $method = 'POST'; |
|
| 109 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 110 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 111 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 112 | - } |
|
| 113 | - /** |
|
| 114 | - * Changes the passwords of users in the native realm and built-in users. |
|
| 115 | - * |
|
| 116 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html |
|
| 117 | - * |
|
| 118 | - * @param array{ |
|
| 119 | - * username: string, // The username of the user to change the password for |
|
| 120 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 121 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 122 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 123 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 124 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 125 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 126 | - * body: array, // (REQUIRED) the new password for the user |
|
| 127 | - * } $params |
|
| 128 | - * |
|
| 129 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 130 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 131 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 132 | - * |
|
| 133 | - * @return Elasticsearch|Promise |
|
| 134 | - */ |
|
| 135 | - public function changePassword(array $params = []) |
|
| 136 | - { |
|
| 137 | - $this->checkRequiredParameters(['body'], $params); |
|
| 138 | - if (isset($params['username'])) { |
|
| 139 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
| 140 | - $method = 'PUT'; |
|
| 141 | - } else { |
|
| 142 | - $url = '/_security/user/_password'; |
|
| 143 | - $method = 'PUT'; |
|
| 144 | - } |
|
| 145 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 146 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 147 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 148 | - } |
|
| 149 | - /** |
|
| 150 | - * Clear a subset or all entries from the API key cache. |
|
| 151 | - * |
|
| 152 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html |
|
| 153 | - * |
|
| 154 | - * @param array{ |
|
| 155 | - * ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache |
|
| 156 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 157 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 158 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 159 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 160 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 161 | - * } $params |
|
| 162 | - * |
|
| 163 | - * @throws MissingParameterException if a required parameter is missing |
|
| 164 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 165 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 166 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 167 | - * |
|
| 168 | - * @return Elasticsearch|Promise |
|
| 169 | - */ |
|
| 170 | - public function clearApiKeyCache(array $params = []) |
|
| 171 | - { |
|
| 172 | - $this->checkRequiredParameters(['ids'], $params); |
|
| 173 | - $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
| 174 | - $method = 'POST'; |
|
| 175 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 176 | - $headers = ['Accept' => 'application/json']; |
|
| 177 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 178 | - } |
|
| 179 | - /** |
|
| 180 | - * Evicts application privileges from the native application privileges cache. |
|
| 181 | - * |
|
| 182 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html |
|
| 183 | - * |
|
| 184 | - * @param array{ |
|
| 185 | - * application: list, // (REQUIRED) A comma-separated list of application names |
|
| 186 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 187 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 188 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 189 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 190 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 191 | - * } $params |
|
| 192 | - * |
|
| 193 | - * @throws MissingParameterException if a required parameter is missing |
|
| 194 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 195 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 196 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 197 | - * |
|
| 198 | - * @return Elasticsearch|Promise |
|
| 199 | - */ |
|
| 200 | - public function clearCachedPrivileges(array $params = []) |
|
| 201 | - { |
|
| 202 | - $this->checkRequiredParameters(['application'], $params); |
|
| 203 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
| 204 | - $method = 'POST'; |
|
| 205 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 206 | - $headers = ['Accept' => 'application/json']; |
|
| 207 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 208 | - } |
|
| 209 | - /** |
|
| 210 | - * Evicts users from the user cache. Can completely clear the cache or evict specific users. |
|
| 211 | - * |
|
| 212 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html |
|
| 213 | - * |
|
| 214 | - * @param array{ |
|
| 215 | - * realms: list, // (REQUIRED) Comma-separated list of realms to clear |
|
| 216 | - * usernames: list, // Comma-separated list of usernames to clear from the cache |
|
| 217 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 218 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 219 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 220 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 221 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 222 | - * } $params |
|
| 223 | - * |
|
| 224 | - * @throws MissingParameterException if a required parameter is missing |
|
| 225 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 226 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 227 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 228 | - * |
|
| 229 | - * @return Elasticsearch|Promise |
|
| 230 | - */ |
|
| 231 | - public function clearCachedRealms(array $params = []) |
|
| 232 | - { |
|
| 233 | - $this->checkRequiredParameters(['realms'], $params); |
|
| 234 | - $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
| 235 | - $method = 'POST'; |
|
| 236 | - $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 237 | - $headers = ['Accept' => 'application/json']; |
|
| 238 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 239 | - } |
|
| 240 | - /** |
|
| 241 | - * Evicts roles from the native role cache. |
|
| 242 | - * |
|
| 243 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html |
|
| 244 | - * |
|
| 245 | - * @param array{ |
|
| 246 | - * name: list, // (REQUIRED) Role name |
|
| 247 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 248 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 249 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 250 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 251 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 252 | - * } $params |
|
| 253 | - * |
|
| 254 | - * @throws MissingParameterException if a required parameter is missing |
|
| 255 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 256 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 257 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 258 | - * |
|
| 259 | - * @return Elasticsearch|Promise |
|
| 260 | - */ |
|
| 261 | - public function clearCachedRoles(array $params = []) |
|
| 262 | - { |
|
| 263 | - $this->checkRequiredParameters(['name'], $params); |
|
| 264 | - $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 265 | - $method = 'POST'; |
|
| 266 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 267 | - $headers = ['Accept' => 'application/json']; |
|
| 268 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 269 | - } |
|
| 270 | - /** |
|
| 271 | - * Evicts tokens from the service account token caches. |
|
| 272 | - * |
|
| 273 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html |
|
| 274 | - * |
|
| 275 | - * @param array{ |
|
| 276 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 277 | - * service: string, // (REQUIRED) An identifier for the service name |
|
| 278 | - * name: list, // (REQUIRED) A comma-separated list of service token names |
|
| 279 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 280 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 281 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 282 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 283 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 284 | - * } $params |
|
| 285 | - * |
|
| 286 | - * @throws MissingParameterException if a required parameter is missing |
|
| 287 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 288 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 289 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 290 | - * |
|
| 291 | - * @return Elasticsearch|Promise |
|
| 292 | - */ |
|
| 293 | - public function clearCachedServiceTokens(array $params = []) |
|
| 294 | - { |
|
| 295 | - $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 296 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 297 | - $method = 'POST'; |
|
| 298 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 299 | - $headers = ['Accept' => 'application/json']; |
|
| 300 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 301 | - } |
|
| 302 | - /** |
|
| 303 | - * Creates an API key for access without requiring basic authentication. |
|
| 304 | - * |
|
| 305 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
| 306 | - * |
|
| 307 | - * @param array{ |
|
| 308 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 309 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 310 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 311 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 312 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 313 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 314 | - * body: array, // (REQUIRED) The api key request to create an API key |
|
| 315 | - * } $params |
|
| 316 | - * |
|
| 317 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 318 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 319 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 320 | - * |
|
| 321 | - * @return Elasticsearch|Promise |
|
| 322 | - */ |
|
| 323 | - public function createApiKey(array $params = []) |
|
| 324 | - { |
|
| 325 | - $this->checkRequiredParameters(['body'], $params); |
|
| 326 | - $url = '/_security/api_key'; |
|
| 327 | - $method = 'PUT'; |
|
| 328 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 329 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 330 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 331 | - } |
|
| 332 | - /** |
|
| 333 | - * Creates a cross-cluster API key for API key based remote cluster access. |
|
| 334 | - * |
|
| 335 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html |
|
| 336 | - * |
|
| 337 | - * @param array{ |
|
| 338 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 339 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 340 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 341 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 342 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 343 | - * body: array, // (REQUIRED) The request to create a cross-cluster API key |
|
| 344 | - * } $params |
|
| 345 | - * |
|
| 346 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 347 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 348 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 349 | - * |
|
| 350 | - * @return Elasticsearch|Promise |
|
| 351 | - */ |
|
| 352 | - public function createCrossClusterApiKey(array $params = []) |
|
| 353 | - { |
|
| 354 | - $this->checkRequiredParameters(['body'], $params); |
|
| 355 | - $url = '/_security/cross_cluster/api_key'; |
|
| 356 | - $method = 'POST'; |
|
| 357 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 358 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 359 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 360 | - } |
|
| 361 | - /** |
|
| 362 | - * Creates a service account token for access without requiring basic authentication. |
|
| 363 | - * |
|
| 364 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html |
|
| 365 | - * |
|
| 366 | - * @param array{ |
|
| 367 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 368 | - * service: string, // (REQUIRED) An identifier for the service name |
|
| 369 | - * name: string, // An identifier for the token name |
|
| 370 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 371 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 372 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 373 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 374 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 375 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 376 | - * } $params |
|
| 377 | - * |
|
| 378 | - * @throws MissingParameterException if a required parameter is missing |
|
| 379 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 380 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 381 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 382 | - * |
|
| 383 | - * @return Elasticsearch|Promise |
|
| 384 | - */ |
|
| 385 | - public function createServiceToken(array $params = []) |
|
| 386 | - { |
|
| 387 | - $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 388 | - if (isset($params['name'])) { |
|
| 389 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 390 | - $method = 'PUT'; |
|
| 391 | - } else { |
|
| 392 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
| 393 | - $method = 'POST'; |
|
| 394 | - } |
|
| 395 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 396 | - $headers = ['Accept' => 'application/json']; |
|
| 397 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 398 | - } |
|
| 399 | - /** |
|
| 400 | - * Removes application privileges. |
|
| 401 | - * |
|
| 402 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html |
|
| 403 | - * |
|
| 404 | - * @param array{ |
|
| 405 | - * application: string, // (REQUIRED) Application name |
|
| 406 | - * name: string, // (REQUIRED) Privilege name |
|
| 407 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 408 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 409 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 410 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 411 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 412 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 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 deletePrivileges(array $params = []) |
|
| 423 | - { |
|
| 424 | - $this->checkRequiredParameters(['application', 'name'], $params); |
|
| 425 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 426 | - $method = 'DELETE'; |
|
| 427 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 428 | - $headers = ['Accept' => 'application/json']; |
|
| 429 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 430 | - } |
|
| 431 | - /** |
|
| 432 | - * Removes roles in the native realm. |
|
| 433 | - * |
|
| 434 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html |
|
| 435 | - * |
|
| 436 | - * @param array{ |
|
| 437 | - * name: string, // (REQUIRED) Role name |
|
| 438 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 439 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 440 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 441 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 442 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 443 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 444 | - * } $params |
|
| 445 | - * |
|
| 446 | - * @throws MissingParameterException if a required parameter is missing |
|
| 447 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 448 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 449 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 450 | - * |
|
| 451 | - * @return Elasticsearch|Promise |
|
| 452 | - */ |
|
| 453 | - public function deleteRole(array $params = []) |
|
| 454 | - { |
|
| 455 | - $this->checkRequiredParameters(['name'], $params); |
|
| 456 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 457 | - $method = 'DELETE'; |
|
| 458 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 459 | - $headers = ['Accept' => 'application/json']; |
|
| 460 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 461 | - } |
|
| 462 | - /** |
|
| 463 | - * Removes role mappings. |
|
| 464 | - * |
|
| 465 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html |
|
| 466 | - * |
|
| 467 | - * @param array{ |
|
| 468 | - * name: string, // (REQUIRED) Role-mapping name |
|
| 469 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 470 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 471 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 472 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 473 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 474 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 475 | - * } $params |
|
| 476 | - * |
|
| 477 | - * @throws MissingParameterException if a required parameter is missing |
|
| 478 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 479 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 480 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 481 | - * |
|
| 482 | - * @return Elasticsearch|Promise |
|
| 483 | - */ |
|
| 484 | - public function deleteRoleMapping(array $params = []) |
|
| 485 | - { |
|
| 486 | - $this->checkRequiredParameters(['name'], $params); |
|
| 487 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 488 | - $method = 'DELETE'; |
|
| 489 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 490 | - $headers = ['Accept' => 'application/json']; |
|
| 491 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 492 | - } |
|
| 493 | - /** |
|
| 494 | - * Deletes a service account token. |
|
| 495 | - * |
|
| 496 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html |
|
| 497 | - * |
|
| 498 | - * @param array{ |
|
| 499 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 500 | - * service: string, // (REQUIRED) An identifier for the service name |
|
| 501 | - * name: string, // (REQUIRED) An identifier for the token name |
|
| 502 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 503 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 504 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 505 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 506 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 507 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 508 | - * } $params |
|
| 509 | - * |
|
| 510 | - * @throws MissingParameterException if a required parameter is missing |
|
| 511 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 512 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 513 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 514 | - * |
|
| 515 | - * @return Elasticsearch|Promise |
|
| 516 | - */ |
|
| 517 | - public function deleteServiceToken(array $params = []) |
|
| 518 | - { |
|
| 519 | - $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 520 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 521 | - $method = 'DELETE'; |
|
| 522 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 523 | - $headers = ['Accept' => 'application/json']; |
|
| 524 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 525 | - } |
|
| 526 | - /** |
|
| 527 | - * Deletes users from the native realm. |
|
| 528 | - * |
|
| 529 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html |
|
| 530 | - * |
|
| 531 | - * @param array{ |
|
| 532 | - * username: string, // (REQUIRED) username |
|
| 533 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 534 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 535 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 536 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 537 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 538 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 539 | - * } $params |
|
| 540 | - * |
|
| 541 | - * @throws MissingParameterException if a required parameter is missing |
|
| 542 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 543 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 544 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 545 | - * |
|
| 546 | - * @return Elasticsearch|Promise |
|
| 547 | - */ |
|
| 548 | - public function deleteUser(array $params = []) |
|
| 549 | - { |
|
| 550 | - $this->checkRequiredParameters(['username'], $params); |
|
| 551 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 552 | - $method = 'DELETE'; |
|
| 553 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 554 | - $headers = ['Accept' => 'application/json']; |
|
| 555 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 556 | - } |
|
| 557 | - /** |
|
| 558 | - * Disables users in the native realm. |
|
| 559 | - * |
|
| 560 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html |
|
| 561 | - * |
|
| 562 | - * @param array{ |
|
| 563 | - * username: string, // (REQUIRED) The username of the user to disable |
|
| 564 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 565 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 566 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 567 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 568 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 569 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 570 | - * } $params |
|
| 571 | - * |
|
| 572 | - * @throws MissingParameterException if a required parameter is missing |
|
| 573 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 574 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 575 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 576 | - * |
|
| 577 | - * @return Elasticsearch|Promise |
|
| 578 | - */ |
|
| 579 | - public function disableUser(array $params = []) |
|
| 580 | - { |
|
| 581 | - $this->checkRequiredParameters(['username'], $params); |
|
| 582 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
| 583 | - $method = 'PUT'; |
|
| 584 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 585 | - $headers = ['Accept' => 'application/json']; |
|
| 586 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 587 | - } |
|
| 588 | - /** |
|
| 589 | - * Disables a user profile so it's not visible in user profile searches. |
|
| 590 | - * |
|
| 591 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html |
|
| 592 | - * |
|
| 593 | - * @param array{ |
|
| 594 | - * uid: string, // (REQUIRED) Unique identifier for the user profile |
|
| 595 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 596 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 597 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 598 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 599 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 600 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 601 | - * } $params |
|
| 602 | - * |
|
| 603 | - * @throws MissingParameterException if a required parameter is missing |
|
| 604 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 605 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 606 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 607 | - * |
|
| 608 | - * @return Elasticsearch|Promise |
|
| 609 | - */ |
|
| 610 | - public function disableUserProfile(array $params = []) |
|
| 611 | - { |
|
| 612 | - $this->checkRequiredParameters(['uid'], $params); |
|
| 613 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
| 614 | - $method = 'PUT'; |
|
| 615 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 616 | - $headers = ['Accept' => 'application/json']; |
|
| 617 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 618 | - } |
|
| 619 | - /** |
|
| 620 | - * Enables users in the native realm. |
|
| 621 | - * |
|
| 622 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html |
|
| 623 | - * |
|
| 624 | - * @param array{ |
|
| 625 | - * username: string, // (REQUIRED) The username of the user to enable |
|
| 626 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 627 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 628 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 629 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 630 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 631 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 632 | - * } $params |
|
| 633 | - * |
|
| 634 | - * @throws MissingParameterException if a required parameter is missing |
|
| 635 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 636 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 637 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 638 | - * |
|
| 639 | - * @return Elasticsearch|Promise |
|
| 640 | - */ |
|
| 641 | - public function enableUser(array $params = []) |
|
| 642 | - { |
|
| 643 | - $this->checkRequiredParameters(['username'], $params); |
|
| 644 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
| 645 | - $method = 'PUT'; |
|
| 646 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 647 | - $headers = ['Accept' => 'application/json']; |
|
| 648 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 649 | - } |
|
| 650 | - /** |
|
| 651 | - * Enables a user profile so it's visible in user profile searches. |
|
| 652 | - * |
|
| 653 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html |
|
| 654 | - * |
|
| 655 | - * @param array{ |
|
| 656 | - * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
| 657 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 658 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 659 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 660 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 661 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 662 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 663 | - * } $params |
|
| 664 | - * |
|
| 665 | - * @throws MissingParameterException if a required parameter is missing |
|
| 666 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 667 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 668 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 669 | - * |
|
| 670 | - * @return Elasticsearch|Promise |
|
| 671 | - */ |
|
| 672 | - public function enableUserProfile(array $params = []) |
|
| 673 | - { |
|
| 674 | - $this->checkRequiredParameters(['uid'], $params); |
|
| 675 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
| 676 | - $method = 'PUT'; |
|
| 677 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 678 | - $headers = ['Accept' => 'application/json']; |
|
| 679 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 680 | - } |
|
| 681 | - /** |
|
| 682 | - * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. |
|
| 683 | - * |
|
| 684 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html |
|
| 685 | - * |
|
| 686 | - * @param array{ |
|
| 687 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 688 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 689 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 690 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 691 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 692 | - * } $params |
|
| 693 | - * |
|
| 694 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 695 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 696 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 697 | - * |
|
| 698 | - * @return Elasticsearch|Promise |
|
| 699 | - */ |
|
| 700 | - public function enrollKibana(array $params = []) |
|
| 701 | - { |
|
| 702 | - $url = '/_security/enroll/kibana'; |
|
| 703 | - $method = 'GET'; |
|
| 704 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 705 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 706 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 707 | - } |
|
| 708 | - /** |
|
| 709 | - * Allows a new node to enroll to an existing cluster with security enabled. |
|
| 710 | - * |
|
| 711 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html |
|
| 712 | - * |
|
| 713 | - * @param array{ |
|
| 714 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 715 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 716 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 717 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 718 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 719 | - * } $params |
|
| 720 | - * |
|
| 721 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 722 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 723 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 724 | - * |
|
| 725 | - * @return Elasticsearch|Promise |
|
| 726 | - */ |
|
| 727 | - public function enrollNode(array $params = []) |
|
| 728 | - { |
|
| 729 | - $url = '/_security/enroll/node'; |
|
| 730 | - $method = 'GET'; |
|
| 731 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 732 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 733 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 734 | - } |
|
| 735 | - /** |
|
| 736 | - * Retrieves information for one or more API keys. |
|
| 737 | - * |
|
| 738 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html |
|
| 739 | - * |
|
| 740 | - * @param array{ |
|
| 741 | - * id: string, // API key id of the API key to be retrieved |
|
| 742 | - * name: string, // API key name of the API key to be retrieved |
|
| 743 | - * username: string, // user name of the user who created this API key to be retrieved |
|
| 744 | - * realm_name: string, // realm name of the user who created this API key to be retrieved |
|
| 745 | - * owner: boolean, // flag to query API keys owned by the currently authenticated user |
|
| 746 | - * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
| 747 | - * active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys |
|
| 748 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 749 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 750 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 751 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 752 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 753 | - * } $params |
|
| 754 | - * |
|
| 755 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 756 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 757 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 758 | - * |
|
| 759 | - * @return Elasticsearch|Promise |
|
| 760 | - */ |
|
| 761 | - public function getApiKey(array $params = []) |
|
| 762 | - { |
|
| 763 | - $url = '/_security/api_key'; |
|
| 764 | - $method = 'GET'; |
|
| 765 | - $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 766 | - $headers = ['Accept' => 'application/json']; |
|
| 767 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 768 | - } |
|
| 769 | - /** |
|
| 770 | - * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. |
|
| 771 | - * |
|
| 772 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html |
|
| 773 | - * |
|
| 774 | - * @param array{ |
|
| 775 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 776 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 777 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 778 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 779 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 780 | - * } $params |
|
| 781 | - * |
|
| 782 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 783 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 784 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 785 | - * |
|
| 786 | - * @return Elasticsearch|Promise |
|
| 787 | - */ |
|
| 788 | - public function getBuiltinPrivileges(array $params = []) |
|
| 789 | - { |
|
| 790 | - $url = '/_security/privilege/_builtin'; |
|
| 791 | - $method = 'GET'; |
|
| 792 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 793 | - $headers = ['Accept' => 'application/json']; |
|
| 794 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 795 | - } |
|
| 796 | - /** |
|
| 797 | - * Retrieves application privileges. |
|
| 798 | - * |
|
| 799 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html |
|
| 800 | - * |
|
| 801 | - * @param array{ |
|
| 802 | - * application: string, // Application name |
|
| 803 | - * name: string, // Privilege name |
|
| 804 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 805 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 806 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 807 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 808 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 809 | - * } $params |
|
| 810 | - * |
|
| 811 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 812 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 813 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 814 | - * |
|
| 815 | - * @return Elasticsearch|Promise |
|
| 816 | - */ |
|
| 817 | - public function getPrivileges(array $params = []) |
|
| 818 | - { |
|
| 819 | - if (isset($params['application']) && isset($params['name'])) { |
|
| 820 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 821 | - $method = 'GET'; |
|
| 822 | - } elseif (isset($params['application'])) { |
|
| 823 | - $url = '/_security/privilege/' . $this->encode($params['application']); |
|
| 824 | - $method = 'GET'; |
|
| 825 | - } else { |
|
| 826 | - $url = '/_security/privilege'; |
|
| 827 | - $method = 'GET'; |
|
| 828 | - } |
|
| 829 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 830 | - $headers = ['Accept' => 'application/json']; |
|
| 831 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 832 | - } |
|
| 833 | - /** |
|
| 834 | - * Retrieves roles in the native realm. |
|
| 835 | - * |
|
| 836 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html |
|
| 837 | - * |
|
| 838 | - * @param array{ |
|
| 839 | - * name: list, // A comma-separated list of role names |
|
| 840 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 841 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 842 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 843 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 844 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 845 | - * } $params |
|
| 846 | - * |
|
| 847 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 848 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 849 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 850 | - * |
|
| 851 | - * @return Elasticsearch|Promise |
|
| 852 | - */ |
|
| 853 | - public function getRole(array $params = []) |
|
| 854 | - { |
|
| 855 | - if (isset($params['name'])) { |
|
| 856 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 857 | - $method = 'GET'; |
|
| 858 | - } else { |
|
| 859 | - $url = '/_security/role'; |
|
| 860 | - $method = 'GET'; |
|
| 861 | - } |
|
| 862 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 863 | - $headers = ['Accept' => 'application/json']; |
|
| 864 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 865 | - } |
|
| 866 | - /** |
|
| 867 | - * Retrieves role mappings. |
|
| 868 | - * |
|
| 869 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html |
|
| 870 | - * |
|
| 871 | - * @param array{ |
|
| 872 | - * name: list, // A comma-separated list of role-mapping names |
|
| 873 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 874 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 875 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 876 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 877 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 878 | - * } $params |
|
| 879 | - * |
|
| 880 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 881 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 882 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 883 | - * |
|
| 884 | - * @return Elasticsearch|Promise |
|
| 885 | - */ |
|
| 886 | - public function getRoleMapping(array $params = []) |
|
| 887 | - { |
|
| 888 | - if (isset($params['name'])) { |
|
| 889 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 890 | - $method = 'GET'; |
|
| 891 | - } else { |
|
| 892 | - $url = '/_security/role_mapping'; |
|
| 893 | - $method = 'GET'; |
|
| 894 | - } |
|
| 895 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 896 | - $headers = ['Accept' => 'application/json']; |
|
| 897 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 898 | - } |
|
| 899 | - /** |
|
| 900 | - * Retrieves information about service accounts. |
|
| 901 | - * |
|
| 902 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html |
|
| 903 | - * |
|
| 904 | - * @param array{ |
|
| 905 | - * namespace: string, // An identifier for the namespace |
|
| 906 | - * service: string, // An identifier for the service name |
|
| 907 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 908 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 909 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 910 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 911 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 912 | - * } $params |
|
| 913 | - * |
|
| 914 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 915 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 916 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 917 | - * |
|
| 918 | - * @return Elasticsearch|Promise |
|
| 919 | - */ |
|
| 920 | - public function getServiceAccounts(array $params = []) |
|
| 921 | - { |
|
| 922 | - if (isset($params['namespace']) && isset($params['service'])) { |
|
| 923 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
| 924 | - $method = 'GET'; |
|
| 925 | - } elseif (isset($params['namespace'])) { |
|
| 926 | - $url = '/_security/service/' . $this->encode($params['namespace']); |
|
| 927 | - $method = 'GET'; |
|
| 928 | - } else { |
|
| 929 | - $url = '/_security/service'; |
|
| 930 | - $method = 'GET'; |
|
| 931 | - } |
|
| 932 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 933 | - $headers = ['Accept' => 'application/json']; |
|
| 934 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 935 | - } |
|
| 936 | - /** |
|
| 937 | - * Retrieves information of all service credentials for a service account. |
|
| 938 | - * |
|
| 939 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html |
|
| 940 | - * |
|
| 941 | - * @param array{ |
|
| 942 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 943 | - * service: string, // (REQUIRED) An identifier for the service name |
|
| 944 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 945 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 946 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 947 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 948 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 949 | - * } $params |
|
| 950 | - * |
|
| 951 | - * @throws MissingParameterException if a required parameter is missing |
|
| 952 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 953 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 954 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 955 | - * |
|
| 956 | - * @return Elasticsearch|Promise |
|
| 957 | - */ |
|
| 958 | - public function getServiceCredentials(array $params = []) |
|
| 959 | - { |
|
| 960 | - $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 961 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
| 962 | - $method = 'GET'; |
|
| 963 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 964 | - $headers = ['Accept' => 'application/json']; |
|
| 965 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 966 | - } |
|
| 967 | - /** |
|
| 968 | - * Retrieve settings for the security system indices |
|
| 969 | - * |
|
| 970 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html |
|
| 971 | - * |
|
| 972 | - * @param array{ |
|
| 973 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 974 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 975 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 976 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 977 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 978 | - * } $params |
|
| 979 | - * |
|
| 980 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 981 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 982 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 983 | - * |
|
| 984 | - * @return Elasticsearch|Promise |
|
| 985 | - */ |
|
| 986 | - public function getSettings(array $params = []) |
|
| 987 | - { |
|
| 988 | - $url = '/_security/settings'; |
|
| 989 | - $method = 'GET'; |
|
| 990 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 991 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 992 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 993 | - } |
|
| 994 | - /** |
|
| 995 | - * Creates a bearer token for access without requiring basic authentication. |
|
| 996 | - * |
|
| 997 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html |
|
| 998 | - * |
|
| 999 | - * @param array{ |
|
| 1000 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1001 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1002 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1003 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1004 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1005 | - * body: array, // (REQUIRED) The token request to get |
|
| 1006 | - * } $params |
|
| 1007 | - * |
|
| 1008 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1009 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1010 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1011 | - * |
|
| 1012 | - * @return Elasticsearch|Promise |
|
| 1013 | - */ |
|
| 1014 | - public function getToken(array $params = []) |
|
| 1015 | - { |
|
| 1016 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1017 | - $url = '/_security/oauth2/token'; |
|
| 1018 | - $method = 'POST'; |
|
| 1019 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1020 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1021 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1022 | - } |
|
| 1023 | - /** |
|
| 1024 | - * Retrieves information about users in the native realm and built-in users. |
|
| 1025 | - * |
|
| 1026 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html |
|
| 1027 | - * |
|
| 1028 | - * @param array{ |
|
| 1029 | - * username: list, // A comma-separated list of usernames |
|
| 1030 | - * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user |
|
| 1031 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1032 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1033 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1034 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1035 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1036 | - * } $params |
|
| 1037 | - * |
|
| 1038 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1039 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1040 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1041 | - * |
|
| 1042 | - * @return Elasticsearch|Promise |
|
| 1043 | - */ |
|
| 1044 | - public function getUser(array $params = []) |
|
| 1045 | - { |
|
| 1046 | - if (isset($params['username'])) { |
|
| 1047 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1048 | - $method = 'GET'; |
|
| 1049 | - } else { |
|
| 1050 | - $url = '/_security/user'; |
|
| 1051 | - $method = 'GET'; |
|
| 1052 | - } |
|
| 1053 | - $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1054 | - $headers = ['Accept' => 'application/json']; |
|
| 1055 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1056 | - } |
|
| 1057 | - /** |
|
| 1058 | - * Retrieves security privileges for the logged in user. |
|
| 1059 | - * |
|
| 1060 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html |
|
| 1061 | - * |
|
| 1062 | - * @param array{ |
|
| 1063 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1064 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1065 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1066 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1067 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1068 | - * } $params |
|
| 1069 | - * |
|
| 1070 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1071 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1072 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1073 | - * |
|
| 1074 | - * @return Elasticsearch|Promise |
|
| 1075 | - */ |
|
| 1076 | - public function getUserPrivileges(array $params = []) |
|
| 1077 | - { |
|
| 1078 | - $url = '/_security/user/_privileges'; |
|
| 1079 | - $method = 'GET'; |
|
| 1080 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1081 | - $headers = ['Accept' => 'application/json']; |
|
| 1082 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1083 | - } |
|
| 1084 | - /** |
|
| 1085 | - * Retrieves user profiles for the given unique ID(s). |
|
| 1086 | - * |
|
| 1087 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html |
|
| 1088 | - * |
|
| 1089 | - * @param array{ |
|
| 1090 | - * uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles |
|
| 1091 | - * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
| 1092 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1093 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1094 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1095 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1096 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1097 | - * } $params |
|
| 1098 | - * |
|
| 1099 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1100 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1101 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1102 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1103 | - * |
|
| 1104 | - * @return Elasticsearch|Promise |
|
| 1105 | - */ |
|
| 1106 | - public function getUserProfile(array $params = []) |
|
| 1107 | - { |
|
| 1108 | - $this->checkRequiredParameters(['uid'], $params); |
|
| 1109 | - $url = '/_security/profile/' . $this->encode($params['uid']); |
|
| 1110 | - $method = 'GET'; |
|
| 1111 | - $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1112 | - $headers = ['Accept' => 'application/json']; |
|
| 1113 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1114 | - } |
|
| 1115 | - /** |
|
| 1116 | - * Creates an API key on behalf of another user. |
|
| 1117 | - * |
|
| 1118 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html |
|
| 1119 | - * |
|
| 1120 | - * @param array{ |
|
| 1121 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1122 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1123 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1124 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1125 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1126 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1127 | - * body: array, // (REQUIRED) The api key request to create an API key |
|
| 1128 | - * } $params |
|
| 1129 | - * |
|
| 1130 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1131 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1132 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1133 | - * |
|
| 1134 | - * @return Elasticsearch|Promise |
|
| 1135 | - */ |
|
| 1136 | - public function grantApiKey(array $params = []) |
|
| 1137 | - { |
|
| 1138 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1139 | - $url = '/_security/api_key/grant'; |
|
| 1140 | - $method = 'POST'; |
|
| 1141 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1142 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1143 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1144 | - } |
|
| 1145 | - /** |
|
| 1146 | - * Determines whether the specified user has a specified list of privileges. |
|
| 1147 | - * |
|
| 1148 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html |
|
| 1149 | - * |
|
| 1150 | - * @param array{ |
|
| 1151 | - * user: string, // Username |
|
| 1152 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1153 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1154 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1155 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1156 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1157 | - * body: array, // (REQUIRED) The privileges to test |
|
| 1158 | - * } $params |
|
| 1159 | - * |
|
| 1160 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1161 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1162 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1163 | - * |
|
| 1164 | - * @return Elasticsearch|Promise |
|
| 1165 | - */ |
|
| 1166 | - public function hasPrivileges(array $params = []) |
|
| 1167 | - { |
|
| 1168 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1169 | - if (isset($params['user'])) { |
|
| 1170 | - $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
| 1171 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1172 | - } else { |
|
| 1173 | - $url = '/_security/user/_has_privileges'; |
|
| 1174 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1175 | - } |
|
| 1176 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1177 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1178 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1179 | - } |
|
| 1180 | - /** |
|
| 1181 | - * Determines whether the users associated with the specified profile IDs have all the requested privileges. |
|
| 1182 | - * |
|
| 1183 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html |
|
| 1184 | - * |
|
| 1185 | - * @param array{ |
|
| 1186 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1187 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1188 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1189 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1190 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1191 | - * body: array, // (REQUIRED) The privileges to check and the list of profile IDs |
|
| 1192 | - * } $params |
|
| 1193 | - * |
|
| 1194 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1195 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1196 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1197 | - * |
|
| 1198 | - * @return Elasticsearch|Promise |
|
| 1199 | - */ |
|
| 1200 | - public function hasPrivilegesUserProfile(array $params = []) |
|
| 1201 | - { |
|
| 1202 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1203 | - $url = '/_security/profile/_has_privileges'; |
|
| 1204 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1205 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1206 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1207 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1208 | - } |
|
| 1209 | - /** |
|
| 1210 | - * Invalidates one or more API keys. |
|
| 1211 | - * |
|
| 1212 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html |
|
| 1213 | - * |
|
| 1214 | - * @param array{ |
|
| 1215 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1216 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1217 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1218 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1219 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1220 | - * body: array, // (REQUIRED) The api key request to invalidate API key(s) |
|
| 1221 | - * } $params |
|
| 1222 | - * |
|
| 1223 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1224 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1225 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1226 | - * |
|
| 1227 | - * @return Elasticsearch|Promise |
|
| 1228 | - */ |
|
| 1229 | - public function invalidateApiKey(array $params = []) |
|
| 1230 | - { |
|
| 1231 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1232 | - $url = '/_security/api_key'; |
|
| 1233 | - $method = 'DELETE'; |
|
| 1234 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1235 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1236 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1237 | - } |
|
| 1238 | - /** |
|
| 1239 | - * Invalidates one or more access tokens or refresh tokens. |
|
| 1240 | - * |
|
| 1241 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html |
|
| 1242 | - * |
|
| 1243 | - * @param array{ |
|
| 1244 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1245 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1246 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1247 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1248 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1249 | - * body: array, // (REQUIRED) The token to invalidate |
|
| 1250 | - * } $params |
|
| 1251 | - * |
|
| 1252 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1253 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1254 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1255 | - * |
|
| 1256 | - * @return Elasticsearch|Promise |
|
| 1257 | - */ |
|
| 1258 | - public function invalidateToken(array $params = []) |
|
| 1259 | - { |
|
| 1260 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1261 | - $url = '/_security/oauth2/token'; |
|
| 1262 | - $method = 'DELETE'; |
|
| 1263 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1264 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1265 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1266 | - } |
|
| 1267 | - /** |
|
| 1268 | - * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair |
|
| 1269 | - * |
|
| 1270 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html |
|
| 1271 | - * |
|
| 1272 | - * @param array{ |
|
| 1273 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1274 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1275 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1276 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1277 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1278 | - * body: array, // (REQUIRED) The OpenID Connect response to authenticate |
|
| 1279 | - * } $params |
|
| 1280 | - * |
|
| 1281 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1282 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1283 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1284 | - * |
|
| 1285 | - * @return Elasticsearch|Promise |
|
| 1286 | - */ |
|
| 1287 | - public function oidcAuthenticate(array $params = []) |
|
| 1288 | - { |
|
| 1289 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1290 | - $url = '/_security/oidc/authenticate'; |
|
| 1291 | - $method = 'POST'; |
|
| 1292 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1293 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1294 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1295 | - } |
|
| 1296 | - /** |
|
| 1297 | - * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API |
|
| 1298 | - * |
|
| 1299 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html |
|
| 1300 | - * |
|
| 1301 | - * @param array{ |
|
| 1302 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1303 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1304 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1305 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1306 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1307 | - * body: array, // (REQUIRED) Access token and refresh token to invalidate |
|
| 1308 | - * } $params |
|
| 1309 | - * |
|
| 1310 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1311 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1312 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1313 | - * |
|
| 1314 | - * @return Elasticsearch|Promise |
|
| 1315 | - */ |
|
| 1316 | - public function oidcLogout(array $params = []) |
|
| 1317 | - { |
|
| 1318 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1319 | - $url = '/_security/oidc/logout'; |
|
| 1320 | - $method = 'POST'; |
|
| 1321 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1322 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1323 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1324 | - } |
|
| 1325 | - /** |
|
| 1326 | - * Creates an OAuth 2.0 authentication request as a URL string |
|
| 1327 | - * |
|
| 1328 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html |
|
| 1329 | - * |
|
| 1330 | - * @param array{ |
|
| 1331 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1332 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1333 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1334 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1335 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1336 | - * body: array, // (REQUIRED) The OpenID Connect authentication realm configuration |
|
| 1337 | - * } $params |
|
| 1338 | - * |
|
| 1339 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1340 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1341 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1342 | - * |
|
| 1343 | - * @return Elasticsearch|Promise |
|
| 1344 | - */ |
|
| 1345 | - public function oidcPrepareAuthentication(array $params = []) |
|
| 1346 | - { |
|
| 1347 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1348 | - $url = '/_security/oidc/prepare'; |
|
| 1349 | - $method = 'POST'; |
|
| 1350 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1351 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1352 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1353 | - } |
|
| 1354 | - /** |
|
| 1355 | - * Adds or updates application privileges. |
|
| 1356 | - * |
|
| 1357 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html |
|
| 1358 | - * |
|
| 1359 | - * @param array{ |
|
| 1360 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1361 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1362 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1363 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1364 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1365 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1366 | - * body: array, // (REQUIRED) The privilege(s) to add |
|
| 1367 | - * } $params |
|
| 1368 | - * |
|
| 1369 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1370 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1371 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1372 | - * |
|
| 1373 | - * @return Elasticsearch|Promise |
|
| 1374 | - */ |
|
| 1375 | - public function putPrivileges(array $params = []) |
|
| 1376 | - { |
|
| 1377 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1378 | - $url = '/_security/privilege/'; |
|
| 1379 | - $method = 'PUT'; |
|
| 1380 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1381 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1382 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1383 | - } |
|
| 1384 | - /** |
|
| 1385 | - * Adds and updates roles in the native realm. |
|
| 1386 | - * |
|
| 1387 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html |
|
| 1388 | - * |
|
| 1389 | - * @param array{ |
|
| 1390 | - * name: string, // (REQUIRED) Role name |
|
| 1391 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1392 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1393 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1394 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1395 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1396 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1397 | - * body: array, // (REQUIRED) The role to add |
|
| 1398 | - * } $params |
|
| 1399 | - * |
|
| 1400 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1401 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1402 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1403 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1404 | - * |
|
| 1405 | - * @return Elasticsearch|Promise |
|
| 1406 | - */ |
|
| 1407 | - public function putRole(array $params = []) |
|
| 1408 | - { |
|
| 1409 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1410 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 1411 | - $method = 'PUT'; |
|
| 1412 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1413 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1414 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1415 | - } |
|
| 1416 | - /** |
|
| 1417 | - * Creates and updates role mappings. |
|
| 1418 | - * |
|
| 1419 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html |
|
| 1420 | - * |
|
| 1421 | - * @param array{ |
|
| 1422 | - * name: string, // (REQUIRED) Role-mapping name |
|
| 1423 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1424 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1425 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1426 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1427 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1428 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1429 | - * body: array, // (REQUIRED) The role mapping to add |
|
| 1430 | - * } $params |
|
| 1431 | - * |
|
| 1432 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1433 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1434 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1435 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1436 | - * |
|
| 1437 | - * @return Elasticsearch|Promise |
|
| 1438 | - */ |
|
| 1439 | - public function putRoleMapping(array $params = []) |
|
| 1440 | - { |
|
| 1441 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1442 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 1443 | - $method = 'PUT'; |
|
| 1444 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1445 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1446 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1447 | - } |
|
| 1448 | - /** |
|
| 1449 | - * Adds and updates users in the native realm. These users are commonly referred to as native users. |
|
| 1450 | - * |
|
| 1451 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html |
|
| 1452 | - * |
|
| 1453 | - * @param array{ |
|
| 1454 | - * username: string, // (REQUIRED) The username of the User |
|
| 1455 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1456 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1457 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1458 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1459 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1460 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1461 | - * body: array, // (REQUIRED) The user to add |
|
| 1462 | - * } $params |
|
| 1463 | - * |
|
| 1464 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1465 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1466 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1467 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1468 | - * |
|
| 1469 | - * @return Elasticsearch|Promise |
|
| 1470 | - */ |
|
| 1471 | - public function putUser(array $params = []) |
|
| 1472 | - { |
|
| 1473 | - $this->checkRequiredParameters(['username', 'body'], $params); |
|
| 1474 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1475 | - $method = 'PUT'; |
|
| 1476 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1477 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1478 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1479 | - } |
|
| 1480 | - /** |
|
| 1481 | - * Retrieves information for API keys using a subset of query DSL |
|
| 1482 | - * |
|
| 1483 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html |
|
| 1484 | - * |
|
| 1485 | - * @param array{ |
|
| 1486 | - * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
| 1487 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1488 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1489 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1490 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1491 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1492 | - * body: array, // From, size, query, sort and search_after |
|
| 1493 | - * } $params |
|
| 1494 | - * |
|
| 1495 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1496 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1497 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1498 | - * |
|
| 1499 | - * @return Elasticsearch|Promise |
|
| 1500 | - */ |
|
| 1501 | - public function queryApiKeys(array $params = []) |
|
| 1502 | - { |
|
| 1503 | - $url = '/_security/_query/api_key'; |
|
| 1504 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1505 | - $url = $this->addQueryString($url, $params, ['with_limited_by', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1506 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1507 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1508 | - } |
|
| 1509 | - /** |
|
| 1510 | - * Retrieves information for Users using a subset of query DSL |
|
| 1511 | - * |
|
| 1512 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html |
|
| 1513 | - * |
|
| 1514 | - * @param array{ |
|
| 1515 | - * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user |
|
| 1516 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1517 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1518 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1519 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1520 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1521 | - * body: array, // From, size, query, sort and search_after |
|
| 1522 | - * } $params |
|
| 1523 | - * |
|
| 1524 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1525 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1526 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1527 | - * |
|
| 1528 | - * @return Elasticsearch|Promise |
|
| 1529 | - */ |
|
| 1530 | - public function queryUser(array $params = []) |
|
| 1531 | - { |
|
| 1532 | - $url = '/_security/_query/user'; |
|
| 1533 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1534 | - $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1535 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1536 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1537 | - } |
|
| 1538 | - /** |
|
| 1539 | - * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair |
|
| 1540 | - * |
|
| 1541 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html |
|
| 1542 | - * |
|
| 1543 | - * @param array{ |
|
| 1544 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1545 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1546 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1547 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1548 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1549 | - * body: array, // (REQUIRED) The SAML response to authenticate |
|
| 1550 | - * } $params |
|
| 1551 | - * |
|
| 1552 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1553 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1554 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1555 | - * |
|
| 1556 | - * @return Elasticsearch|Promise |
|
| 1557 | - */ |
|
| 1558 | - public function samlAuthenticate(array $params = []) |
|
| 1559 | - { |
|
| 1560 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1561 | - $url = '/_security/saml/authenticate'; |
|
| 1562 | - $method = 'POST'; |
|
| 1563 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1564 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1565 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1566 | - } |
|
| 1567 | - /** |
|
| 1568 | - * Verifies the logout response sent from the SAML IdP |
|
| 1569 | - * |
|
| 1570 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html |
|
| 1571 | - * |
|
| 1572 | - * @param array{ |
|
| 1573 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1574 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1575 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1576 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1577 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1578 | - * body: array, // (REQUIRED) The logout response to verify |
|
| 1579 | - * } $params |
|
| 1580 | - * |
|
| 1581 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1582 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1583 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1584 | - * |
|
| 1585 | - * @return Elasticsearch|Promise |
|
| 1586 | - */ |
|
| 1587 | - public function samlCompleteLogout(array $params = []) |
|
| 1588 | - { |
|
| 1589 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1590 | - $url = '/_security/saml/complete_logout'; |
|
| 1591 | - $method = 'POST'; |
|
| 1592 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1593 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1594 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1595 | - } |
|
| 1596 | - /** |
|
| 1597 | - * Consumes a SAML LogoutRequest |
|
| 1598 | - * |
|
| 1599 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html |
|
| 1600 | - * |
|
| 1601 | - * @param array{ |
|
| 1602 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1603 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1604 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1605 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1606 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1607 | - * body: array, // (REQUIRED) The LogoutRequest message |
|
| 1608 | - * } $params |
|
| 1609 | - * |
|
| 1610 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1611 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1612 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1613 | - * |
|
| 1614 | - * @return Elasticsearch|Promise |
|
| 1615 | - */ |
|
| 1616 | - public function samlInvalidate(array $params = []) |
|
| 1617 | - { |
|
| 1618 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1619 | - $url = '/_security/saml/invalidate'; |
|
| 1620 | - $method = 'POST'; |
|
| 1621 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1622 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1623 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1624 | - } |
|
| 1625 | - /** |
|
| 1626 | - * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API |
|
| 1627 | - * |
|
| 1628 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html |
|
| 1629 | - * |
|
| 1630 | - * @param array{ |
|
| 1631 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1632 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1633 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1634 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1635 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1636 | - * body: array, // (REQUIRED) The tokens to invalidate |
|
| 1637 | - * } $params |
|
| 1638 | - * |
|
| 1639 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1640 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1641 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1642 | - * |
|
| 1643 | - * @return Elasticsearch|Promise |
|
| 1644 | - */ |
|
| 1645 | - public function samlLogout(array $params = []) |
|
| 1646 | - { |
|
| 1647 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1648 | - $url = '/_security/saml/logout'; |
|
| 1649 | - $method = 'POST'; |
|
| 1650 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1651 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1652 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1653 | - } |
|
| 1654 | - /** |
|
| 1655 | - * Creates a SAML authentication request |
|
| 1656 | - * |
|
| 1657 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html |
|
| 1658 | - * |
|
| 1659 | - * @param array{ |
|
| 1660 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1661 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1662 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1663 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1664 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1665 | - * body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL |
|
| 1666 | - * } $params |
|
| 1667 | - * |
|
| 1668 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1669 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1670 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1671 | - * |
|
| 1672 | - * @return Elasticsearch|Promise |
|
| 1673 | - */ |
|
| 1674 | - public function samlPrepareAuthentication(array $params = []) |
|
| 1675 | - { |
|
| 1676 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1677 | - $url = '/_security/saml/prepare'; |
|
| 1678 | - $method = 'POST'; |
|
| 1679 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1680 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1681 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1682 | - } |
|
| 1683 | - /** |
|
| 1684 | - * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider |
|
| 1685 | - * |
|
| 1686 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html |
|
| 1687 | - * |
|
| 1688 | - * @param array{ |
|
| 1689 | - * realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for |
|
| 1690 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1691 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1692 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1693 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1694 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1695 | - * } $params |
|
| 1696 | - * |
|
| 1697 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1698 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1699 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1700 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1701 | - * |
|
| 1702 | - * @return Elasticsearch|Promise |
|
| 1703 | - */ |
|
| 1704 | - public function samlServiceProviderMetadata(array $params = []) |
|
| 1705 | - { |
|
| 1706 | - $this->checkRequiredParameters(['realm_name'], $params); |
|
| 1707 | - $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
| 1708 | - $method = 'GET'; |
|
| 1709 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1710 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1711 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1712 | - } |
|
| 1713 | - /** |
|
| 1714 | - * Get suggestions for user profiles that match specified search criteria. |
|
| 1715 | - * |
|
| 1716 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html |
|
| 1717 | - * |
|
| 1718 | - * @param array{ |
|
| 1719 | - * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
| 1720 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1721 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1722 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1723 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1724 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1725 | - * body: array, // The suggestion definition for user profiles |
|
| 1726 | - * } $params |
|
| 1727 | - * |
|
| 1728 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1729 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1730 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1731 | - * |
|
| 1732 | - * @return Elasticsearch|Promise |
|
| 1733 | - */ |
|
| 1734 | - public function suggestUserProfiles(array $params = []) |
|
| 1735 | - { |
|
| 1736 | - $url = '/_security/profile/_suggest'; |
|
| 1737 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1738 | - $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1739 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1740 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1741 | - } |
|
| 1742 | - /** |
|
| 1743 | - * Updates attributes of an existing API key. |
|
| 1744 | - * |
|
| 1745 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html |
|
| 1746 | - * |
|
| 1747 | - * @param array{ |
|
| 1748 | - * id: string, // (REQUIRED) The ID of the API key to update |
|
| 1749 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1750 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1751 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1752 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1753 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1754 | - * body: array, // The API key request to update attributes of an API key. |
|
| 1755 | - * } $params |
|
| 1756 | - * |
|
| 1757 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1758 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1759 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1760 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1761 | - * |
|
| 1762 | - * @return Elasticsearch|Promise |
|
| 1763 | - */ |
|
| 1764 | - public function updateApiKey(array $params = []) |
|
| 1765 | - { |
|
| 1766 | - $this->checkRequiredParameters(['id'], $params); |
|
| 1767 | - $url = '/_security/api_key/' . $this->encode($params['id']); |
|
| 1768 | - $method = 'PUT'; |
|
| 1769 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1770 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1771 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1772 | - } |
|
| 1773 | - /** |
|
| 1774 | - * Updates attributes of an existing cross-cluster API key. |
|
| 1775 | - * |
|
| 1776 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html |
|
| 1777 | - * |
|
| 1778 | - * @param array{ |
|
| 1779 | - * id: string, // (REQUIRED) The ID of the cross-cluster API key to update |
|
| 1780 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1781 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1782 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1783 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1784 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1785 | - * body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key. |
|
| 1786 | - * } $params |
|
| 1787 | - * |
|
| 1788 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1789 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1790 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1791 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1792 | - * |
|
| 1793 | - * @return Elasticsearch|Promise |
|
| 1794 | - */ |
|
| 1795 | - public function updateCrossClusterApiKey(array $params = []) |
|
| 1796 | - { |
|
| 1797 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 1798 | - $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
| 1799 | - $method = 'PUT'; |
|
| 1800 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1801 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1802 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1803 | - } |
|
| 1804 | - /** |
|
| 1805 | - * Update settings for the security system index |
|
| 1806 | - * |
|
| 1807 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html |
|
| 1808 | - * |
|
| 1809 | - * @param array{ |
|
| 1810 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1811 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1812 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1813 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1814 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1815 | - * body: array, // (REQUIRED) An object with the new settings for each index, if any |
|
| 1816 | - * } $params |
|
| 1817 | - * |
|
| 1818 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1819 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1820 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1821 | - * |
|
| 1822 | - * @return Elasticsearch|Promise |
|
| 1823 | - */ |
|
| 1824 | - public function updateSettings(array $params = []) |
|
| 1825 | - { |
|
| 1826 | - $this->checkRequiredParameters(['body'], $params); |
|
| 1827 | - $url = '/_security/settings'; |
|
| 1828 | - $method = 'PUT'; |
|
| 1829 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1830 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1831 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1832 | - } |
|
| 1833 | - /** |
|
| 1834 | - * Update application specific data for the user profile of the given unique ID. |
|
| 1835 | - * |
|
| 1836 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html |
|
| 1837 | - * |
|
| 1838 | - * @param array{ |
|
| 1839 | - * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
| 1840 | - * if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number |
|
| 1841 | - * if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term |
|
| 1842 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1843 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1844 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1845 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1846 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1847 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1848 | - * body: array, // (REQUIRED) The application data to update |
|
| 1849 | - * } $params |
|
| 1850 | - * |
|
| 1851 | - * @throws MissingParameterException if a required parameter is missing |
|
| 1852 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1853 | - * @throws ClientResponseException if the status code of response is 4xx |
|
| 1854 | - * @throws ServerResponseException if the status code of response is 5xx |
|
| 1855 | - * |
|
| 1856 | - * @return Elasticsearch|Promise |
|
| 1857 | - */ |
|
| 1858 | - public function updateUserProfileData(array $params = []) |
|
| 1859 | - { |
|
| 1860 | - $this->checkRequiredParameters(['uid', 'body'], $params); |
|
| 1861 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
| 1862 | - $method = 'PUT'; |
|
| 1863 | - $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1864 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1865 | - return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1866 | - } |
|
| 28 | + /** |
|
| 29 | + * Creates or updates the user profile on behalf of another user. |
|
| 30 | + * |
|
| 31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html |
|
| 32 | + * |
|
| 33 | + * @param array{ |
|
| 34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 39 | + * body: array, // (REQUIRED) The grant type and user's credential |
|
| 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 activateUserProfile(array $params = []) |
|
| 49 | + { |
|
| 50 | + $this->checkRequiredParameters(['body'], $params); |
|
| 51 | + $url = '/_security/profile/_activate'; |
|
| 52 | + $method = 'POST'; |
|
| 53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 55 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 56 | + } |
|
| 57 | + /** |
|
| 58 | + * Enables authentication as a user and retrieve information about the authenticated user. |
|
| 59 | + * |
|
| 60 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html |
|
| 61 | + * |
|
| 62 | + * @param array{ |
|
| 63 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 64 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 65 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 66 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 67 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 68 | + * } $params |
|
| 69 | + * |
|
| 70 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 71 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 72 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 73 | + * |
|
| 74 | + * @return Elasticsearch|Promise |
|
| 75 | + */ |
|
| 76 | + public function authenticate(array $params = []) |
|
| 77 | + { |
|
| 78 | + $url = '/_security/_authenticate'; |
|
| 79 | + $method = 'GET'; |
|
| 80 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 81 | + $headers = ['Accept' => 'application/json']; |
|
| 82 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 83 | + } |
|
| 84 | + /** |
|
| 85 | + * Updates the attributes of multiple existing API keys. |
|
| 86 | + * |
|
| 87 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html |
|
| 88 | + * |
|
| 89 | + * @param array{ |
|
| 90 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 91 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 92 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 93 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 94 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 95 | + * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys. |
|
| 96 | + * } $params |
|
| 97 | + * |
|
| 98 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 99 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 100 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 101 | + * |
|
| 102 | + * @return Elasticsearch|Promise |
|
| 103 | + */ |
|
| 104 | + public function bulkUpdateApiKeys(array $params = []) |
|
| 105 | + { |
|
| 106 | + $this->checkRequiredParameters(['body'], $params); |
|
| 107 | + $url = '/_security/api_key/_bulk_update'; |
|
| 108 | + $method = 'POST'; |
|
| 109 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 110 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 111 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 112 | + } |
|
| 113 | + /** |
|
| 114 | + * Changes the passwords of users in the native realm and built-in users. |
|
| 115 | + * |
|
| 116 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html |
|
| 117 | + * |
|
| 118 | + * @param array{ |
|
| 119 | + * username: string, // The username of the user to change the password for |
|
| 120 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 121 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 122 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 123 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 124 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 125 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 126 | + * body: array, // (REQUIRED) the new password for the user |
|
| 127 | + * } $params |
|
| 128 | + * |
|
| 129 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 130 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 131 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 132 | + * |
|
| 133 | + * @return Elasticsearch|Promise |
|
| 134 | + */ |
|
| 135 | + public function changePassword(array $params = []) |
|
| 136 | + { |
|
| 137 | + $this->checkRequiredParameters(['body'], $params); |
|
| 138 | + if (isset($params['username'])) { |
|
| 139 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
| 140 | + $method = 'PUT'; |
|
| 141 | + } else { |
|
| 142 | + $url = '/_security/user/_password'; |
|
| 143 | + $method = 'PUT'; |
|
| 144 | + } |
|
| 145 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 146 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 147 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 148 | + } |
|
| 149 | + /** |
|
| 150 | + * Clear a subset or all entries from the API key cache. |
|
| 151 | + * |
|
| 152 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html |
|
| 153 | + * |
|
| 154 | + * @param array{ |
|
| 155 | + * ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache |
|
| 156 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 157 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 158 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 159 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 160 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 161 | + * } $params |
|
| 162 | + * |
|
| 163 | + * @throws MissingParameterException if a required parameter is missing |
|
| 164 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 165 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 166 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 167 | + * |
|
| 168 | + * @return Elasticsearch|Promise |
|
| 169 | + */ |
|
| 170 | + public function clearApiKeyCache(array $params = []) |
|
| 171 | + { |
|
| 172 | + $this->checkRequiredParameters(['ids'], $params); |
|
| 173 | + $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
| 174 | + $method = 'POST'; |
|
| 175 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 176 | + $headers = ['Accept' => 'application/json']; |
|
| 177 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 178 | + } |
|
| 179 | + /** |
|
| 180 | + * Evicts application privileges from the native application privileges cache. |
|
| 181 | + * |
|
| 182 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html |
|
| 183 | + * |
|
| 184 | + * @param array{ |
|
| 185 | + * application: list, // (REQUIRED) A comma-separated list of application names |
|
| 186 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 187 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 188 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 189 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 190 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 191 | + * } $params |
|
| 192 | + * |
|
| 193 | + * @throws MissingParameterException if a required parameter is missing |
|
| 194 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 195 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 196 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 197 | + * |
|
| 198 | + * @return Elasticsearch|Promise |
|
| 199 | + */ |
|
| 200 | + public function clearCachedPrivileges(array $params = []) |
|
| 201 | + { |
|
| 202 | + $this->checkRequiredParameters(['application'], $params); |
|
| 203 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
| 204 | + $method = 'POST'; |
|
| 205 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 206 | + $headers = ['Accept' => 'application/json']; |
|
| 207 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 208 | + } |
|
| 209 | + /** |
|
| 210 | + * Evicts users from the user cache. Can completely clear the cache or evict specific users. |
|
| 211 | + * |
|
| 212 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html |
|
| 213 | + * |
|
| 214 | + * @param array{ |
|
| 215 | + * realms: list, // (REQUIRED) Comma-separated list of realms to clear |
|
| 216 | + * usernames: list, // Comma-separated list of usernames to clear from the cache |
|
| 217 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 218 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 219 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 220 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 221 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 222 | + * } $params |
|
| 223 | + * |
|
| 224 | + * @throws MissingParameterException if a required parameter is missing |
|
| 225 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 226 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 227 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 228 | + * |
|
| 229 | + * @return Elasticsearch|Promise |
|
| 230 | + */ |
|
| 231 | + public function clearCachedRealms(array $params = []) |
|
| 232 | + { |
|
| 233 | + $this->checkRequiredParameters(['realms'], $params); |
|
| 234 | + $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
| 235 | + $method = 'POST'; |
|
| 236 | + $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 237 | + $headers = ['Accept' => 'application/json']; |
|
| 238 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 239 | + } |
|
| 240 | + /** |
|
| 241 | + * Evicts roles from the native role cache. |
|
| 242 | + * |
|
| 243 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html |
|
| 244 | + * |
|
| 245 | + * @param array{ |
|
| 246 | + * name: list, // (REQUIRED) Role name |
|
| 247 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 248 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 249 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 250 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 251 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 252 | + * } $params |
|
| 253 | + * |
|
| 254 | + * @throws MissingParameterException if a required parameter is missing |
|
| 255 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 256 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 257 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 258 | + * |
|
| 259 | + * @return Elasticsearch|Promise |
|
| 260 | + */ |
|
| 261 | + public function clearCachedRoles(array $params = []) |
|
| 262 | + { |
|
| 263 | + $this->checkRequiredParameters(['name'], $params); |
|
| 264 | + $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 265 | + $method = 'POST'; |
|
| 266 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 267 | + $headers = ['Accept' => 'application/json']; |
|
| 268 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 269 | + } |
|
| 270 | + /** |
|
| 271 | + * Evicts tokens from the service account token caches. |
|
| 272 | + * |
|
| 273 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html |
|
| 274 | + * |
|
| 275 | + * @param array{ |
|
| 276 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 277 | + * service: string, // (REQUIRED) An identifier for the service name |
|
| 278 | + * name: list, // (REQUIRED) A comma-separated list of service token names |
|
| 279 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 280 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 281 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 282 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 283 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 284 | + * } $params |
|
| 285 | + * |
|
| 286 | + * @throws MissingParameterException if a required parameter is missing |
|
| 287 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 288 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 289 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 290 | + * |
|
| 291 | + * @return Elasticsearch|Promise |
|
| 292 | + */ |
|
| 293 | + public function clearCachedServiceTokens(array $params = []) |
|
| 294 | + { |
|
| 295 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 296 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 297 | + $method = 'POST'; |
|
| 298 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 299 | + $headers = ['Accept' => 'application/json']; |
|
| 300 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 301 | + } |
|
| 302 | + /** |
|
| 303 | + * Creates an API key for access without requiring basic authentication. |
|
| 304 | + * |
|
| 305 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
| 306 | + * |
|
| 307 | + * @param array{ |
|
| 308 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 309 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 310 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 311 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 312 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 313 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 314 | + * body: array, // (REQUIRED) The api key request to create an API key |
|
| 315 | + * } $params |
|
| 316 | + * |
|
| 317 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 318 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 319 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 320 | + * |
|
| 321 | + * @return Elasticsearch|Promise |
|
| 322 | + */ |
|
| 323 | + public function createApiKey(array $params = []) |
|
| 324 | + { |
|
| 325 | + $this->checkRequiredParameters(['body'], $params); |
|
| 326 | + $url = '/_security/api_key'; |
|
| 327 | + $method = 'PUT'; |
|
| 328 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 329 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 330 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 331 | + } |
|
| 332 | + /** |
|
| 333 | + * Creates a cross-cluster API key for API key based remote cluster access. |
|
| 334 | + * |
|
| 335 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html |
|
| 336 | + * |
|
| 337 | + * @param array{ |
|
| 338 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 339 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 340 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 341 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 342 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 343 | + * body: array, // (REQUIRED) The request to create a cross-cluster API key |
|
| 344 | + * } $params |
|
| 345 | + * |
|
| 346 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 347 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 348 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 349 | + * |
|
| 350 | + * @return Elasticsearch|Promise |
|
| 351 | + */ |
|
| 352 | + public function createCrossClusterApiKey(array $params = []) |
|
| 353 | + { |
|
| 354 | + $this->checkRequiredParameters(['body'], $params); |
|
| 355 | + $url = '/_security/cross_cluster/api_key'; |
|
| 356 | + $method = 'POST'; |
|
| 357 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 358 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 359 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 360 | + } |
|
| 361 | + /** |
|
| 362 | + * Creates a service account token for access without requiring basic authentication. |
|
| 363 | + * |
|
| 364 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html |
|
| 365 | + * |
|
| 366 | + * @param array{ |
|
| 367 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 368 | + * service: string, // (REQUIRED) An identifier for the service name |
|
| 369 | + * name: string, // An identifier for the token name |
|
| 370 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 371 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 372 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 373 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 374 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 375 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 376 | + * } $params |
|
| 377 | + * |
|
| 378 | + * @throws MissingParameterException if a required parameter is missing |
|
| 379 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 380 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 381 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 382 | + * |
|
| 383 | + * @return Elasticsearch|Promise |
|
| 384 | + */ |
|
| 385 | + public function createServiceToken(array $params = []) |
|
| 386 | + { |
|
| 387 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 388 | + if (isset($params['name'])) { |
|
| 389 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 390 | + $method = 'PUT'; |
|
| 391 | + } else { |
|
| 392 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
| 393 | + $method = 'POST'; |
|
| 394 | + } |
|
| 395 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 396 | + $headers = ['Accept' => 'application/json']; |
|
| 397 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 398 | + } |
|
| 399 | + /** |
|
| 400 | + * Removes application privileges. |
|
| 401 | + * |
|
| 402 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html |
|
| 403 | + * |
|
| 404 | + * @param array{ |
|
| 405 | + * application: string, // (REQUIRED) Application name |
|
| 406 | + * name: string, // (REQUIRED) Privilege name |
|
| 407 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 408 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 409 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 410 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 411 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 412 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 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 deletePrivileges(array $params = []) |
|
| 423 | + { |
|
| 424 | + $this->checkRequiredParameters(['application', 'name'], $params); |
|
| 425 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 426 | + $method = 'DELETE'; |
|
| 427 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 428 | + $headers = ['Accept' => 'application/json']; |
|
| 429 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 430 | + } |
|
| 431 | + /** |
|
| 432 | + * Removes roles in the native realm. |
|
| 433 | + * |
|
| 434 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html |
|
| 435 | + * |
|
| 436 | + * @param array{ |
|
| 437 | + * name: string, // (REQUIRED) Role name |
|
| 438 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 439 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 440 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 441 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 442 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 443 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 444 | + * } $params |
|
| 445 | + * |
|
| 446 | + * @throws MissingParameterException if a required parameter is missing |
|
| 447 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 448 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 449 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 450 | + * |
|
| 451 | + * @return Elasticsearch|Promise |
|
| 452 | + */ |
|
| 453 | + public function deleteRole(array $params = []) |
|
| 454 | + { |
|
| 455 | + $this->checkRequiredParameters(['name'], $params); |
|
| 456 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
| 457 | + $method = 'DELETE'; |
|
| 458 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 459 | + $headers = ['Accept' => 'application/json']; |
|
| 460 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 461 | + } |
|
| 462 | + /** |
|
| 463 | + * Removes role mappings. |
|
| 464 | + * |
|
| 465 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html |
|
| 466 | + * |
|
| 467 | + * @param array{ |
|
| 468 | + * name: string, // (REQUIRED) Role-mapping name |
|
| 469 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 470 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 471 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 472 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 473 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 474 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 475 | + * } $params |
|
| 476 | + * |
|
| 477 | + * @throws MissingParameterException if a required parameter is missing |
|
| 478 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 479 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 480 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 481 | + * |
|
| 482 | + * @return Elasticsearch|Promise |
|
| 483 | + */ |
|
| 484 | + public function deleteRoleMapping(array $params = []) |
|
| 485 | + { |
|
| 486 | + $this->checkRequiredParameters(['name'], $params); |
|
| 487 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 488 | + $method = 'DELETE'; |
|
| 489 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 490 | + $headers = ['Accept' => 'application/json']; |
|
| 491 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 492 | + } |
|
| 493 | + /** |
|
| 494 | + * Deletes a service account token. |
|
| 495 | + * |
|
| 496 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html |
|
| 497 | + * |
|
| 498 | + * @param array{ |
|
| 499 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 500 | + * service: string, // (REQUIRED) An identifier for the service name |
|
| 501 | + * name: string, // (REQUIRED) An identifier for the token name |
|
| 502 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 503 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 504 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 505 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 506 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 507 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 508 | + * } $params |
|
| 509 | + * |
|
| 510 | + * @throws MissingParameterException if a required parameter is missing |
|
| 511 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 512 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 513 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 514 | + * |
|
| 515 | + * @return Elasticsearch|Promise |
|
| 516 | + */ |
|
| 517 | + public function deleteServiceToken(array $params = []) |
|
| 518 | + { |
|
| 519 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
| 520 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 521 | + $method = 'DELETE'; |
|
| 522 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 523 | + $headers = ['Accept' => 'application/json']; |
|
| 524 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 525 | + } |
|
| 526 | + /** |
|
| 527 | + * Deletes users from the native realm. |
|
| 528 | + * |
|
| 529 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html |
|
| 530 | + * |
|
| 531 | + * @param array{ |
|
| 532 | + * username: string, // (REQUIRED) username |
|
| 533 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 534 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 535 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 536 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 537 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 538 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 539 | + * } $params |
|
| 540 | + * |
|
| 541 | + * @throws MissingParameterException if a required parameter is missing |
|
| 542 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 543 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 544 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 545 | + * |
|
| 546 | + * @return Elasticsearch|Promise |
|
| 547 | + */ |
|
| 548 | + public function deleteUser(array $params = []) |
|
| 549 | + { |
|
| 550 | + $this->checkRequiredParameters(['username'], $params); |
|
| 551 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
| 552 | + $method = 'DELETE'; |
|
| 553 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 554 | + $headers = ['Accept' => 'application/json']; |
|
| 555 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 556 | + } |
|
| 557 | + /** |
|
| 558 | + * Disables users in the native realm. |
|
| 559 | + * |
|
| 560 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html |
|
| 561 | + * |
|
| 562 | + * @param array{ |
|
| 563 | + * username: string, // (REQUIRED) The username of the user to disable |
|
| 564 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 565 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 566 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 567 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 568 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 569 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 570 | + * } $params |
|
| 571 | + * |
|
| 572 | + * @throws MissingParameterException if a required parameter is missing |
|
| 573 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 574 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 575 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 576 | + * |
|
| 577 | + * @return Elasticsearch|Promise |
|
| 578 | + */ |
|
| 579 | + public function disableUser(array $params = []) |
|
| 580 | + { |
|
| 581 | + $this->checkRequiredParameters(['username'], $params); |
|
| 582 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
| 583 | + $method = 'PUT'; |
|
| 584 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 585 | + $headers = ['Accept' => 'application/json']; |
|
| 586 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 587 | + } |
|
| 588 | + /** |
|
| 589 | + * Disables a user profile so it's not visible in user profile searches. |
|
| 590 | + * |
|
| 591 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html |
|
| 592 | + * |
|
| 593 | + * @param array{ |
|
| 594 | + * uid: string, // (REQUIRED) Unique identifier for the user profile |
|
| 595 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 596 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 597 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 598 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 599 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 600 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 601 | + * } $params |
|
| 602 | + * |
|
| 603 | + * @throws MissingParameterException if a required parameter is missing |
|
| 604 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 605 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 606 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 607 | + * |
|
| 608 | + * @return Elasticsearch|Promise |
|
| 609 | + */ |
|
| 610 | + public function disableUserProfile(array $params = []) |
|
| 611 | + { |
|
| 612 | + $this->checkRequiredParameters(['uid'], $params); |
|
| 613 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
| 614 | + $method = 'PUT'; |
|
| 615 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 616 | + $headers = ['Accept' => 'application/json']; |
|
| 617 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 618 | + } |
|
| 619 | + /** |
|
| 620 | + * Enables users in the native realm. |
|
| 621 | + * |
|
| 622 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html |
|
| 623 | + * |
|
| 624 | + * @param array{ |
|
| 625 | + * username: string, // (REQUIRED) The username of the user to enable |
|
| 626 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 627 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 628 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 629 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 630 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 631 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 632 | + * } $params |
|
| 633 | + * |
|
| 634 | + * @throws MissingParameterException if a required parameter is missing |
|
| 635 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 636 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 637 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 638 | + * |
|
| 639 | + * @return Elasticsearch|Promise |
|
| 640 | + */ |
|
| 641 | + public function enableUser(array $params = []) |
|
| 642 | + { |
|
| 643 | + $this->checkRequiredParameters(['username'], $params); |
|
| 644 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
| 645 | + $method = 'PUT'; |
|
| 646 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 647 | + $headers = ['Accept' => 'application/json']; |
|
| 648 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 649 | + } |
|
| 650 | + /** |
|
| 651 | + * Enables a user profile so it's visible in user profile searches. |
|
| 652 | + * |
|
| 653 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html |
|
| 654 | + * |
|
| 655 | + * @param array{ |
|
| 656 | + * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
| 657 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 658 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 659 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 660 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 661 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 662 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 663 | + * } $params |
|
| 664 | + * |
|
| 665 | + * @throws MissingParameterException if a required parameter is missing |
|
| 666 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 667 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 668 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 669 | + * |
|
| 670 | + * @return Elasticsearch|Promise |
|
| 671 | + */ |
|
| 672 | + public function enableUserProfile(array $params = []) |
|
| 673 | + { |
|
| 674 | + $this->checkRequiredParameters(['uid'], $params); |
|
| 675 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
| 676 | + $method = 'PUT'; |
|
| 677 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 678 | + $headers = ['Accept' => 'application/json']; |
|
| 679 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 680 | + } |
|
| 681 | + /** |
|
| 682 | + * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. |
|
| 683 | + * |
|
| 684 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html |
|
| 685 | + * |
|
| 686 | + * @param array{ |
|
| 687 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 688 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 689 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 690 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 691 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 692 | + * } $params |
|
| 693 | + * |
|
| 694 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 695 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 696 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 697 | + * |
|
| 698 | + * @return Elasticsearch|Promise |
|
| 699 | + */ |
|
| 700 | + public function enrollKibana(array $params = []) |
|
| 701 | + { |
|
| 702 | + $url = '/_security/enroll/kibana'; |
|
| 703 | + $method = 'GET'; |
|
| 704 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 705 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 706 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 707 | + } |
|
| 708 | + /** |
|
| 709 | + * Allows a new node to enroll to an existing cluster with security enabled. |
|
| 710 | + * |
|
| 711 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html |
|
| 712 | + * |
|
| 713 | + * @param array{ |
|
| 714 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 715 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 716 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 717 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 718 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 719 | + * } $params |
|
| 720 | + * |
|
| 721 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 722 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 723 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 724 | + * |
|
| 725 | + * @return Elasticsearch|Promise |
|
| 726 | + */ |
|
| 727 | + public function enrollNode(array $params = []) |
|
| 728 | + { |
|
| 729 | + $url = '/_security/enroll/node'; |
|
| 730 | + $method = 'GET'; |
|
| 731 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 732 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 733 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 734 | + } |
|
| 735 | + /** |
|
| 736 | + * Retrieves information for one or more API keys. |
|
| 737 | + * |
|
| 738 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html |
|
| 739 | + * |
|
| 740 | + * @param array{ |
|
| 741 | + * id: string, // API key id of the API key to be retrieved |
|
| 742 | + * name: string, // API key name of the API key to be retrieved |
|
| 743 | + * username: string, // user name of the user who created this API key to be retrieved |
|
| 744 | + * realm_name: string, // realm name of the user who created this API key to be retrieved |
|
| 745 | + * owner: boolean, // flag to query API keys owned by the currently authenticated user |
|
| 746 | + * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
| 747 | + * active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys |
|
| 748 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 749 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 750 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 751 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 752 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 753 | + * } $params |
|
| 754 | + * |
|
| 755 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 756 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 757 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 758 | + * |
|
| 759 | + * @return Elasticsearch|Promise |
|
| 760 | + */ |
|
| 761 | + public function getApiKey(array $params = []) |
|
| 762 | + { |
|
| 763 | + $url = '/_security/api_key'; |
|
| 764 | + $method = 'GET'; |
|
| 765 | + $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 766 | + $headers = ['Accept' => 'application/json']; |
|
| 767 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 768 | + } |
|
| 769 | + /** |
|
| 770 | + * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. |
|
| 771 | + * |
|
| 772 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html |
|
| 773 | + * |
|
| 774 | + * @param array{ |
|
| 775 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 776 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 777 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 778 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 779 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 780 | + * } $params |
|
| 781 | + * |
|
| 782 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 783 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 784 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 785 | + * |
|
| 786 | + * @return Elasticsearch|Promise |
|
| 787 | + */ |
|
| 788 | + public function getBuiltinPrivileges(array $params = []) |
|
| 789 | + { |
|
| 790 | + $url = '/_security/privilege/_builtin'; |
|
| 791 | + $method = 'GET'; |
|
| 792 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 793 | + $headers = ['Accept' => 'application/json']; |
|
| 794 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 795 | + } |
|
| 796 | + /** |
|
| 797 | + * Retrieves application privileges. |
|
| 798 | + * |
|
| 799 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html |
|
| 800 | + * |
|
| 801 | + * @param array{ |
|
| 802 | + * application: string, // Application name |
|
| 803 | + * name: string, // Privilege name |
|
| 804 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 805 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 806 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 807 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 808 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 809 | + * } $params |
|
| 810 | + * |
|
| 811 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 812 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 813 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 814 | + * |
|
| 815 | + * @return Elasticsearch|Promise |
|
| 816 | + */ |
|
| 817 | + public function getPrivileges(array $params = []) |
|
| 818 | + { |
|
| 819 | + if (isset($params['application']) && isset($params['name'])) { |
|
| 820 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 821 | + $method = 'GET'; |
|
| 822 | + } elseif (isset($params['application'])) { |
|
| 823 | + $url = '/_security/privilege/' . $this->encode($params['application']); |
|
| 824 | + $method = 'GET'; |
|
| 825 | + } else { |
|
| 826 | + $url = '/_security/privilege'; |
|
| 827 | + $method = 'GET'; |
|
| 828 | + } |
|
| 829 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 830 | + $headers = ['Accept' => 'application/json']; |
|
| 831 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 832 | + } |
|
| 833 | + /** |
|
| 834 | + * Retrieves roles in the native realm. |
|
| 835 | + * |
|
| 836 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html |
|
| 837 | + * |
|
| 838 | + * @param array{ |
|
| 839 | + * name: list, // A comma-separated list of role names |
|
| 840 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 841 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 842 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 843 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 844 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 845 | + * } $params |
|
| 846 | + * |
|
| 847 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 848 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 849 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 850 | + * |
|
| 851 | + * @return Elasticsearch|Promise |
|
| 852 | + */ |
|
| 853 | + public function getRole(array $params = []) |
|
| 854 | + { |
|
| 855 | + if (isset($params['name'])) { |
|
| 856 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
| 857 | + $method = 'GET'; |
|
| 858 | + } else { |
|
| 859 | + $url = '/_security/role'; |
|
| 860 | + $method = 'GET'; |
|
| 861 | + } |
|
| 862 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 863 | + $headers = ['Accept' => 'application/json']; |
|
| 864 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 865 | + } |
|
| 866 | + /** |
|
| 867 | + * Retrieves role mappings. |
|
| 868 | + * |
|
| 869 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html |
|
| 870 | + * |
|
| 871 | + * @param array{ |
|
| 872 | + * name: list, // A comma-separated list of role-mapping names |
|
| 873 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 874 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 875 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 876 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 877 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 878 | + * } $params |
|
| 879 | + * |
|
| 880 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 881 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 882 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 883 | + * |
|
| 884 | + * @return Elasticsearch|Promise |
|
| 885 | + */ |
|
| 886 | + public function getRoleMapping(array $params = []) |
|
| 887 | + { |
|
| 888 | + if (isset($params['name'])) { |
|
| 889 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 890 | + $method = 'GET'; |
|
| 891 | + } else { |
|
| 892 | + $url = '/_security/role_mapping'; |
|
| 893 | + $method = 'GET'; |
|
| 894 | + } |
|
| 895 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 896 | + $headers = ['Accept' => 'application/json']; |
|
| 897 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 898 | + } |
|
| 899 | + /** |
|
| 900 | + * Retrieves information about service accounts. |
|
| 901 | + * |
|
| 902 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html |
|
| 903 | + * |
|
| 904 | + * @param array{ |
|
| 905 | + * namespace: string, // An identifier for the namespace |
|
| 906 | + * service: string, // An identifier for the service name |
|
| 907 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 908 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 909 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 910 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 911 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 912 | + * } $params |
|
| 913 | + * |
|
| 914 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 915 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 916 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 917 | + * |
|
| 918 | + * @return Elasticsearch|Promise |
|
| 919 | + */ |
|
| 920 | + public function getServiceAccounts(array $params = []) |
|
| 921 | + { |
|
| 922 | + if (isset($params['namespace']) && isset($params['service'])) { |
|
| 923 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
| 924 | + $method = 'GET'; |
|
| 925 | + } elseif (isset($params['namespace'])) { |
|
| 926 | + $url = '/_security/service/' . $this->encode($params['namespace']); |
|
| 927 | + $method = 'GET'; |
|
| 928 | + } else { |
|
| 929 | + $url = '/_security/service'; |
|
| 930 | + $method = 'GET'; |
|
| 931 | + } |
|
| 932 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 933 | + $headers = ['Accept' => 'application/json']; |
|
| 934 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 935 | + } |
|
| 936 | + /** |
|
| 937 | + * Retrieves information of all service credentials for a service account. |
|
| 938 | + * |
|
| 939 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html |
|
| 940 | + * |
|
| 941 | + * @param array{ |
|
| 942 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
| 943 | + * service: string, // (REQUIRED) An identifier for the service name |
|
| 944 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 945 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 946 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 947 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 948 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 949 | + * } $params |
|
| 950 | + * |
|
| 951 | + * @throws MissingParameterException if a required parameter is missing |
|
| 952 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 953 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 954 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 955 | + * |
|
| 956 | + * @return Elasticsearch|Promise |
|
| 957 | + */ |
|
| 958 | + public function getServiceCredentials(array $params = []) |
|
| 959 | + { |
|
| 960 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
| 961 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
| 962 | + $method = 'GET'; |
|
| 963 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 964 | + $headers = ['Accept' => 'application/json']; |
|
| 965 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 966 | + } |
|
| 967 | + /** |
|
| 968 | + * Retrieve settings for the security system indices |
|
| 969 | + * |
|
| 970 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html |
|
| 971 | + * |
|
| 972 | + * @param array{ |
|
| 973 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 974 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 975 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 976 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 977 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 978 | + * } $params |
|
| 979 | + * |
|
| 980 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 981 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 982 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 983 | + * |
|
| 984 | + * @return Elasticsearch|Promise |
|
| 985 | + */ |
|
| 986 | + public function getSettings(array $params = []) |
|
| 987 | + { |
|
| 988 | + $url = '/_security/settings'; |
|
| 989 | + $method = 'GET'; |
|
| 990 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 991 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 992 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 993 | + } |
|
| 994 | + /** |
|
| 995 | + * Creates a bearer token for access without requiring basic authentication. |
|
| 996 | + * |
|
| 997 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html |
|
| 998 | + * |
|
| 999 | + * @param array{ |
|
| 1000 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1001 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1002 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1003 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1004 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1005 | + * body: array, // (REQUIRED) The token request to get |
|
| 1006 | + * } $params |
|
| 1007 | + * |
|
| 1008 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1009 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1010 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1011 | + * |
|
| 1012 | + * @return Elasticsearch|Promise |
|
| 1013 | + */ |
|
| 1014 | + public function getToken(array $params = []) |
|
| 1015 | + { |
|
| 1016 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1017 | + $url = '/_security/oauth2/token'; |
|
| 1018 | + $method = 'POST'; |
|
| 1019 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1020 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1021 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1022 | + } |
|
| 1023 | + /** |
|
| 1024 | + * Retrieves information about users in the native realm and built-in users. |
|
| 1025 | + * |
|
| 1026 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html |
|
| 1027 | + * |
|
| 1028 | + * @param array{ |
|
| 1029 | + * username: list, // A comma-separated list of usernames |
|
| 1030 | + * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user |
|
| 1031 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1032 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1033 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1034 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1035 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1036 | + * } $params |
|
| 1037 | + * |
|
| 1038 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1039 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1040 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1041 | + * |
|
| 1042 | + * @return Elasticsearch|Promise |
|
| 1043 | + */ |
|
| 1044 | + public function getUser(array $params = []) |
|
| 1045 | + { |
|
| 1046 | + if (isset($params['username'])) { |
|
| 1047 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1048 | + $method = 'GET'; |
|
| 1049 | + } else { |
|
| 1050 | + $url = '/_security/user'; |
|
| 1051 | + $method = 'GET'; |
|
| 1052 | + } |
|
| 1053 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1054 | + $headers = ['Accept' => 'application/json']; |
|
| 1055 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1056 | + } |
|
| 1057 | + /** |
|
| 1058 | + * Retrieves security privileges for the logged in user. |
|
| 1059 | + * |
|
| 1060 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html |
|
| 1061 | + * |
|
| 1062 | + * @param array{ |
|
| 1063 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1064 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1065 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1066 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1067 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1068 | + * } $params |
|
| 1069 | + * |
|
| 1070 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1071 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1072 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1073 | + * |
|
| 1074 | + * @return Elasticsearch|Promise |
|
| 1075 | + */ |
|
| 1076 | + public function getUserPrivileges(array $params = []) |
|
| 1077 | + { |
|
| 1078 | + $url = '/_security/user/_privileges'; |
|
| 1079 | + $method = 'GET'; |
|
| 1080 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1081 | + $headers = ['Accept' => 'application/json']; |
|
| 1082 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1083 | + } |
|
| 1084 | + /** |
|
| 1085 | + * Retrieves user profiles for the given unique ID(s). |
|
| 1086 | + * |
|
| 1087 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html |
|
| 1088 | + * |
|
| 1089 | + * @param array{ |
|
| 1090 | + * uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles |
|
| 1091 | + * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
| 1092 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1093 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1094 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1095 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1096 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1097 | + * } $params |
|
| 1098 | + * |
|
| 1099 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1100 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1101 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1102 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1103 | + * |
|
| 1104 | + * @return Elasticsearch|Promise |
|
| 1105 | + */ |
|
| 1106 | + public function getUserProfile(array $params = []) |
|
| 1107 | + { |
|
| 1108 | + $this->checkRequiredParameters(['uid'], $params); |
|
| 1109 | + $url = '/_security/profile/' . $this->encode($params['uid']); |
|
| 1110 | + $method = 'GET'; |
|
| 1111 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1112 | + $headers = ['Accept' => 'application/json']; |
|
| 1113 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1114 | + } |
|
| 1115 | + /** |
|
| 1116 | + * Creates an API key on behalf of another user. |
|
| 1117 | + * |
|
| 1118 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html |
|
| 1119 | + * |
|
| 1120 | + * @param array{ |
|
| 1121 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1122 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1123 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1124 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1125 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1126 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1127 | + * body: array, // (REQUIRED) The api key request to create an API key |
|
| 1128 | + * } $params |
|
| 1129 | + * |
|
| 1130 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1131 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1132 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1133 | + * |
|
| 1134 | + * @return Elasticsearch|Promise |
|
| 1135 | + */ |
|
| 1136 | + public function grantApiKey(array $params = []) |
|
| 1137 | + { |
|
| 1138 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1139 | + $url = '/_security/api_key/grant'; |
|
| 1140 | + $method = 'POST'; |
|
| 1141 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1142 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1143 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1144 | + } |
|
| 1145 | + /** |
|
| 1146 | + * Determines whether the specified user has a specified list of privileges. |
|
| 1147 | + * |
|
| 1148 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html |
|
| 1149 | + * |
|
| 1150 | + * @param array{ |
|
| 1151 | + * user: string, // Username |
|
| 1152 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1153 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1154 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1155 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1156 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1157 | + * body: array, // (REQUIRED) The privileges to test |
|
| 1158 | + * } $params |
|
| 1159 | + * |
|
| 1160 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1161 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1162 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1163 | + * |
|
| 1164 | + * @return Elasticsearch|Promise |
|
| 1165 | + */ |
|
| 1166 | + public function hasPrivileges(array $params = []) |
|
| 1167 | + { |
|
| 1168 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1169 | + if (isset($params['user'])) { |
|
| 1170 | + $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
| 1171 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1172 | + } else { |
|
| 1173 | + $url = '/_security/user/_has_privileges'; |
|
| 1174 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1175 | + } |
|
| 1176 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1177 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1178 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1179 | + } |
|
| 1180 | + /** |
|
| 1181 | + * Determines whether the users associated with the specified profile IDs have all the requested privileges. |
|
| 1182 | + * |
|
| 1183 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html |
|
| 1184 | + * |
|
| 1185 | + * @param array{ |
|
| 1186 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1187 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1188 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1189 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1190 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1191 | + * body: array, // (REQUIRED) The privileges to check and the list of profile IDs |
|
| 1192 | + * } $params |
|
| 1193 | + * |
|
| 1194 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1195 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1196 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1197 | + * |
|
| 1198 | + * @return Elasticsearch|Promise |
|
| 1199 | + */ |
|
| 1200 | + public function hasPrivilegesUserProfile(array $params = []) |
|
| 1201 | + { |
|
| 1202 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1203 | + $url = '/_security/profile/_has_privileges'; |
|
| 1204 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1205 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1206 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1207 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1208 | + } |
|
| 1209 | + /** |
|
| 1210 | + * Invalidates one or more API keys. |
|
| 1211 | + * |
|
| 1212 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html |
|
| 1213 | + * |
|
| 1214 | + * @param array{ |
|
| 1215 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1216 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1217 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1218 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1219 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1220 | + * body: array, // (REQUIRED) The api key request to invalidate API key(s) |
|
| 1221 | + * } $params |
|
| 1222 | + * |
|
| 1223 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1224 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1225 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1226 | + * |
|
| 1227 | + * @return Elasticsearch|Promise |
|
| 1228 | + */ |
|
| 1229 | + public function invalidateApiKey(array $params = []) |
|
| 1230 | + { |
|
| 1231 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1232 | + $url = '/_security/api_key'; |
|
| 1233 | + $method = 'DELETE'; |
|
| 1234 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1235 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1236 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1237 | + } |
|
| 1238 | + /** |
|
| 1239 | + * Invalidates one or more access tokens or refresh tokens. |
|
| 1240 | + * |
|
| 1241 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html |
|
| 1242 | + * |
|
| 1243 | + * @param array{ |
|
| 1244 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1245 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1246 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1247 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1248 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1249 | + * body: array, // (REQUIRED) The token to invalidate |
|
| 1250 | + * } $params |
|
| 1251 | + * |
|
| 1252 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1253 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1254 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1255 | + * |
|
| 1256 | + * @return Elasticsearch|Promise |
|
| 1257 | + */ |
|
| 1258 | + public function invalidateToken(array $params = []) |
|
| 1259 | + { |
|
| 1260 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1261 | + $url = '/_security/oauth2/token'; |
|
| 1262 | + $method = 'DELETE'; |
|
| 1263 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1264 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1265 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1266 | + } |
|
| 1267 | + /** |
|
| 1268 | + * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair |
|
| 1269 | + * |
|
| 1270 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html |
|
| 1271 | + * |
|
| 1272 | + * @param array{ |
|
| 1273 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1274 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1275 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1276 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1277 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1278 | + * body: array, // (REQUIRED) The OpenID Connect response to authenticate |
|
| 1279 | + * } $params |
|
| 1280 | + * |
|
| 1281 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1282 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1283 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1284 | + * |
|
| 1285 | + * @return Elasticsearch|Promise |
|
| 1286 | + */ |
|
| 1287 | + public function oidcAuthenticate(array $params = []) |
|
| 1288 | + { |
|
| 1289 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1290 | + $url = '/_security/oidc/authenticate'; |
|
| 1291 | + $method = 'POST'; |
|
| 1292 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1293 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1294 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1295 | + } |
|
| 1296 | + /** |
|
| 1297 | + * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API |
|
| 1298 | + * |
|
| 1299 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html |
|
| 1300 | + * |
|
| 1301 | + * @param array{ |
|
| 1302 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1303 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1304 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1305 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1306 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1307 | + * body: array, // (REQUIRED) Access token and refresh token to invalidate |
|
| 1308 | + * } $params |
|
| 1309 | + * |
|
| 1310 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1311 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1312 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1313 | + * |
|
| 1314 | + * @return Elasticsearch|Promise |
|
| 1315 | + */ |
|
| 1316 | + public function oidcLogout(array $params = []) |
|
| 1317 | + { |
|
| 1318 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1319 | + $url = '/_security/oidc/logout'; |
|
| 1320 | + $method = 'POST'; |
|
| 1321 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1322 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1323 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1324 | + } |
|
| 1325 | + /** |
|
| 1326 | + * Creates an OAuth 2.0 authentication request as a URL string |
|
| 1327 | + * |
|
| 1328 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html |
|
| 1329 | + * |
|
| 1330 | + * @param array{ |
|
| 1331 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1332 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1333 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1334 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1335 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1336 | + * body: array, // (REQUIRED) The OpenID Connect authentication realm configuration |
|
| 1337 | + * } $params |
|
| 1338 | + * |
|
| 1339 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1340 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1341 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1342 | + * |
|
| 1343 | + * @return Elasticsearch|Promise |
|
| 1344 | + */ |
|
| 1345 | + public function oidcPrepareAuthentication(array $params = []) |
|
| 1346 | + { |
|
| 1347 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1348 | + $url = '/_security/oidc/prepare'; |
|
| 1349 | + $method = 'POST'; |
|
| 1350 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1351 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1352 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1353 | + } |
|
| 1354 | + /** |
|
| 1355 | + * Adds or updates application privileges. |
|
| 1356 | + * |
|
| 1357 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html |
|
| 1358 | + * |
|
| 1359 | + * @param array{ |
|
| 1360 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1361 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1362 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1363 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1364 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1365 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1366 | + * body: array, // (REQUIRED) The privilege(s) to add |
|
| 1367 | + * } $params |
|
| 1368 | + * |
|
| 1369 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1370 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1371 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1372 | + * |
|
| 1373 | + * @return Elasticsearch|Promise |
|
| 1374 | + */ |
|
| 1375 | + public function putPrivileges(array $params = []) |
|
| 1376 | + { |
|
| 1377 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1378 | + $url = '/_security/privilege/'; |
|
| 1379 | + $method = 'PUT'; |
|
| 1380 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1381 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1382 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1383 | + } |
|
| 1384 | + /** |
|
| 1385 | + * Adds and updates roles in the native realm. |
|
| 1386 | + * |
|
| 1387 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html |
|
| 1388 | + * |
|
| 1389 | + * @param array{ |
|
| 1390 | + * name: string, // (REQUIRED) Role name |
|
| 1391 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1392 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1393 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1394 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1395 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1396 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1397 | + * body: array, // (REQUIRED) The role to add |
|
| 1398 | + * } $params |
|
| 1399 | + * |
|
| 1400 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1401 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1402 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1403 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1404 | + * |
|
| 1405 | + * @return Elasticsearch|Promise |
|
| 1406 | + */ |
|
| 1407 | + public function putRole(array $params = []) |
|
| 1408 | + { |
|
| 1409 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1410 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
| 1411 | + $method = 'PUT'; |
|
| 1412 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1413 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1414 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1415 | + } |
|
| 1416 | + /** |
|
| 1417 | + * Creates and updates role mappings. |
|
| 1418 | + * |
|
| 1419 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html |
|
| 1420 | + * |
|
| 1421 | + * @param array{ |
|
| 1422 | + * name: string, // (REQUIRED) Role-mapping name |
|
| 1423 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1424 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1425 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1426 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1427 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1428 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1429 | + * body: array, // (REQUIRED) The role mapping to add |
|
| 1430 | + * } $params |
|
| 1431 | + * |
|
| 1432 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1433 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1434 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1435 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1436 | + * |
|
| 1437 | + * @return Elasticsearch|Promise |
|
| 1438 | + */ |
|
| 1439 | + public function putRoleMapping(array $params = []) |
|
| 1440 | + { |
|
| 1441 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
| 1442 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 1443 | + $method = 'PUT'; |
|
| 1444 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1445 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1446 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1447 | + } |
|
| 1448 | + /** |
|
| 1449 | + * Adds and updates users in the native realm. These users are commonly referred to as native users. |
|
| 1450 | + * |
|
| 1451 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html |
|
| 1452 | + * |
|
| 1453 | + * @param array{ |
|
| 1454 | + * username: string, // (REQUIRED) The username of the User |
|
| 1455 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1456 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1457 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1458 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1459 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1460 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1461 | + * body: array, // (REQUIRED) The user to add |
|
| 1462 | + * } $params |
|
| 1463 | + * |
|
| 1464 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1465 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1466 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1467 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1468 | + * |
|
| 1469 | + * @return Elasticsearch|Promise |
|
| 1470 | + */ |
|
| 1471 | + public function putUser(array $params = []) |
|
| 1472 | + { |
|
| 1473 | + $this->checkRequiredParameters(['username', 'body'], $params); |
|
| 1474 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1475 | + $method = 'PUT'; |
|
| 1476 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1477 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1478 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1479 | + } |
|
| 1480 | + /** |
|
| 1481 | + * Retrieves information for API keys using a subset of query DSL |
|
| 1482 | + * |
|
| 1483 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html |
|
| 1484 | + * |
|
| 1485 | + * @param array{ |
|
| 1486 | + * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
| 1487 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1488 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1489 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1490 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1491 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1492 | + * body: array, // From, size, query, sort and search_after |
|
| 1493 | + * } $params |
|
| 1494 | + * |
|
| 1495 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1496 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1497 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1498 | + * |
|
| 1499 | + * @return Elasticsearch|Promise |
|
| 1500 | + */ |
|
| 1501 | + public function queryApiKeys(array $params = []) |
|
| 1502 | + { |
|
| 1503 | + $url = '/_security/_query/api_key'; |
|
| 1504 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1505 | + $url = $this->addQueryString($url, $params, ['with_limited_by', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1506 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1507 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1508 | + } |
|
| 1509 | + /** |
|
| 1510 | + * Retrieves information for Users using a subset of query DSL |
|
| 1511 | + * |
|
| 1512 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html |
|
| 1513 | + * |
|
| 1514 | + * @param array{ |
|
| 1515 | + * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user |
|
| 1516 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1517 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1518 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1519 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1520 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1521 | + * body: array, // From, size, query, sort and search_after |
|
| 1522 | + * } $params |
|
| 1523 | + * |
|
| 1524 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1525 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1526 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1527 | + * |
|
| 1528 | + * @return Elasticsearch|Promise |
|
| 1529 | + */ |
|
| 1530 | + public function queryUser(array $params = []) |
|
| 1531 | + { |
|
| 1532 | + $url = '/_security/_query/user'; |
|
| 1533 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1534 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1535 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1536 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1537 | + } |
|
| 1538 | + /** |
|
| 1539 | + * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair |
|
| 1540 | + * |
|
| 1541 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html |
|
| 1542 | + * |
|
| 1543 | + * @param array{ |
|
| 1544 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1545 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1546 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1547 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1548 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1549 | + * body: array, // (REQUIRED) The SAML response to authenticate |
|
| 1550 | + * } $params |
|
| 1551 | + * |
|
| 1552 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1553 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1554 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1555 | + * |
|
| 1556 | + * @return Elasticsearch|Promise |
|
| 1557 | + */ |
|
| 1558 | + public function samlAuthenticate(array $params = []) |
|
| 1559 | + { |
|
| 1560 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1561 | + $url = '/_security/saml/authenticate'; |
|
| 1562 | + $method = 'POST'; |
|
| 1563 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1564 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1565 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1566 | + } |
|
| 1567 | + /** |
|
| 1568 | + * Verifies the logout response sent from the SAML IdP |
|
| 1569 | + * |
|
| 1570 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html |
|
| 1571 | + * |
|
| 1572 | + * @param array{ |
|
| 1573 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1574 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1575 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1576 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1577 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1578 | + * body: array, // (REQUIRED) The logout response to verify |
|
| 1579 | + * } $params |
|
| 1580 | + * |
|
| 1581 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1582 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1583 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1584 | + * |
|
| 1585 | + * @return Elasticsearch|Promise |
|
| 1586 | + */ |
|
| 1587 | + public function samlCompleteLogout(array $params = []) |
|
| 1588 | + { |
|
| 1589 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1590 | + $url = '/_security/saml/complete_logout'; |
|
| 1591 | + $method = 'POST'; |
|
| 1592 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1593 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1594 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1595 | + } |
|
| 1596 | + /** |
|
| 1597 | + * Consumes a SAML LogoutRequest |
|
| 1598 | + * |
|
| 1599 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html |
|
| 1600 | + * |
|
| 1601 | + * @param array{ |
|
| 1602 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1603 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1604 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1605 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1606 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1607 | + * body: array, // (REQUIRED) The LogoutRequest message |
|
| 1608 | + * } $params |
|
| 1609 | + * |
|
| 1610 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1611 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1612 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1613 | + * |
|
| 1614 | + * @return Elasticsearch|Promise |
|
| 1615 | + */ |
|
| 1616 | + public function samlInvalidate(array $params = []) |
|
| 1617 | + { |
|
| 1618 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1619 | + $url = '/_security/saml/invalidate'; |
|
| 1620 | + $method = 'POST'; |
|
| 1621 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1622 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1623 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1624 | + } |
|
| 1625 | + /** |
|
| 1626 | + * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API |
|
| 1627 | + * |
|
| 1628 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html |
|
| 1629 | + * |
|
| 1630 | + * @param array{ |
|
| 1631 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1632 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1633 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1634 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1635 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1636 | + * body: array, // (REQUIRED) The tokens to invalidate |
|
| 1637 | + * } $params |
|
| 1638 | + * |
|
| 1639 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1640 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1641 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1642 | + * |
|
| 1643 | + * @return Elasticsearch|Promise |
|
| 1644 | + */ |
|
| 1645 | + public function samlLogout(array $params = []) |
|
| 1646 | + { |
|
| 1647 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1648 | + $url = '/_security/saml/logout'; |
|
| 1649 | + $method = 'POST'; |
|
| 1650 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1651 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1652 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1653 | + } |
|
| 1654 | + /** |
|
| 1655 | + * Creates a SAML authentication request |
|
| 1656 | + * |
|
| 1657 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html |
|
| 1658 | + * |
|
| 1659 | + * @param array{ |
|
| 1660 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1661 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1662 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1663 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1664 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1665 | + * body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL |
|
| 1666 | + * } $params |
|
| 1667 | + * |
|
| 1668 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1669 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1670 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1671 | + * |
|
| 1672 | + * @return Elasticsearch|Promise |
|
| 1673 | + */ |
|
| 1674 | + public function samlPrepareAuthentication(array $params = []) |
|
| 1675 | + { |
|
| 1676 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1677 | + $url = '/_security/saml/prepare'; |
|
| 1678 | + $method = 'POST'; |
|
| 1679 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1680 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1681 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1682 | + } |
|
| 1683 | + /** |
|
| 1684 | + * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider |
|
| 1685 | + * |
|
| 1686 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html |
|
| 1687 | + * |
|
| 1688 | + * @param array{ |
|
| 1689 | + * realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for |
|
| 1690 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1691 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1692 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1693 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1694 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1695 | + * } $params |
|
| 1696 | + * |
|
| 1697 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1698 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1699 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1700 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1701 | + * |
|
| 1702 | + * @return Elasticsearch|Promise |
|
| 1703 | + */ |
|
| 1704 | + public function samlServiceProviderMetadata(array $params = []) |
|
| 1705 | + { |
|
| 1706 | + $this->checkRequiredParameters(['realm_name'], $params); |
|
| 1707 | + $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
| 1708 | + $method = 'GET'; |
|
| 1709 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1710 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1711 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1712 | + } |
|
| 1713 | + /** |
|
| 1714 | + * Get suggestions for user profiles that match specified search criteria. |
|
| 1715 | + * |
|
| 1716 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html |
|
| 1717 | + * |
|
| 1718 | + * @param array{ |
|
| 1719 | + * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
| 1720 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1721 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1722 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1723 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1724 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1725 | + * body: array, // The suggestion definition for user profiles |
|
| 1726 | + * } $params |
|
| 1727 | + * |
|
| 1728 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1729 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1730 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1731 | + * |
|
| 1732 | + * @return Elasticsearch|Promise |
|
| 1733 | + */ |
|
| 1734 | + public function suggestUserProfiles(array $params = []) |
|
| 1735 | + { |
|
| 1736 | + $url = '/_security/profile/_suggest'; |
|
| 1737 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
| 1738 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1739 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1740 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1741 | + } |
|
| 1742 | + /** |
|
| 1743 | + * Updates attributes of an existing API key. |
|
| 1744 | + * |
|
| 1745 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html |
|
| 1746 | + * |
|
| 1747 | + * @param array{ |
|
| 1748 | + * id: string, // (REQUIRED) The ID of the API key to update |
|
| 1749 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1750 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1751 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1752 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1753 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1754 | + * body: array, // The API key request to update attributes of an API key. |
|
| 1755 | + * } $params |
|
| 1756 | + * |
|
| 1757 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1758 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1759 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1760 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1761 | + * |
|
| 1762 | + * @return Elasticsearch|Promise |
|
| 1763 | + */ |
|
| 1764 | + public function updateApiKey(array $params = []) |
|
| 1765 | + { |
|
| 1766 | + $this->checkRequiredParameters(['id'], $params); |
|
| 1767 | + $url = '/_security/api_key/' . $this->encode($params['id']); |
|
| 1768 | + $method = 'PUT'; |
|
| 1769 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1770 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1771 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1772 | + } |
|
| 1773 | + /** |
|
| 1774 | + * Updates attributes of an existing cross-cluster API key. |
|
| 1775 | + * |
|
| 1776 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html |
|
| 1777 | + * |
|
| 1778 | + * @param array{ |
|
| 1779 | + * id: string, // (REQUIRED) The ID of the cross-cluster API key to update |
|
| 1780 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1781 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1782 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1783 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1784 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1785 | + * body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key. |
|
| 1786 | + * } $params |
|
| 1787 | + * |
|
| 1788 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1789 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1790 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1791 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1792 | + * |
|
| 1793 | + * @return Elasticsearch|Promise |
|
| 1794 | + */ |
|
| 1795 | + public function updateCrossClusterApiKey(array $params = []) |
|
| 1796 | + { |
|
| 1797 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
| 1798 | + $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
| 1799 | + $method = 'PUT'; |
|
| 1800 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1801 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1802 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1803 | + } |
|
| 1804 | + /** |
|
| 1805 | + * Update settings for the security system index |
|
| 1806 | + * |
|
| 1807 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html |
|
| 1808 | + * |
|
| 1809 | + * @param array{ |
|
| 1810 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1811 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1812 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1813 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1814 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1815 | + * body: array, // (REQUIRED) An object with the new settings for each index, if any |
|
| 1816 | + * } $params |
|
| 1817 | + * |
|
| 1818 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1819 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1820 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1821 | + * |
|
| 1822 | + * @return Elasticsearch|Promise |
|
| 1823 | + */ |
|
| 1824 | + public function updateSettings(array $params = []) |
|
| 1825 | + { |
|
| 1826 | + $this->checkRequiredParameters(['body'], $params); |
|
| 1827 | + $url = '/_security/settings'; |
|
| 1828 | + $method = 'PUT'; |
|
| 1829 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1830 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1831 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1832 | + } |
|
| 1833 | + /** |
|
| 1834 | + * Update application specific data for the user profile of the given unique ID. |
|
| 1835 | + * |
|
| 1836 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html |
|
| 1837 | + * |
|
| 1838 | + * @param array{ |
|
| 1839 | + * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
| 1840 | + * if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number |
|
| 1841 | + * if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term |
|
| 1842 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
| 1843 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
| 1844 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
| 1845 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
| 1846 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
| 1847 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
| 1848 | + * body: array, // (REQUIRED) The application data to update |
|
| 1849 | + * } $params |
|
| 1850 | + * |
|
| 1851 | + * @throws MissingParameterException if a required parameter is missing |
|
| 1852 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
| 1853 | + * @throws ClientResponseException if the status code of response is 4xx |
|
| 1854 | + * @throws ServerResponseException if the status code of response is 5xx |
|
| 1855 | + * |
|
| 1856 | + * @return Elasticsearch|Promise |
|
| 1857 | + */ |
|
| 1858 | + public function updateUserProfileData(array $params = []) |
|
| 1859 | + { |
|
| 1860 | + $this->checkRequiredParameters(['uid', 'body'], $params); |
|
| 1861 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
| 1862 | + $method = 'PUT'; |
|
| 1863 | + $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
| 1864 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
| 1865 | + return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); |
|
| 1866 | + } |
|
| 1867 | 1867 | } |
@@ -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; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $this->checkRequiredParameters(['body'], $params); |
| 138 | 138 | if (isset($params['username'])) { |
| 139 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
| 139 | + $url = '/_security/user/'.$this->encode($params['username']).'/_password'; |
|
| 140 | 140 | $method = 'PUT'; |
| 141 | 141 | } else { |
| 142 | 142 | $url = '/_security/user/_password'; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function clearApiKeyCache(array $params = []) |
| 171 | 171 | { |
| 172 | 172 | $this->checkRequiredParameters(['ids'], $params); |
| 173 | - $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
| 173 | + $url = '/_security/api_key/'.$this->encode($params['ids']).'/_clear_cache'; |
|
| 174 | 174 | $method = 'POST'; |
| 175 | 175 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 176 | 176 | $headers = ['Accept' => 'application/json']; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | public function clearCachedPrivileges(array $params = []) |
| 201 | 201 | { |
| 202 | 202 | $this->checkRequiredParameters(['application'], $params); |
| 203 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
| 203 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/_clear_cache'; |
|
| 204 | 204 | $method = 'POST'; |
| 205 | 205 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 206 | 206 | $headers = ['Accept' => 'application/json']; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | public function clearCachedRealms(array $params = []) |
| 232 | 232 | { |
| 233 | 233 | $this->checkRequiredParameters(['realms'], $params); |
| 234 | - $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
| 234 | + $url = '/_security/realm/'.$this->encode($params['realms']).'/_clear_cache'; |
|
| 235 | 235 | $method = 'POST'; |
| 236 | 236 | $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 237 | 237 | $headers = ['Accept' => 'application/json']; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | public function clearCachedRoles(array $params = []) |
| 262 | 262 | { |
| 263 | 263 | $this->checkRequiredParameters(['name'], $params); |
| 264 | - $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 264 | + $url = '/_security/role/'.$this->encode($params['name']).'/_clear_cache'; |
|
| 265 | 265 | $method = 'POST'; |
| 266 | 266 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 267 | 267 | $headers = ['Accept' => 'application/json']; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | public function clearCachedServiceTokens(array $params = []) |
| 294 | 294 | { |
| 295 | 295 | $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
| 296 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
| 296 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']).'/_clear_cache'; |
|
| 297 | 297 | $method = 'POST'; |
| 298 | 298 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 299 | 299 | $headers = ['Accept' => 'application/json']; |
@@ -386,10 +386,10 @@ discard block |
||
| 386 | 386 | { |
| 387 | 387 | $this->checkRequiredParameters(['namespace', 'service'], $params); |
| 388 | 388 | if (isset($params['name'])) { |
| 389 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 389 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']); |
|
| 390 | 390 | $method = 'PUT'; |
| 391 | 391 | } else { |
| 392 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
| 392 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token'; |
|
| 393 | 393 | $method = 'POST'; |
| 394 | 394 | } |
| 395 | 395 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | public function deletePrivileges(array $params = []) |
| 423 | 423 | { |
| 424 | 424 | $this->checkRequiredParameters(['application', 'name'], $params); |
| 425 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 425 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']); |
|
| 426 | 426 | $method = 'DELETE'; |
| 427 | 427 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 428 | 428 | $headers = ['Accept' => 'application/json']; |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | public function deleteRole(array $params = []) |
| 454 | 454 | { |
| 455 | 455 | $this->checkRequiredParameters(['name'], $params); |
| 456 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 456 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 457 | 457 | $method = 'DELETE'; |
| 458 | 458 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 459 | 459 | $headers = ['Accept' => 'application/json']; |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | public function deleteRoleMapping(array $params = []) |
| 485 | 485 | { |
| 486 | 486 | $this->checkRequiredParameters(['name'], $params); |
| 487 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 487 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 488 | 488 | $method = 'DELETE'; |
| 489 | 489 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 490 | 490 | $headers = ['Accept' => 'application/json']; |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | public function deleteServiceToken(array $params = []) |
| 518 | 518 | { |
| 519 | 519 | $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
| 520 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
| 520 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential/token/'.$this->encode($params['name']); |
|
| 521 | 521 | $method = 'DELETE'; |
| 522 | 522 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 523 | 523 | $headers = ['Accept' => 'application/json']; |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | public function deleteUser(array $params = []) |
| 549 | 549 | { |
| 550 | 550 | $this->checkRequiredParameters(['username'], $params); |
| 551 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 551 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 552 | 552 | $method = 'DELETE'; |
| 553 | 553 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 554 | 554 | $headers = ['Accept' => 'application/json']; |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | public function disableUser(array $params = []) |
| 580 | 580 | { |
| 581 | 581 | $this->checkRequiredParameters(['username'], $params); |
| 582 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
| 582 | + $url = '/_security/user/'.$this->encode($params['username']).'/_disable'; |
|
| 583 | 583 | $method = 'PUT'; |
| 584 | 584 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 585 | 585 | $headers = ['Accept' => 'application/json']; |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | public function disableUserProfile(array $params = []) |
| 611 | 611 | { |
| 612 | 612 | $this->checkRequiredParameters(['uid'], $params); |
| 613 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
| 613 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_disable'; |
|
| 614 | 614 | $method = 'PUT'; |
| 615 | 615 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 616 | 616 | $headers = ['Accept' => 'application/json']; |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | public function enableUser(array $params = []) |
| 642 | 642 | { |
| 643 | 643 | $this->checkRequiredParameters(['username'], $params); |
| 644 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
| 644 | + $url = '/_security/user/'.$this->encode($params['username']).'/_enable'; |
|
| 645 | 645 | $method = 'PUT'; |
| 646 | 646 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 647 | 647 | $headers = ['Accept' => 'application/json']; |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | public function enableUserProfile(array $params = []) |
| 673 | 673 | { |
| 674 | 674 | $this->checkRequiredParameters(['uid'], $params); |
| 675 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
| 675 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_enable'; |
|
| 676 | 676 | $method = 'PUT'; |
| 677 | 677 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 678 | 678 | $headers = ['Accept' => 'application/json']; |
@@ -817,10 +817,10 @@ discard block |
||
| 817 | 817 | public function getPrivileges(array $params = []) |
| 818 | 818 | { |
| 819 | 819 | if (isset($params['application']) && isset($params['name'])) { |
| 820 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
| 820 | + $url = '/_security/privilege/'.$this->encode($params['application']).'/'.$this->encode($params['name']); |
|
| 821 | 821 | $method = 'GET'; |
| 822 | 822 | } elseif (isset($params['application'])) { |
| 823 | - $url = '/_security/privilege/' . $this->encode($params['application']); |
|
| 823 | + $url = '/_security/privilege/'.$this->encode($params['application']); |
|
| 824 | 824 | $method = 'GET'; |
| 825 | 825 | } else { |
| 826 | 826 | $url = '/_security/privilege'; |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | public function getRole(array $params = []) |
| 854 | 854 | { |
| 855 | 855 | if (isset($params['name'])) { |
| 856 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 856 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 857 | 857 | $method = 'GET'; |
| 858 | 858 | } else { |
| 859 | 859 | $url = '/_security/role'; |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | public function getRoleMapping(array $params = []) |
| 887 | 887 | { |
| 888 | 888 | if (isset($params['name'])) { |
| 889 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 889 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 890 | 890 | $method = 'GET'; |
| 891 | 891 | } else { |
| 892 | 892 | $url = '/_security/role_mapping'; |
@@ -920,10 +920,10 @@ discard block |
||
| 920 | 920 | public function getServiceAccounts(array $params = []) |
| 921 | 921 | { |
| 922 | 922 | if (isset($params['namespace']) && isset($params['service'])) { |
| 923 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
| 923 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']); |
|
| 924 | 924 | $method = 'GET'; |
| 925 | 925 | } elseif (isset($params['namespace'])) { |
| 926 | - $url = '/_security/service/' . $this->encode($params['namespace']); |
|
| 926 | + $url = '/_security/service/'.$this->encode($params['namespace']); |
|
| 927 | 927 | $method = 'GET'; |
| 928 | 928 | } else { |
| 929 | 929 | $url = '/_security/service'; |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | public function getServiceCredentials(array $params = []) |
| 959 | 959 | { |
| 960 | 960 | $this->checkRequiredParameters(['namespace', 'service'], $params); |
| 961 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
| 961 | + $url = '/_security/service/'.$this->encode($params['namespace']).'/'.$this->encode($params['service']).'/credential'; |
|
| 962 | 962 | $method = 'GET'; |
| 963 | 963 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 964 | 964 | $headers = ['Accept' => 'application/json']; |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | public function getUser(array $params = []) |
| 1045 | 1045 | { |
| 1046 | 1046 | if (isset($params['username'])) { |
| 1047 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1047 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 1048 | 1048 | $method = 'GET'; |
| 1049 | 1049 | } else { |
| 1050 | 1050 | $url = '/_security/user'; |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | public function getUserProfile(array $params = []) |
| 1107 | 1107 | { |
| 1108 | 1108 | $this->checkRequiredParameters(['uid'], $params); |
| 1109 | - $url = '/_security/profile/' . $this->encode($params['uid']); |
|
| 1109 | + $url = '/_security/profile/'.$this->encode($params['uid']); |
|
| 1110 | 1110 | $method = 'GET'; |
| 1111 | 1111 | $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1112 | 1112 | $headers = ['Accept' => 'application/json']; |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | { |
| 1168 | 1168 | $this->checkRequiredParameters(['body'], $params); |
| 1169 | 1169 | if (isset($params['user'])) { |
| 1170 | - $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
| 1170 | + $url = '/_security/user/'.$this->encode($params['user']).'/_has_privileges'; |
|
| 1171 | 1171 | $method = empty($params['body']) ? 'GET' : 'POST'; |
| 1172 | 1172 | } else { |
| 1173 | 1173 | $url = '/_security/user/_has_privileges'; |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | public function putRole(array $params = []) |
| 1408 | 1408 | { |
| 1409 | 1409 | $this->checkRequiredParameters(['name', 'body'], $params); |
| 1410 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
| 1410 | + $url = '/_security/role/'.$this->encode($params['name']); |
|
| 1411 | 1411 | $method = 'PUT'; |
| 1412 | 1412 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1413 | 1413 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | public function putRoleMapping(array $params = []) |
| 1440 | 1440 | { |
| 1441 | 1441 | $this->checkRequiredParameters(['name', 'body'], $params); |
| 1442 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
| 1442 | + $url = '/_security/role_mapping/'.$this->encode($params['name']); |
|
| 1443 | 1443 | $method = 'PUT'; |
| 1444 | 1444 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1445 | 1445 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | public function putUser(array $params = []) |
| 1472 | 1472 | { |
| 1473 | 1473 | $this->checkRequiredParameters(['username', 'body'], $params); |
| 1474 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
| 1474 | + $url = '/_security/user/'.$this->encode($params['username']); |
|
| 1475 | 1475 | $method = 'PUT'; |
| 1476 | 1476 | $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1477 | 1477 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1704,7 +1704,7 @@ discard block |
||
| 1704 | 1704 | public function samlServiceProviderMetadata(array $params = []) |
| 1705 | 1705 | { |
| 1706 | 1706 | $this->checkRequiredParameters(['realm_name'], $params); |
| 1707 | - $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
| 1707 | + $url = '/_security/saml/metadata/'.$this->encode($params['realm_name']); |
|
| 1708 | 1708 | $method = 'GET'; |
| 1709 | 1709 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1710 | 1710 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1764,7 +1764,7 @@ discard block |
||
| 1764 | 1764 | public function updateApiKey(array $params = []) |
| 1765 | 1765 | { |
| 1766 | 1766 | $this->checkRequiredParameters(['id'], $params); |
| 1767 | - $url = '/_security/api_key/' . $this->encode($params['id']); |
|
| 1767 | + $url = '/_security/api_key/'.$this->encode($params['id']); |
|
| 1768 | 1768 | $method = 'PUT'; |
| 1769 | 1769 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1770 | 1770 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | public function updateCrossClusterApiKey(array $params = []) |
| 1796 | 1796 | { |
| 1797 | 1797 | $this->checkRequiredParameters(['id', 'body'], $params); |
| 1798 | - $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
| 1798 | + $url = '/_security/cross_cluster/api_key/'.$this->encode($params['id']); |
|
| 1799 | 1799 | $method = 'PUT'; |
| 1800 | 1800 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1801 | 1801 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -1858,7 +1858,7 @@ discard block |
||
| 1858 | 1858 | public function updateUserProfileData(array $params = []) |
| 1859 | 1859 | { |
| 1860 | 1860 | $this->checkRequiredParameters(['uid', 'body'], $params); |
| 1861 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
| 1861 | + $url = '/_security/profile/'.$this->encode($params['uid']).'/_data'; |
|
| 1862 | 1862 | $method = 'PUT'; |
| 1863 | 1863 | $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
| 1864 | 1864 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @generated This file is generated, please do not edit |
| 25 | 25 | */ |
| 26 | -class Security extends AbstractEndpoint |
|
| 27 | -{ |
|
| 26 | +class Security extends AbstractEndpoint { |
|
| 28 | 27 | /** |
| 29 | 28 | * Creates or updates the user profile on behalf of another user. |
| 30 | 29 | * |