@@ -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?: 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 , // A comma-separated list of filters used to reduce the response.
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.
45
45
* } $params
46
46
*
47
47
* @throws MissingParameterException if a required parameter is missing
@@ -51,9 +51,8 @@ class Autoscaling extends AbstractEndpoint
51
51
*
52
52
* @return Elasticsearch|Promise
53
53
*/
54
- public function deleteAutoscalingPolicy (? array $ params = null )
54
+ public function deleteAutoscalingPolicy (array $ params = [] )
55
55
{
56
- $ params = $ params ?? [];
57
56
$ this ->checkRequiredParameters (['name ' ], $ params );
58
57
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
59
58
$ method = 'DELETE ' ;
@@ -62,7 +61,7 @@ public function deleteAutoscalingPolicy(?array $params = null)
62
61
$ headers = [
63
62
'Accept ' => 'application/json ' ,
64
63
];
65
- $ request = $ this ->createRequest ($ method , $ url , $ headers );
64
+ $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
66
65
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.delete_autoscaling_policy ' );
67
66
return $ this ->client ->sendRequest ($ request );
68
67
}
@@ -74,12 +73,12 @@ public function deleteAutoscalingPolicy(?array $params = null)
74
73
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
75
74
*
76
75
* @param array{
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 , // A comma-separated list of filters used to reduce the response.
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.
83
82
* } $params
84
83
*
85
84
* @throws NoNodeAvailableException if all the hosts are offline
@@ -88,17 +87,16 @@ public function deleteAutoscalingPolicy(?array $params = null)
88
87
*
89
88
* @return Elasticsearch|Promise
90
89
*/
91
- public function getAutoscalingCapacity (? array $ params = null )
90
+ public function getAutoscalingCapacity (array $ params = [] )
92
91
{
93
- $ params = $ params ?? [];
94
92
$ url = '/_autoscaling/capacity ' ;
95
93
$ method = 'GET ' ;
96
94
97
95
$ url = $ this ->addQueryString ($ url , $ params , ['master_timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
98
96
$ headers = [
99
97
'Accept ' => 'application/json ' ,
100
98
];
101
- $ request = $ this ->createRequest ($ method , $ url , $ headers );
99
+ $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
102
100
$ request = $ this ->addOtelAttributes ($ params , [], $ request , 'autoscaling.get_autoscaling_capacity ' );
103
101
return $ this ->client ->sendRequest ($ request );
104
102
}
@@ -111,12 +109,12 @@ public function getAutoscalingCapacity(?array $params = null)
111
109
*
112
110
* @param array{
113
111
* name: string, // (REQUIRED) the name of the autoscaling policy
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 , // A comma-separated list of filters used to reduce the response.
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.
120
118
* } $params
121
119
*
122
120
* @throws MissingParameterException if a required parameter is missing
@@ -126,9 +124,8 @@ public function getAutoscalingCapacity(?array $params = null)
126
124
*
127
125
* @return Elasticsearch|Promise
128
126
*/
129
- public function getAutoscalingPolicy (? array $ params = null )
127
+ public function getAutoscalingPolicy (array $ params = [] )
130
128
{
131
- $ params = $ params ?? [];
132
129
$ this ->checkRequiredParameters (['name ' ], $ params );
133
130
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
134
131
$ method = 'GET ' ;
@@ -137,7 +134,7 @@ public function getAutoscalingPolicy(?array $params = null)
137
134
$ headers = [
138
135
'Accept ' => 'application/json ' ,
139
136
];
140
- $ request = $ this ->createRequest ($ method , $ url , $ headers );
137
+ $ request = $ this ->createRequest ($ method , $ url , $ headers, $ params [ ' body ' ] ?? null );
141
138
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.get_autoscaling_policy ' );
142
139
return $ this ->client ->sendRequest ($ request );
143
140
}
@@ -150,14 +147,14 @@ public function getAutoscalingPolicy(?array $params = null)
150
147
*
151
148
* @param array{
152
149
* name: string, // (REQUIRED) the name 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 , // A comma-separated list of filters used to reduce the response.
160
- * body: string| array, // (REQUIRED) the specification of the autoscaling policy. If body is a string must be a valid JSON.
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
161
158
* } $params
162
159
*
163
160
* @throws MissingParameterException if a required parameter is missing
@@ -167,9 +164,8 @@ public function getAutoscalingPolicy(?array $params = null)
167
164
*
168
165
* @return Elasticsearch|Promise
169
166
*/
170
- public function putAutoscalingPolicy (? array $ params = null )
167
+ public function putAutoscalingPolicy (array $ params = [] )
171
168
{
172
- $ params = $ params ?? [];
173
169
$ this ->checkRequiredParameters (['name ' ,'body ' ], $ params );
174
170
$ url = '/_autoscaling/policy/ ' . $ this ->encode ($ params ['name ' ]);
175
171
$ method = 'PUT ' ;
@@ -179,7 +175,7 @@ public function putAutoscalingPolicy(?array $params = null)
179
175
'Accept ' => 'application/json ' ,
180
176
'Content-Type ' => 'application/json ' ,
181
177
];
182
- $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ]);
178
+ $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null );
183
179
$ request = $ this ->addOtelAttributes ($ params , ['name ' ], $ request , 'autoscaling.put_autoscaling_policy ' );
184
180
return $ this ->client ->sendRequest ($ request );
185
181
}
0 commit comments