@@ -35,13 +35,13 @@ class Autoscaling extends AbstractEndpoint
35
35
*
36
36
* @param array{
37
37
* name: string, // (REQUIRED) the name of the autoscaling policy
38
- * master_timeout: time , // Timeout for processing on master node
39
- * timeout: time , // Timeout for acknowledgement of update from all nodes in cluster
40
- * pretty: boolean , // Pretty format the returned JSON response. (DEFAULT: false)
41
- * human: boolean , // Return human readable values for statistics. (DEFAULT: true)
42
- * error_trace: boolean , // Include the stack trace of returned errors. (DEFAULT: false)
43
- * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44
- * filter_path: list , // A comma-separated list of filters used to reduce the response.
38
+ * master_timeout?: int|string , // Timeout for processing on master node
39
+ * timeout?: int|string , // Timeout for acknowledgement of update from all nodes in cluster
40
+ * pretty?: bool , // Pretty format the returned JSON response. (DEFAULT: false)
41
+ * human?: bool , // Return human readable values for statistics. (DEFAULT: true)
42
+ * error_trace?: bool , // Include the stack trace of returned errors. (DEFAULT: false)
43
+ * source? : string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44
+ * filter_path?: string|array<string> , // A comma-separated list of filters used to reduce the response.
45
45
* } $params
46
46
*
47
47
* @throws MissingParameterException if a required parameter is missing
@@ -51,8 +51,9 @@ class Autoscaling extends AbstractEndpoint
51
51
*
52
52
* @return Elasticsearch|Promise
53
53
*/
54
- public function deleteAutoscalingPolicy (array $ params = [] )
54
+ public function deleteAutoscalingPolicy (? array $ params = null )
55
55
{
56
+ $ params = $ params ?? [];
56
57
$ this ->checkRequiredParameters (['name ' ], $ params );
57
58
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
58
59
$ method = 'DELETE ' ;
@@ -61,7 +62,7 @@ public function deleteAutoscalingPolicy(array $params = [])
61
62
$ headers = [
62
63
'Accept ' => 'application/json ' ,
63
64
];
64
- $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
65
+ $ request = $ this ->createRequest ($ method , $ url , $ headers );
65
66
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.delete_autoscaling_policy ' );
66
67
return $ this ->client ->sendRequest ($ request );
67
68
}
@@ -73,12 +74,12 @@ public function deleteAutoscalingPolicy(array $params = [])
73
74
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
74
75
*
75
76
* @param array{
76
- * master_timeout: time , // Timeout for processing on master node
77
- * pretty: boolean , // Pretty format the returned JSON response. (DEFAULT: false)
78
- * human: boolean , // Return human readable values for statistics. (DEFAULT: true)
79
- * error_trace: boolean , // Include the stack trace of returned errors. (DEFAULT: false)
80
- * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
81
- * filter_path: list , // A comma-separated list of filters used to reduce the response.
77
+ * master_timeout?: int|string , // Timeout for processing on master node
78
+ * pretty?: bool , // Pretty format the returned JSON response. (DEFAULT: false)
79
+ * human?: bool , // Return human readable values for statistics. (DEFAULT: true)
80
+ * error_trace?: bool , // Include the stack trace of returned errors. (DEFAULT: false)
81
+ * source? : string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
82
+ * filter_path?: string|array<string> , // A comma-separated list of filters used to reduce the response.
82
83
* } $params
83
84
*
84
85
* @throws NoNodeAvailableException if all the hosts are offline
@@ -87,16 +88,17 @@ public function deleteAutoscalingPolicy(array $params = [])
87
88
*
88
89
* @return Elasticsearch|Promise
89
90
*/
90
- public function getAutoscalingCapacity (array $ params = [] )
91
+ public function getAutoscalingCapacity (? array $ params = null )
91
92
{
93
+ $ params = $ params ?? [];
92
94
$ url = '/_autoscaling/capacity ' ;
93
95
$ method = 'GET ' ;
94
96
95
97
$ url = $ this ->addQueryString ($ url , $ params , ['master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
96
98
$ headers = [
97
99
'Accept ' => 'application/json ' ,
98
100
];
99
- $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
101
+ $ request = $ this ->createRequest ($ method , $ url , $ headers );
100
102
$ request = $ this ->addOtelAttributes ($ params , [], $ request , 'autoscaling.get_autoscaling_capacity ' );
101
103
return $ this ->client ->sendRequest ($ request );
102
104
}
@@ -109,12 +111,12 @@ public function getAutoscalingCapacity(array $params = [])
109
111
*
110
112
* @param array{
111
113
* name: string, // (REQUIRED) the name of the autoscaling policy
112
- * master_timeout: time , // Timeout for processing on master node
113
- * pretty: boolean , // Pretty format the returned JSON response. (DEFAULT: false)
114
- * human: boolean , // Return human readable values for statistics. (DEFAULT: true)
115
- * error_trace: boolean , // Include the stack trace of returned errors. (DEFAULT: false)
116
- * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
117
- * filter_path: list , // A comma-separated list of filters used to reduce the response.
114
+ * master_timeout?: int|string , // Timeout for processing on master node
115
+ * pretty?: bool , // Pretty format the returned JSON response. (DEFAULT: false)
116
+ * human?: bool , // Return human readable values for statistics. (DEFAULT: true)
117
+ * error_trace?: bool , // Include the stack trace of returned errors. (DEFAULT: false)
118
+ * source? : string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
119
+ * filter_path?: string|array<string> , // A comma-separated list of filters used to reduce the response.
118
120
* } $params
119
121
*
120
122
* @throws MissingParameterException if a required parameter is missing
@@ -124,8 +126,9 @@ public function getAutoscalingCapacity(array $params = [])
124
126
*
125
127
* @return Elasticsearch|Promise
126
128
*/
127
- public function getAutoscalingPolicy (array $ params = [] )
129
+ public function getAutoscalingPolicy (? array $ params = null )
128
130
{
131
+ $ params = $ params ?? [];
129
132
$ this ->checkRequiredParameters (['name ' ], $ params );
130
133
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
131
134
$ method = 'GET ' ;
@@ -134,7 +137,7 @@ public function getAutoscalingPolicy(array $params = [])
134
137
$ headers = [
135
138
'Accept ' => 'application/json ' ,
136
139
];
137
- $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
140
+ $ request = $ this ->createRequest ($ method , $ url , $ headers );
138
141
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.get_autoscaling_policy ' );
139
142
return $ this ->client ->sendRequest ($ request );
140
143
}
@@ -147,14 +150,14 @@ public function getAutoscalingPolicy(array $params = [])
147
150
*
148
151
* @param array{
149
152
* name: string, // (REQUIRED) the name of the autoscaling policy
150
- * master_timeout: time , // Timeout for processing on master node
151
- * timeout: time , // Timeout for acknowledgement of update from all nodes in cluster
152
- * pretty: boolean , // Pretty format the returned JSON response. (DEFAULT: false)
153
- * human: boolean , // Return human readable values for statistics. (DEFAULT: true)
154
- * error_trace: boolean , // Include the stack trace of returned errors. (DEFAULT: false)
155
- * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
156
- * filter_path: list , // A comma-separated list of filters used to reduce the response.
157
- * body: array, // (REQUIRED) the specification of the autoscaling policy
153
+ * master_timeout?: int|string , // Timeout for processing on master node
154
+ * timeout?: int|string , // Timeout for acknowledgement of update from all nodes in cluster
155
+ * pretty?: bool , // Pretty format the returned JSON response. (DEFAULT: false)
156
+ * human?: bool , // Return human readable values for statistics. (DEFAULT: true)
157
+ * error_trace?: bool , // Include the stack trace of returned errors. (DEFAULT: false)
158
+ * source? : string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
159
+ * filter_path?: string|array<string> , // A comma-separated list of filters used to reduce the response.
160
+ * body: string| array<mixed> , // (REQUIRED) the specification of the autoscaling policy. If body is a string must be a valid JSON.
158
161
* } $params
159
162
*
160
163
* @throws MissingParameterException if a required parameter is missing
@@ -164,8 +167,9 @@ public function getAutoscalingPolicy(array $params = [])
164
167
*
165
168
* @return Elasticsearch|Promise
166
169
*/
167
- public function putAutoscalingPolicy (array $ params = [] )
170
+ public function putAutoscalingPolicy (? array $ params = null )
168
171
{
172
+ $ params = $ params ?? [];
169
173
$ this ->checkRequiredParameters (['name ' ,'body ' ], $ params );
170
174
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
171
175
$ method = 'PUT ' ;
@@ -175,7 +179,7 @@ public function putAutoscalingPolicy(array $params = [])
175
179
'Accept ' => 'application/json ' ,
176
180
'Content-Type ' => 'application/json ' ,
177
181
];
178
- $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null );
182
+ $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ]);
179
183
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.put_autoscaling_policy ' );
180
184
return $ this ->client ->sendRequest ($ request );
181
185
}
0 commit comments