Skip to content

Commit 2672438

Browse files
committed
Updated endpoints to 8.5.0
1 parent f33239a commit 2672438

File tree

5 files changed

+121
-58
lines changed

5 files changed

+121
-58
lines changed

src/Endpoints/Indices.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,45 @@ public function diskUsage(array $params = [])
575575
}
576576

577577

578+
/**
579+
* Downsample an index
580+
*
581+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html
582+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
583+
*
584+
* @param array{
585+
* index: string, // (REQUIRED) The index to downsample
586+
* target_index: string, // (REQUIRED) The name of the target index to store downsampled data
587+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
588+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
589+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
590+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
591+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
592+
* body: array, // (REQUIRED) The downsampling configuration
593+
* } $params
594+
*
595+
* @throws MissingParameterException if a required parameter is missing
596+
* @throws NoNodeAvailableException if all the hosts are offline
597+
* @throws ClientResponseException if the status code of response is 4xx
598+
* @throws ServerResponseException if the status code of response is 5xx
599+
*
600+
* @return Elasticsearch|Promise
601+
*/
602+
public function downsample(array $params = [])
603+
{
604+
$this->checkRequiredParameters(['index','target_index','body'], $params);
605+
$url = '/' . $this->encode($params['index']) . '/_downsample/' . $this->encode($params['target_index']);
606+
$method = 'POST';
607+
608+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
609+
$headers = [
610+
'Accept' => 'application/json',
611+
'Content-Type' => 'application/json',
612+
];
613+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
614+
}
615+
616+
578617
/**
579618
* Returns information about whether a particular index exists.
580619
*

src/Endpoints/Ml.php

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,42 @@
2828
*/
2929
class Ml extends AbstractEndpoint
3030
{
31+
/**
32+
* Clear the cached results from a trained model deployment
33+
*
34+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html
35+
*
36+
* @param array{
37+
* model_id: string, // (REQUIRED) The unique identifier of the trained model.
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 clearTrainedModelDeploymentCache(array $params = [])
53+
{
54+
$this->checkRequiredParameters(['model_id'], $params);
55+
$url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/cache/_clear';
56+
$method = 'POST';
57+
58+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
59+
$headers = [
60+
'Accept' => 'application/json',
61+
'Content-Type' => 'application/json',
62+
];
63+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
64+
}
65+
66+
3167
/**
3268
* Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
3369
*
@@ -1503,7 +1539,6 @@ public function getTrainedModelsStats(array $params = [])
15031539
* Evaluate a trained model.
15041540
*
15051541
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html
1506-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
15071542
*
15081543
* @param array{
15091544
* model_id: string, // (REQUIRED) The unique identifier of the trained model.
@@ -2072,7 +2107,6 @@ public function putTrainedModelAlias(array $params = [])
20722107
* Creates part of a trained model definition
20732108
*
20742109
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html
2075-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
20762110
*
20772111
* @param array{
20782112
* model_id: string, // (REQUIRED) The ID of the trained model for this definition part
@@ -2111,7 +2145,6 @@ public function putTrainedModelDefinitionPart(array $params = [])
21112145
* Creates a trained model vocabulary
21122146
*
21132147
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html
2114-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
21152148
*
21162149
* @param array{
21172150
* model_id: string, // (REQUIRED) The ID of the trained model for this vocabulary
@@ -2336,12 +2369,11 @@ public function startDatafeed(array $params = [])
23362369
* Start a trained model deployment.
23372370
*
23382371
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html
2339-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
23402372
*
23412373
* @param array{
23422374
* model_id: string, // (REQUIRED) The unique identifier of the trained model.
23432375
* cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb.
2344-
* number_of_allocations: int, // The number of model allocations on each node where the model is deployed.
2376+
* number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes.
23452377
* threads_per_allocation: int, // The number of threads used by each model allocation during inference.
23462378
* queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time.
23472379
* timeout: time, // Controls the amount of time to wait for the model to deploy.
@@ -2460,7 +2492,6 @@ public function stopDatafeed(array $params = [])
24602492
* Stop a trained model deployment.
24612493
*
24622494
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html
2463-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
24642495
*
24652496
* @param array{
24662497
* model_id: string, // (REQUIRED) The unique identifier of the trained model.

src/Endpoints/Rollup.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -214,45 +214,6 @@ public function putJob(array $params = [])
214214
}
215215

216216

217-
/**
218-
* Rollup an index
219-
*
220-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html
221-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
222-
*
223-
* @param array{
224-
* index: string, // (REQUIRED) The index to roll up
225-
* rollup_index: string, // (REQUIRED) The name of the rollup index to create
226-
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
227-
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
228-
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
229-
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
230-
* filter_path: list, // A comma-separated list of filters used to reduce the response.
231-
* body: array, // (REQUIRED) The rollup configuration
232-
* } $params
233-
*
234-
* @throws MissingParameterException if a required parameter is missing
235-
* @throws NoNodeAvailableException if all the hosts are offline
236-
* @throws ClientResponseException if the status code of response is 4xx
237-
* @throws ServerResponseException if the status code of response is 5xx
238-
*
239-
* @return Elasticsearch|Promise
240-
*/
241-
public function rollup(array $params = [])
242-
{
243-
$this->checkRequiredParameters(['index','rollup_index','body'], $params);
244-
$url = '/' . $this->encode($params['index']) . '/_rollup/' . $this->encode($params['rollup_index']);
245-
$method = 'POST';
246-
247-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
248-
$headers = [
249-
'Accept' => 'application/json',
250-
'Content-Type' => 'application/json',
251-
];
252-
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
253-
}
254-
255-
256217
/**
257218
* Enables searching rolled-up data using the standard query DSL.
258219
*

src/Endpoints/Security.php

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Security extends AbstractEndpoint
3232
* Creates or updates the user profile on behalf of another user.
3333
*
3434
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html
35-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
3635
*
3736
* @param array{
3837
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -96,6 +95,41 @@ public function authenticate(array $params = [])
9695
}
9796

9897

98+
/**
99+
* Updates the attributes of multiple existing API keys.
100+
*
101+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html
102+
*
103+
* @param array{
104+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
105+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
106+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
107+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
108+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
109+
* body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys.
110+
* } $params
111+
*
112+
* @throws NoNodeAvailableException if all the hosts are offline
113+
* @throws ClientResponseException if the status code of response is 4xx
114+
* @throws ServerResponseException if the status code of response is 5xx
115+
*
116+
* @return Elasticsearch|Promise
117+
*/
118+
public function bulkUpdateApiKeys(array $params = [])
119+
{
120+
$this->checkRequiredParameters(['body'], $params);
121+
$url = '/_security/api_key/_bulk_update';
122+
$method = 'POST';
123+
124+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
125+
$headers = [
126+
'Accept' => 'application/json',
127+
'Content-Type' => 'application/json',
128+
];
129+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
130+
}
131+
132+
99133
/**
100134
* Changes the passwords of users in the native realm and built-in users.
101135
*
@@ -616,7 +650,6 @@ public function disableUser(array $params = [])
616650
* Disables a user profile so it's not visible in user profile searches.
617651
*
618652
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html
619-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
620653
*
621654
* @param array{
622655
* uid: string, // (REQUIRED) Unique identifier for the user profile
@@ -689,7 +722,6 @@ public function enableUser(array $params = [])
689722
* Enables a user profile so it's visible in user profile searches.
690723
*
691724
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html
692-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
693725
*
694726
* @param array{
695727
* uid: string, // (REQUIRED) An unique identifier of the user profile
@@ -799,6 +831,7 @@ public function enrollNode(array $params = [])
799831
* username: string, // user name of the user who created this API key to be retrieved
800832
* realm_name: string, // realm name of the user who created this API key to be retrieved
801833
* owner: boolean, // flag to query API keys owned by the currently authenticated user
834+
* with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
802835
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
803836
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
804837
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -817,7 +850,7 @@ public function getApiKey(array $params = [])
817850
$url = '/_security/api_key';
818851
$method = 'GET';
819852

820-
$url = $this->addQueryString($url, $params, ['id','name','username','realm_name','owner','pretty','human','error_trace','source','filter_path']);
853+
$url = $this->addQueryString($url, $params, ['id','name','username','realm_name','owner','with_limited_by','pretty','human','error_trace','source','filter_path']);
821854
$headers = [
822855
'Accept' => 'application/json',
823856
];
@@ -1091,6 +1124,7 @@ public function getToken(array $params = [])
10911124
*
10921125
* @param array{
10931126
* username: list, // A comma-separated list of usernames
1127+
* with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user
10941128
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10951129
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10961130
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1113,7 +1147,7 @@ public function getUser(array $params = [])
11131147
$url = '/_security/user';
11141148
$method = 'GET';
11151149
}
1116-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
1150+
$url = $this->addQueryString($url, $params, ['with_profile_uid','pretty','human','error_trace','source','filter_path']);
11171151
$headers = [
11181152
'Accept' => 'application/json',
11191153
];
@@ -1154,13 +1188,12 @@ public function getUserPrivileges(array $params = [])
11541188

11551189

11561190
/**
1157-
* Retrieves user profile for the given unique ID.
1191+
* Retrieves user profiles for the given unique ID(s).
11581192
*
11591193
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html
1160-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
11611194
*
11621195
* @param array{
1163-
* uid: string, // (REQUIRED) An unique identifier of the user profile
1196+
* uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles
11641197
* data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
11651198
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
11661199
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
@@ -1270,7 +1303,6 @@ public function hasPrivileges(array $params = [])
12701303
* Determines whether the users associated with the specified profile IDs have all the requested privileges.
12711304
*
12721305
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html
1273-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
12741306
*
12751307
* @param array{
12761308
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -1633,6 +1665,7 @@ public function putUser(array $params = [])
16331665
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
16341666
*
16351667
* @param array{
1668+
* with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
16361669
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
16371670
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
16381671
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1652,7 +1685,7 @@ public function queryApiKeys(array $params = [])
16521685
$url = '/_security/_query/api_key';
16531686
$method = empty($params['body']) ? 'GET' : 'POST';
16541687

1655-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
1688+
$url = $this->addQueryString($url, $params, ['with_limited_by','pretty','human','error_trace','source','filter_path']);
16561689
$headers = [
16571690
'Accept' => 'application/json',
16581691
'Content-Type' => 'application/json',
@@ -1876,7 +1909,6 @@ public function samlServiceProviderMetadata(array $params = [])
18761909
* Get suggestions for user profiles that match specified search criteria.
18771910
*
18781911
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html
1879-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
18801912
*
18811913
* @param array{
18821914
* data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
@@ -1949,7 +1981,6 @@ public function updateApiKey(array $params = [])
19491981
* Update application specific data for the user profile of the given unique ID.
19501982
*
19511983
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html
1952-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
19531984
*
19541985
* @param array{
19551986
* uid: string, // (REQUIRED) An unique identifier of the user profile

src/Endpoints/TextStructure.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class TextStructure extends AbstractEndpoint
4545
* quote: string, // Optional parameter to specify the quote character for a delimited file - must be a single character
4646
* should_trim_fields: boolean, // Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
4747
* grok_pattern: string, // Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
48+
* ecs_compatibility: string, // Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled'
4849
* timestamp_field: string, // Optional parameter to specify the timestamp field in the file
4950
* timestamp_format: string, // Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
5051
* explain: boolean, // Whether to include a commentary on how the structure was derived
@@ -68,7 +69,7 @@ public function findStructure(array $params = [])
6869
$url = '/_text_structure/find_structure';
6970
$method = 'POST';
7071

71-
$url = $this->addQueryString($url, $params, ['lines_to_sample','line_merge_size_limit','timeout','charset','format','has_header_row','column_names','delimiter','quote','should_trim_fields','grok_pattern','timestamp_field','timestamp_format','explain','pretty','human','error_trace','source','filter_path']);
72+
$url = $this->addQueryString($url, $params, ['lines_to_sample','line_merge_size_limit','timeout','charset','format','has_header_row','column_names','delimiter','quote','should_trim_fields','grok_pattern','ecs_compatibility','timestamp_field','timestamp_format','explain','pretty','human','error_trace','source','filter_path']);
7273
$headers = [
7374
'Accept' => 'application/json',
7475
'Content-Type' => 'application/x-ndjson',

0 commit comments

Comments
 (0)