Skip to content

Commit 4027f29

Browse files
committed
Merge branch 'main' into 8.8
2 parents 5c4d678 + 53663e7 commit 4027f29

13 files changed

+645
-36
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
- job:
3-
name: elastic+elasticsearch-php+8.4
4-
display-name: 'elastic / elasticsearch-php # 8.6'
5-
description: Testing the elasticsearch-php 8.6 branch.
3+
name: elastic+elasticsearch-php+8.8
4+
display-name: 'elastic / elasticsearch-php # 8.8'
5+
description: Testing the elasticsearch-php 8.8 branch.
66
parameters:
77
- string:
88
name: branch_specifier
9-
default: refs/heads/8.6
9+
default: refs/heads/8.8
1010
description: the Git branch specifier to build (<branchName>, <tagName>,
1111
<commitId>, etc.)
1212
triggers:
1313
- github
14-
- timed: 'H */12 * * *'
14+
- timed: 'H */12 * * *'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.4 || ^8.0",
1414
"elastic/transport": "^8.7",
1515
"psr/http-client": "^1.0",
16-
"psr/http-message": "^1.0",
16+
"psr/http-message": "^1.0 || ^2.0",
1717
"psr/log": "^1|^2|^3",
1818
"guzzlehttp/guzzle": "^7.0"
1919
},

