Skip to content

Commit 6427f8c

Browse files
committed
Added common parameters for endpoints
1 parent d3b0386 commit 6427f8c

36 files changed

+4122
-498
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
final class Client
2929
{
3030
const CLIENT_NAME = 'es';
31-
const VERSION = '8.0.0-rc1';
31+
const VERSION = '8.0.0-rc2';
3232

3333
use ClientEndpointsTrait;
3434
use EndpointTrait;

src/Endpoints/AbstractEndpoint.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
namespace Elastic\Elasticsearch\Endpoints;
1616

1717
use Elastic\Elasticsearch\Client;
18+
use Elastic\Elasticsearch\Traits\EndpointTrait;
1819

1920
abstract class AbstractEndpoint
2021
{
22+
use EndpointTrait;
23+
2124
protected Client $client;
2225

2326
public function __construct(Client $client)

src/Endpoints/AsyncSearch.php

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,37 @@
1616

1717
namespace Elastic\Elasticsearch\Endpoints;
1818

19+
use Elastic\Elasticsearch\Exception\ClientResponseException;
1920
use Elastic\Elasticsearch\Exception\MissingParameterException;
21+
use Elastic\Elasticsearch\Exception\ServerResponseException;
2022
use Elastic\Elasticsearch\Response\Elasticsearch;
21-
use Elastic\Elasticsearch\Traits\EndpointTrait;
23+
use Elastic\Transport\Exception\NoAliveException;
2224
use Http\Promise\Promise;
2325

2426
/**
2527
* @generated This file is generated, please do not edit
2628
*/
2729
class AsyncSearch extends AbstractEndpoint
2830
{
29-
use EndpointTrait;
30-
3131
/**
3232
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
3333
*
3434
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3535
*
3636
* @param array{
3737
* id: string, // (REQUIRED) The async search ID
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.
3843
* } $params
44+
*
3945
* @throws MissingParameterException if a required parameter is missing
46+
* @throws NoAliveException 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+
*
4050
* @return Elasticsearch|Promise
4151
*/
4252
public function delete(array $params = [])
@@ -45,7 +55,7 @@ public function delete(array $params = [])
4555
$url = '/_async_search/' . urlencode((string) $params['id']);
4656
$method = 'DELETE';
4757

48-
$url = $this->addQueryString($url, $params, []);
58+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
4959
$headers = array (
5060
'Accept' => 'application/json',
5161
);
@@ -63,8 +73,18 @@ public function delete(array $params = [])
6373
* wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response
6474
* keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
6575
* typed_keys: boolean, // Specify whether aggregation and suggester names should be prefixed by their respective types in the response
76+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
77+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
78+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
79+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
80+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
6681
* } $params
82+
*
6783
* @throws MissingParameterException if a required parameter is missing
84+
* @throws NoAliveException if all the hosts are offline
85+
* @throws ClientResponseException if the status code of response is 4xx
86+
* @throws ServerResponseException if the status code of response is 5xx
87+
*
6888
* @return Elasticsearch|Promise
6989
*/
7090
public function get(array $params = [])
@@ -73,7 +93,7 @@ public function get(array $params = [])
7393
$url = '/_async_search/' . urlencode((string) $params['id']);
7494
$method = 'GET';
7595

76-
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_alive','typed_keys']);
96+
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_alive','typed_keys','pretty','human','error_trace','source','filter_path']);
7797
$headers = array (
7898
'Accept' => 'application/json',
7999
);
@@ -88,8 +108,18 @@ public function get(array $params = [])
88108
*
89109
* @param array{
90110
* id: string, // (REQUIRED) The async search ID
111+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
112+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
113+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
114+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
115+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
91116
* } $params
117+
*
92118
* @throws MissingParameterException if a required parameter is missing
119+
* @throws NoAliveException 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+
*
93123
* @return Elasticsearch|Promise
94124
*/
95125
public function status(array $params = [])
@@ -98,7 +128,7 @@ public function status(array $params = [])
98128
$url = '/_async_search/status/' . urlencode((string) $params['id']);
99129
$method = 'GET';
100130

101-
$url = $this->addQueryString($url, $params, []);
131+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
102132
$headers = array (
103133
'Accept' => 'application/json',
104134
);
@@ -154,9 +184,19 @@ public function status(array $params = [])
154184
* version: boolean, // Specify whether to return document version as part of a hit
155185
* seq_no_primary_term: boolean, // Specify whether to return sequence number and primary term of the last modification of each hit
156186
* max_concurrent_shard_requests: number, // The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
187+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
188+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
189+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
190+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
191+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
157192
* body: array, // The search definition using the Query DSL
158193
* } $params
194+
*
159195
* @throws MissingParameterException if a required parameter is missing
196+
* @throws NoAliveException if all the hosts are offline
197+
* @throws ClientResponseException if the status code of response is 4xx
198+
* @throws ServerResponseException if the status code of response is 5xx
199+
*
160200
* @return Elasticsearch|Promise
161201
*/
162202
public function submit(array $params = [])
@@ -168,7 +208,7 @@ public function submit(array $params = [])
168208
$url = '/_async_search';
169209
$method = 'POST';
170210
}
171-
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','batched_reduce_size','request_cache','analyzer','analyze_wildcard','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','max_concurrent_shard_requests']);
211+
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','batched_reduce_size','request_cache','analyzer','analyze_wildcard','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','max_concurrent_shard_requests','pretty','human','error_trace','source','filter_path']);
172212
$headers = array (
173213
'Accept' => 'application/json',
174214
'Content-Type' => 'application/json',

src/Endpoints/Autoscaling.php

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,37 @@
1616

1717
namespace Elastic\Elasticsearch\Endpoints;
1818

19+
use Elastic\Elasticsearch\Exception\ClientResponseException;
1920
use Elastic\Elasticsearch\Exception\MissingParameterException;
21+
use Elastic\Elasticsearch\Exception\ServerResponseException;
2022
use Elastic\Elasticsearch\Response\Elasticsearch;
21-
use Elastic\Elasticsearch\Traits\EndpointTrait;
23+
use Elastic\Transport\Exception\NoAliveException;
2224
use Http\Promise\Promise;
2325

2426
/**
2527
* @generated This file is generated, please do not edit
2628
*/
2729
class Autoscaling extends AbstractEndpoint
2830
{
29-
use EndpointTrait;
30-
3131
/**
3232
* Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
3333
*
3434
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
3535
*
3636
* @param array{
3737
* name: string, // (REQUIRED) the name of the autoscaling policy
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.
3843
* } $params
44+
*
3945
* @throws MissingParameterException if a required parameter is missing
46+
* @throws NoAliveException 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+
*
4050
* @return Elasticsearch|Promise
4151
*/
4252
public function deleteAutoscalingPolicy(array $params = [])
@@ -45,7 +55,7 @@ public function deleteAutoscalingPolicy(array $params = [])
4555
$url = '/_autoscaling/policy/' . urlencode((string) $params['name']);
4656
$method = 'DELETE';
4757

48-
$url = $this->addQueryString($url, $params, []);
58+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
4959
$headers = array (
5060
'Accept' => 'application/json',
5161
);
@@ -63,7 +73,7 @@ public function getAutoscalingCapacity(array $params = [])
6373
$url = '/_autoscaling/capacity';
6474
$method = 'GET';
6575

66-
$url = $this->addQueryString($url, $params, []);
76+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
6777
$headers = array (
6878
'Accept' => 'application/json',
6979
);
@@ -78,8 +88,18 @@ public function getAutoscalingCapacity(array $params = [])
7888
*
7989
* @param array{
8090
* name: string, // (REQUIRED) the name of the autoscaling policy
91+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
92+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
93+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
94+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
95+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
8196
* } $params
97+
*
8298
* @throws MissingParameterException if a required parameter is missing
99+
* @throws NoAliveException if all the hosts are offline
100+
* @throws ClientResponseException if the status code of response is 4xx
101+
* @throws ServerResponseException if the status code of response is 5xx
102+
*
83103
* @return Elasticsearch|Promise
84104
*/
85105
public function getAutoscalingPolicy(array $params = [])
@@ -88,7 +108,7 @@ public function getAutoscalingPolicy(array $params = [])
88108
$url = '/_autoscaling/policy/' . urlencode((string) $params['name']);
89109
$method = 'GET';
90110

91-
$url = $this->addQueryString($url, $params, []);
111+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
92112
$headers = array (
93113
'Accept' => 'application/json',
94114
);
@@ -103,9 +123,19 @@ public function getAutoscalingPolicy(array $params = [])
103123
*
104124
* @param array{
105125
* name: string, // (REQUIRED) the name of the autoscaling policy
126+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
127+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
128+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
129+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
130+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
106131
* body: array, // (REQUIRED) the specification of the autoscaling policy
107132
* } $params
133+
*
108134
* @throws MissingParameterException if a required parameter is missing
135+
* @throws NoAliveException if all the hosts are offline
136+
* @throws ClientResponseException if the status code of response is 4xx
137+
* @throws ServerResponseException if the status code of response is 5xx
138+
*
109139
* @return Elasticsearch|Promise
110140
*/
111141
public function putAutoscalingPolicy(array $params = [])
@@ -114,7 +144,7 @@ public function putAutoscalingPolicy(array $params = [])
114144
$url = '/_autoscaling/policy/' . urlencode((string) $params['name']);
115145
$method = 'PUT';
116146

117-
$url = $this->addQueryString($url, $params, []);
147+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
118148
$headers = array (
119149
'Accept' => 'application/json',
120150
'Content-Type' => 'application/json',

0 commit comments

Comments
 (0)