Skip to content

Commit

Permalink
Merge branch 'main' into 8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed May 23, 2023
2 parents 5c4d678 + 53663e7 commit 4027f29
Show file tree
Hide file tree
Showing 13 changed files with 645 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- job:
name: elastic+elasticsearch-php+8.4
display-name: 'elastic / elasticsearch-php # 8.6'
description: Testing the elasticsearch-php 8.6 branch.
name: elastic+elasticsearch-php+8.8
display-name: 'elastic / elasticsearch-php # 8.8'
description: Testing the elasticsearch-php 8.8 branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/8.6
default: refs/heads/8.8
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
- timed: 'H */12 * * *'
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^7.4 || ^8.0",
"elastic/transport": "^8.7",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/log": "^1|^2|^3",
"guzzlehttp/guzzle": "^7.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/Cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function allocation(array $params = [])
/**
* Returns information about existing component_templates templates.
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-compoentn-templates.html
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html
*
* @param array{
* name: string, // A pattern that returned component template names must match
Expand Down
3 changes: 2 additions & 1 deletion src/Endpoints/Cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function existsComponentTemplate(array $params = [])
* name: list, // The comma separated names of the component templates
* master_timeout: time, // Explicit operation timeout for connection to master node
* local: boolean, // Return local information, do not retrieve the state from master node (default: false)
* include_defaults: boolean, // Return all default configurations for the component template (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -203,7 +204,7 @@ public function getComponentTemplate(array $params = [])
$url = '/_component_template';
$method = 'GET';
}
$url = $this->addQueryString($url, $params, ['master_timeout','local','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
Expand Down
167 changes: 163 additions & 4 deletions src/Endpoints/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,45 @@ public function deleteAlias(array $params = [])
}


/**
* Deletes the data lifecycle of the selected data streams.
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-delete-lifecycle.html
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: list, // (REQUIRED) A comma-separated list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
* timeout: time, // Explicit timestamp for the document
* master_timeout: time, // Specify timeout for connection to master
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path: list, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function deleteDataLifecycle(array $params = [])
{
$this->checkRequiredParameters(['name'], $params);
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
$method = 'DELETE';

$url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
}


/**
* Deletes a data stream.
*
Expand Down Expand Up @@ -775,6 +814,44 @@ public function existsTemplate(array $params = [])
}


/**
* Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc.
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/dlm-explain-lifecycle.html
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* index: string, // (REQUIRED) The name of the index to explain
* include_defaults: boolean, // indicates if the API should return the default values the system uses for the index's lifecycle
* master_timeout: time, // Specify timeout for connection to master
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path: list, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function explainDataLifecycle(array $params = [])
{
$this->checkRequiredParameters(['index'], $params);
$url = '/' . $this->encode($params['index']) . '/_lifecycle/explain';
$method = 'GET';

$url = $this->addQueryString($url, $params, ['include_defaults','master_timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
}


/**
* Returns the field usage stats for each field of an index
*
Expand Down Expand Up @@ -992,6 +1069,44 @@ public function getAlias(array $params = [])
}


/**
* Returns the data lifecycle of the selected data streams.
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-get-lifecycle.html
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path: list, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getDataLifecycle(array $params = [])
{
$this->checkRequiredParameters(['name'], $params);
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
$method = 'GET';

$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
}


/**
* Returns data streams.
*
Expand All @@ -1000,6 +1115,7 @@ public function getAlias(array $params = [])
* @param array{
* name: list, // A comma-separated list of data streams to get; use `*` to get all data streams
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -1022,7 +1138,7 @@ public function getDataStream(array $params = [])
$url = '/_data_stream';
$method = 'GET';
}
$url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
Expand Down Expand Up @@ -1085,6 +1201,7 @@ public function getFieldMapping(array $params = [])
* flat_settings: boolean, // Return settings in flat format (default: false)
* master_timeout: time, // Explicit operation timeout for connection to master node
* local: boolean, // Return local information, do not retrieve the state from master node (default: false)
* include_defaults: boolean, // Return all relevant default configurations for the index template (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -1107,7 +1224,7 @@ public function getIndexTemplate(array $params = [])
$url = '/_index_template';
$method = 'GET';
}
$url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['flat_settings','master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
Expand Down Expand Up @@ -1434,6 +1551,46 @@ public function putAlias(array $params = [])
}


/**
* Updates the data lifecycle of the selected data streams.
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/dlm-put-lifecycle.html
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
* timeout: time, // Explicit timestamp for the document
* master_timeout: time, // Specify timeout for connection to master
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path: list, // A comma-separated list of filters used to reduce the response.
* body: array, // The data lifecycle configuration that consist of the data retention
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function putDataLifecycle(array $params = [])
{
$this->checkRequiredParameters(['name'], $params);
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
$method = 'PUT';

$url = $this->addQueryString($url, $params, ['expand_wildcards','timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
}


/**
* Creates or updates an index template.
*
Expand Down Expand Up @@ -1937,6 +2094,7 @@ public function shrink(array $params = [])
* 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
* cause: string, // User defined reason for dry-run creating the new template for simulation purposes
* master_timeout: time, // Specify timeout for connection to master
* include_defaults: boolean, // Return all relevant default configurations for this index template simulation (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -1958,7 +2116,7 @@ public function simulateIndexTemplate(array $params = [])
$url = '/_index_template/_simulate_index/' . $this->encode($params['name']);
$method = 'POST';

$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
Expand All @@ -1977,6 +2135,7 @@ public function simulateIndexTemplate(array $params = [])
* 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
* cause: string, // User defined reason for dry-run creating the new template for simulation purposes
* master_timeout: time, // Specify timeout for connection to master
* include_defaults: boolean, // Return all relevant default configurations for this template simulation (default: false)
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -2000,7 +2159,7 @@ public function simulateTemplate(array $params = [])
$url = '/_index_template/_simulate';
$method = 'POST';
}
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','include_defaults','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
Expand Down
14 changes: 8 additions & 6 deletions src/Endpoints/Logstash.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ public function deletePipeline(array $params = [])
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html
*
* @param array{
* id: string, // (REQUIRED) A comma-separated list of Pipeline IDs
* id: string, // A comma-separated list of Pipeline IDs
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path: list, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
Expand All @@ -86,10 +85,13 @@ public function deletePipeline(array $params = [])
*/
public function getPipeline(array $params = [])
{
$this->checkRequiredParameters(['id'], $params);
$url = '/_logstash/pipeline/' . $this->encode($params['id']);
$method = 'GET';

if (isset($params['id'])) {
$url = '/_logstash/pipeline/' . $this->encode($params['id']);
$method = 'GET';
} else {
$url = '/_logstash/pipeline';
$method = 'GET';
}
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
Expand Down
Loading

0 comments on commit 4027f29

Please sign in to comment.