src/Endpoints/Cat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function allocation(array $params = [])
120120
/**
121121
* Returns information about existing component_templates templates.
122122
*
123-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-compoentn-templates.html
123+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html
124124
*
125125
* @param array{
126126
* name: string, // A pattern that returned component template names must match

src/Endpoints/Cluster.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public function existsComponentTemplate(array $params = [])
181181
* name: list, // The comma separated names of the component templates
182182
* master_timeout: time, // Explicit operation timeout for connection to master node
183183
* local: boolean, // Return local information, do not retrieve the state from master node (default: false)
184+
* include_defaults: boolean, // Return all default configurations for the component template (default: false)
184185
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
185186
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
186187
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -203,7 +204,7 @@ public function getComponentTemplate(array $params = [])
203204
$url = '/_component_template';
204205
$method = 'GET';
205206
}
206-
$url = $this->addQueryString($url, $params, ['master_timeout','local','pretty','human','error_trace','source','filter_path']);
207+
$url = $this->addQueryString($url, $params, ['master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']);
207208
$headers = [
208209
'Accept' => 'application/json',
209210
];

src/Endpoints/Indices.php

Lines changed: 163 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,45 @@ public function deleteAlias(array $params = [])
424424
}
425425

426426

427+
/**
428+
* Deletes the data lifecycle of the selected data streams.
429+
*
430+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-delete-lifecycle.html
431+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
432+
*
433+
* @param array{
434+
* name: list, // (REQUIRED) A comma-separated list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams
435+
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
436+
* timeout: time, // Explicit timestamp for the document
437+
* master_timeout: time, // Specify timeout for connection to master
438+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
439+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
440+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
441+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
442+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
443+
* } $params
444+
*
445+
* @throws MissingParameterException if a required parameter is missing
446+
* @throws NoNodeAvailableException if all the hosts are offline
447+
* @throws ClientResponseException if the status code of response is 4xx
448+
* @throws ServerResponseException if the status code of response is 5xx
449+
*
450+
* @return Elasticsearch|Promise
451+
*/
452+
public function deleteDataLifecycle(array $params = [])
453+
{
454+
$this->checkRequiredParameters(['name'], $params);
455+
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
456+
$method = 'DELETE';
457+
458+
$url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
459+
$headers = [
460+
'Accept' => 'application/json',
461+
];
462+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
463+
}
464+
465+
427466
/**
428467
* Deletes a data stream.
429468
*
@@ -775,6 +814,44 @@ public function existsTemplate(array $params = [])
775814
}
776815

777816

817+
/**
818+
* Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc.
819+
*
820+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/dlm-explain-lifecycle.html
821+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
822+
*
823+
* @param array{
824+
* index: string, // (REQUIRED) The name of the index to explain
825+
* include_defaults: boolean, // indicates if the API should return the default values the system uses for the index's lifecycle
826+
* master_timeout: time, // Specify timeout for connection to master
827+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
828+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
829+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
830+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
831+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
832+
* } $params
833+
*
834+
* @throws MissingParameterException if a required parameter is missing
835+
* @throws NoNodeAvailableException if all the hosts are offline
836+
* @throws ClientResponseException if the status code of response is 4xx
837+
* @throws ServerResponseException if the status code of response is 5xx
838+
*
839+
* @return Elasticsearch|Promise
840+
*/
841+
public function explainDataLifecycle(array $params = [])
842+
{
843+
$this->checkRequiredParameters(['index'], $params);
844+
$url = '/' . $this->encode($params['index']) . '/_lifecycle/explain';
845+
$method = 'GET';
846+
847+
$url = $this->addQueryString($url, $params, ['include_defaults','master_timeout','pretty','human','error_trace','source','filter_path']);
848+
$headers = [
849+
'Accept' => 'application/json',
850+
];
851+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
852+
}
853+
854+
778855
/**
779856
* Returns the field usage stats for each field of an index
780857
*
@@ -992,6 +1069,44 @@ public function getAlias(array $params = [])
9921069
}
9931070

9941071

1072+
/**
1073+
* Returns the data lifecycle of the selected data streams.
1074+
*
1075+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-get-lifecycle.html
1076+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1077+
*
1078+
* @param array{
1079+
* name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
1080+
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1081+
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
1082+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1083+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1084+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1085+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1086+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
1087+
* } $params
1088+
*
1089+
* @throws MissingParameterException if a required parameter is missing
1090+
* @throws NoNodeAvailableException if all the hosts are offline
1091+
* @throws ClientResponseException if the status code of response is 4xx
1092+
* @throws ServerResponseException if the status code of response is 5xx
1093+
*
1094+
* @return Elasticsearch|Promise
1095+
*/
1096+
public function getDataLifecycle(array $params = [])
1097+
{
1098+
$this->checkRequiredParameters(['name'], $params);
1099+
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
1100+
$method = 'GET';
1101+
1102+
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
1103+
$headers = [
1104+
'Accept' => 'application/json',
1105+
];
1106+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1107+
}
1108+
1109+
9951110
/**
9961111
* Returns data streams.
9971112
*
@@ -1000,6 +1115,7 @@ public function getAlias(array $params = [])
10001115
* @param array{
10011116
* name: list, // A comma-separated list of data streams to get; use `*` to get all data streams
10021117
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1118+
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
10031119
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10041120
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10051121
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1022,7 +1138,7 @@ public function getDataStream(array $params = [])
10221138
$url = '/_data_stream';
10231139
$method = 'GET';
10241140
}
1025-
$url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']);
1141+
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
10261142
$headers = [
10271143
'Accept' => 'application/json',
10281144
];
@@ -1085,6 +1201,7 @@ public function getFieldMapping(array $params = [])
10851201
* flat_settings: boolean, // Return settings in flat format (default: false)
10861202
* master_timeout: time, // Explicit operation timeout for connection to master node
10871203
* local: boolean, // Return local information, do not retrieve the state from master node (default: false)
1204+
* include_defaults: boolean, // Return all relevant default configurations for the index template (default: false)
10881205
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10891206
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10901207
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1107,7 +1224,7 @@ public function getIndexTemplate(array $params = [])
11071224
$url = '/_index_template';
11081225
$method = 'GET';
11091226
}
1110-
$url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','pretty','human','error_trace','source','filter_path']);
1227+
$url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']);
11111228
$headers = [
11121229
'Accept' => 'application/json',
11131230
];
@@ -1434,6 +1551,46 @@ public function putAlias(array $params = [])
14341551
}
14351552

14361553

1554+
/**
1555+
* Updates the data lifecycle of the selected data streams.
1556+
*
1557+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-put-lifecycle.html
1558+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
1559+
*
1560+
* @param array{
1561+
* name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
1562+
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
1563+
* timeout: time, // Explicit timestamp for the document
1564+
* master_timeout: time, // Specify timeout for connection to master
1565+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1566+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1567+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1568+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1569+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
1570+
* body: array, // The data lifecycle configuration that consist of the data retention
1571+
* } $params
1572+
*
1573+
* @throws MissingParameterException if a required parameter is missing
1574+
* @throws NoNodeAvailableException if all the hosts are offline
1575+
* @throws ClientResponseException if the status code of response is 4xx
1576+
* @throws ServerResponseException if the status code of response is 5xx
1577+
*
1578+
* @return Elasticsearch|Promise
1579+
*/
1580+
public function putDataLifecycle(array $params = [])
1581+
{
1582+
$this->checkRequiredParameters(['name'], $params);
1583+
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
1584+
$method = 'PUT';
1585+
1586+
$url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
1587+
$headers = [
1588+
'Accept' => 'application/json',
1589+
];
1590+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1591+
}
1592+
1593+
14371594
/**
14381595
* Creates or updates an index template.
14391596
*
@@ -1937,6 +2094,7 @@ public function shrink(array $params = [])
19372094
* create: boolean, // Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
19382095
* cause: string, // User defined reason for dry-run creating the new template for simulation purposes
19392096
* master_timeout: time, // Specify timeout for connection to master
2097+
* include_defaults: boolean, // Return all relevant default configurations for this index template simulation (default: false)
19402098
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
19412099
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
19422100
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1958,7 +2116,7 @@ public function simulateIndexTemplate(array $params = [])
19582116
$url = '/_index_template/_simulate_index/' . $this->encode($params['name']);
19592117
$method = 'POST';
19602118

1961-
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']);
2119+
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']);
19622120
$headers = [
19632121
'Accept' => 'application/json',
19642122
'Content-Type' => 'application/json',
@@ -1977,6 +2135,7 @@ public function simulateIndexTemplate(array $params = [])
19772135
* create: boolean, // Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
19782136
* cause: string, // User defined reason for dry-run creating the new template for simulation purposes
19792137
* master_timeout: time, // Specify timeout for connection to master
2138+
* include_defaults: boolean, // Return all relevant default configurations for this template simulation (default: false)
19802139
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
19812140
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
19822141
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -2000,7 +2159,7 @@ public function simulateTemplate(array $params = [])
20002159
$url = '/_index_template/_simulate';
20012160
$method = 'POST';
20022161
}
2003-
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']);
2162+
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']);
20042163
$headers = [
20052164
'Accept' => 'application/json',
20062165
'Content-Type' => 'application/json',

src/Endpoints/Logstash.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ public function deletePipeline(array $params = [])
6969
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html
7070
*
7171
* @param array{
72-
* id: string, // (REQUIRED) A comma-separated list of Pipeline IDs
72+
* id: string, // A comma-separated list of Pipeline IDs
7373
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
7474
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
7575
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
7676
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
7777
* filter_path: list, // A comma-separated list of filters used to reduce the response.
7878
* } $params
7979
*
80-
* @throws MissingParameterException if a required parameter is missing
8180
* @throws NoNodeAvailableException if all the hosts are offline
8281
* @throws ClientResponseException if the status code of response is 4xx
8382
* @throws ServerResponseException if the status code of response is 5xx
@@ -86,10 +85,13 @@ public function deletePipeline(array $params = [])
8685
*/
8786
public function getPipeline(array $params = [])
8887
{
89-
$this->checkRequiredParameters(['id'], $params);
90-
$url = '/_logstash/pipeline/' . $this->encode($params['id']);
91-
$method = 'GET';
92-
88+
if (isset($params['id'])) {
89+
$url = '/_logstash/pipeline/' . $this->encode($params['id']);
90+
$method = 'GET';
91+
} else {
92+
$url = '/_logstash/pipeline';
93+
$method = 'GET';
94+
}
9395
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
9496
$headers = [
9597
'Accept' => 'application/json',

0 commit comments

Comments
 (0)