source: vendor/google/apiclient-services/src/Compute/Resource/RegionInstanceGroupManagers.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 48.6 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\InstanceGroupManager;
21use Google\Service\Compute\Operation;
22use Google\Service\Compute\RegionInstanceGroupManagerDeleteInstanceConfigReq;
23use Google\Service\Compute\RegionInstanceGroupManagerList;
24use Google\Service\Compute\RegionInstanceGroupManagerPatchInstanceConfigReq;
25use Google\Service\Compute\RegionInstanceGroupManagerUpdateInstanceConfigReq;
26use Google\Service\Compute\RegionInstanceGroupManagersAbandonInstancesRequest;
27use Google\Service\Compute\RegionInstanceGroupManagersApplyUpdatesRequest;
28use Google\Service\Compute\RegionInstanceGroupManagersCreateInstancesRequest;
29use Google\Service\Compute\RegionInstanceGroupManagersDeleteInstancesRequest;
30use Google\Service\Compute\RegionInstanceGroupManagersListErrorsResponse;
31use Google\Service\Compute\RegionInstanceGroupManagersListInstanceConfigsResp;
32use Google\Service\Compute\RegionInstanceGroupManagersListInstancesResponse;
33use Google\Service\Compute\RegionInstanceGroupManagersRecreateRequest;
34use Google\Service\Compute\RegionInstanceGroupManagersSetTargetPoolsRequest;
35use Google\Service\Compute\RegionInstanceGroupManagersSetTemplateRequest;
36
37/**
38 * The "regionInstanceGroupManagers" collection of methods.
39 * Typical usage is:
40 * <code>
41 * $computeService = new Google\Service\Compute(...);
42 * $regionInstanceGroupManagers = $computeService->regionInstanceGroupManagers;
43 * </code>
44 */
45class RegionInstanceGroupManagers extends \Google\Service\Resource
46{
47 /**
48 * Flags the specified instances to be immediately removed from the managed
49 * instance group. Abandoning an instance does not delete the instance, but it
50 * does remove the instance from any target pools that are applied by the
51 * managed instance group. This method reduces the targetSize of the managed
52 * instance group by the number of instances that you abandon. This operation is
53 * marked as DONE when the action is scheduled even if the instances have not
54 * yet been removed from the group. You must separately verify the status of the
55 * abandoning action with the listmanagedinstances method. If the group is part
56 * of a backend service that has enabled connection draining, it can take up to
57 * 60 seconds after the connection draining duration has elapsed before the VM
58 * instance is removed or deleted. You can specify a maximum of 1000 instances
59 * with this method per request. (regionInstanceGroupManagers.abandonInstances)
60 *
61 * @param string $project Project ID for this request.
62 * @param string $region Name of the region scoping this request.
63 * @param string $instanceGroupManager Name of the managed instance group.
64 * @param RegionInstanceGroupManagersAbandonInstancesRequest $postBody
65 * @param array $optParams Optional parameters.
66 *
67 * @opt_param string requestId An optional request ID to identify requests.
68 * Specify a unique request ID so that if you must retry your request, the
69 * server will know to ignore the request if it has already been completed. For
70 * example, consider a situation where you make an initial request and the
71 * request times out. If you make the request again with the same request ID,
72 * the server can check if original operation with the same request ID was
73 * received, and if so, will ignore the second request. This prevents clients
74 * from accidentally creating duplicate commitments. The request ID must be a
75 * valid UUID with the exception that zero UUID is not supported (
76 * 00000000-0000-0000-0000-000000000000).
77 * @return Operation
78 * @throws \Google\Service\Exception
79 */
80 public function abandonInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest $postBody, $optParams = [])
81 {
82 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
83 $params = array_merge($params, $optParams);
84 return $this->call('abandonInstances', [$params], Operation::class);
85 }
86 /**
87 * Apply updates to selected instances the managed instance group.
88 * (regionInstanceGroupManagers.applyUpdatesToInstances)
89 *
90 * @param string $project Project ID for this request.
91 * @param string $region Name of the region scoping this request, should conform
92 * to RFC1035.
93 * @param string $instanceGroupManager The name of the managed instance group,
94 * should conform to RFC1035.
95 * @param RegionInstanceGroupManagersApplyUpdatesRequest $postBody
96 * @param array $optParams Optional parameters.
97 * @return Operation
98 * @throws \Google\Service\Exception
99 */
100 public function applyUpdatesToInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest $postBody, $optParams = [])
101 {
102 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
103 $params = array_merge($params, $optParams);
104 return $this->call('applyUpdatesToInstances', [$params], Operation::class);
105 }
106 /**
107 * Creates instances with per-instance configurations in this regional managed
108 * instance group. Instances are created using the current instance template.
109 * The create instances operation is marked DONE if the createInstances request
110 * is successful. The underlying actions take additional time. You must
111 * separately verify the status of the creating or actions with the
112 * listmanagedinstances method. (regionInstanceGroupManagers.createInstances)
113 *
114 * @param string $project Project ID for this request.
115 * @param string $region The name of the region where the managed instance group
116 * is located. It should conform to RFC1035.
117 * @param string $instanceGroupManager The name of the managed instance group.
118 * It should conform to RFC1035.
119 * @param RegionInstanceGroupManagersCreateInstancesRequest $postBody
120 * @param array $optParams Optional parameters.
121 *
122 * @opt_param string requestId An optional request ID to identify requests.
123 * Specify a unique request ID so that if you must retry your request, the
124 * server will know to ignore the request if it has already been completed. For
125 * example, consider a situation where you make an initial request and the
126 * request times out. If you make the request again with the same request ID,
127 * the server can check if original operation with the same request ID was
128 * received, and if so, will ignore the second request. The request ID must be a
129 * valid UUID with the exception that zero UUID is not supported (
130 * 00000000-0000-0000-0000-000000000000).
131 * @return Operation
132 * @throws \Google\Service\Exception
133 */
134 public function createInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest $postBody, $optParams = [])
135 {
136 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
137 $params = array_merge($params, $optParams);
138 return $this->call('createInstances', [$params], Operation::class);
139 }
140 /**
141 * Deletes the specified managed instance group and all of the instances in that
142 * group. (regionInstanceGroupManagers.delete)
143 *
144 * @param string $project Project ID for this request.
145 * @param string $region Name of the region scoping this request.
146 * @param string $instanceGroupManager Name of the managed instance group to
147 * delete.
148 * @param array $optParams Optional parameters.
149 *
150 * @opt_param string requestId An optional request ID to identify requests.
151 * Specify a unique request ID so that if you must retry your request, the
152 * server will know to ignore the request if it has already been completed. For
153 * example, consider a situation where you make an initial request and the
154 * request times out. If you make the request again with the same request ID,
155 * the server can check if original operation with the same request ID was
156 * received, and if so, will ignore the second request. This prevents clients
157 * from accidentally creating duplicate commitments. The request ID must be a
158 * valid UUID with the exception that zero UUID is not supported (
159 * 00000000-0000-0000-0000-000000000000).
160 * @return Operation
161 * @throws \Google\Service\Exception
162 */
163 public function delete($project, $region, $instanceGroupManager, $optParams = [])
164 {
165 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
166 $params = array_merge($params, $optParams);
167 return $this->call('delete', [$params], Operation::class);
168 }
169 /**
170 * Flags the specified instances in the managed instance group to be immediately
171 * deleted. The instances are also removed from any target pools of which they
172 * were a member. This method reduces the targetSize of the managed instance
173 * group by the number of instances that you delete. The deleteInstances
174 * operation is marked DONE if the deleteInstances request is successful. The
175 * underlying actions take additional time. You must separately verify the
176 * status of the deleting action with the listmanagedinstances method. If the
177 * group is part of a backend service that has enabled connection draining, it
178 * can take up to 60 seconds after the connection draining duration has elapsed
179 * before the VM instance is removed or deleted. You can specify a maximum of
180 * 1000 instances with this method per request.
181 * (regionInstanceGroupManagers.deleteInstances)
182 *
183 * @param string $project Project ID for this request.
184 * @param string $region Name of the region scoping this request.
185 * @param string $instanceGroupManager Name of the managed instance group.
186 * @param RegionInstanceGroupManagersDeleteInstancesRequest $postBody
187 * @param array $optParams Optional parameters.
188 *
189 * @opt_param string requestId An optional request ID to identify requests.
190 * Specify a unique request ID so that if you must retry your request, the
191 * server will know to ignore the request if it has already been completed. For
192 * example, consider a situation where you make an initial request and the
193 * request times out. If you make the request again with the same request ID,
194 * the server can check if original operation with the same request ID was
195 * received, and if so, will ignore the second request. This prevents clients
196 * from accidentally creating duplicate commitments. The request ID must be a
197 * valid UUID with the exception that zero UUID is not supported (
198 * 00000000-0000-0000-0000-000000000000).
199 * @return Operation
200 * @throws \Google\Service\Exception
201 */
202 public function deleteInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest $postBody, $optParams = [])
203 {
204 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
205 $params = array_merge($params, $optParams);
206 return $this->call('deleteInstances', [$params], Operation::class);
207 }
208 /**
209 * Deletes selected per-instance configurations for the managed instance group.
210 * (regionInstanceGroupManagers.deletePerInstanceConfigs)
211 *
212 * @param string $project Project ID for this request.
213 * @param string $region Name of the region scoping this request, should conform
214 * to RFC1035.
215 * @param string $instanceGroupManager The name of the managed instance group.
216 * It should conform to RFC1035.
217 * @param RegionInstanceGroupManagerDeleteInstanceConfigReq $postBody
218 * @param array $optParams Optional parameters.
219 * @return Operation
220 * @throws \Google\Service\Exception
221 */
222 public function deletePerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq $postBody, $optParams = [])
223 {
224 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
225 $params = array_merge($params, $optParams);
226 return $this->call('deletePerInstanceConfigs', [$params], Operation::class);
227 }
228 /**
229 * Returns all of the details about the specified managed instance group.
230 * (regionInstanceGroupManagers.get)
231 *
232 * @param string $project Project ID for this request.
233 * @param string $region Name of the region scoping this request.
234 * @param string $instanceGroupManager Name of the managed instance group to
235 * return.
236 * @param array $optParams Optional parameters.
237 * @return InstanceGroupManager
238 * @throws \Google\Service\Exception
239 */
240 public function get($project, $region, $instanceGroupManager, $optParams = [])
241 {
242 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
243 $params = array_merge($params, $optParams);
244 return $this->call('get', [$params], InstanceGroupManager::class);
245 }
246 /**
247 * Creates a managed instance group using the information that you specify in
248 * the request. After the group is created, instances in the group are created
249 * using the specified instance template. This operation is marked as DONE when
250 * the group is created even if the instances in the group have not yet been
251 * created. You must separately verify the status of the individual instances
252 * with the listmanagedinstances method. A regional managed instance group can
253 * contain up to 2000 instances. (regionInstanceGroupManagers.insert)
254 *
255 * @param string $project Project ID for this request.
256 * @param string $region Name of the region scoping this request.
257 * @param InstanceGroupManager $postBody
258 * @param array $optParams Optional parameters.
259 *
260 * @opt_param string requestId An optional request ID to identify requests.
261 * Specify a unique request ID so that if you must retry your request, the
262 * server will know to ignore the request if it has already been completed. For
263 * example, consider a situation where you make an initial request and the
264 * request times out. If you make the request again with the same request ID,
265 * the server can check if original operation with the same request ID was
266 * received, and if so, will ignore the second request. This prevents clients
267 * from accidentally creating duplicate commitments. The request ID must be a
268 * valid UUID with the exception that zero UUID is not supported (
269 * 00000000-0000-0000-0000-000000000000).
270 * @return Operation
271 * @throws \Google\Service\Exception
272 */
273 public function insert($project, $region, InstanceGroupManager $postBody, $optParams = [])
274 {
275 $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
276 $params = array_merge($params, $optParams);
277 return $this->call('insert', [$params], Operation::class);
278 }
279 /**
280 * Retrieves the list of managed instance groups that are contained within the
281 * specified region.
282 * (regionInstanceGroupManagers.listRegionInstanceGroupManagers)
283 *
284 * @param string $project Project ID for this request.
285 * @param string $region Name of the region scoping this request.
286 * @param array $optParams Optional parameters.
287 *
288 * @opt_param string filter A filter expression that filters resources listed in
289 * the response. Most Compute resources support two types of filter expressions:
290 * expressions that support regular expressions and expressions that follow API
291 * improvement proposal AIP-160. These two types of filter expressions cannot be
292 * mixed in one request. If you want to use AIP-160, your expression must
293 * specify the field name, an operator, and the value that you want to use for
294 * filtering. The value must be a string, a number, or a boolean. The operator
295 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
296 * are filtering Compute Engine instances, you can exclude instances named
297 * `example-instance` by specifying `name != example-instance`. The `:*`
298 * comparison can be used to test whether a key has been defined. For example,
299 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
300 * also filter nested fields. For example, you could specify
301 * `scheduling.automaticRestart = false` to include instances only if they are
302 * not scheduled for automatic restarts. You can use filtering on nested fields
303 * to filter based on resource labels. To filter on multiple expressions,
304 * provide each separate expression within parentheses. For example: ```
305 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
306 * default, each expression is an `AND` expression. However, you can include
307 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
308 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
309 * (scheduling.automaticRestart = true) ``` If you want to use a regular
310 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
311 * single un-parenthesized expression with or without quotes or against multiple
312 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
313 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
314 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
315 * interpreted as a regular expression using Google RE2 library syntax. The
316 * literal value must match the entire field. For example, to filter for
317 * instances that do not end with name "instance", you would use `name ne
318 * .*instance`. You cannot combine constraints on multiple fields using regular
319 * expressions.
320 * @opt_param string maxResults The maximum number of results per page that
321 * should be returned. If the number of available results is larger than
322 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
323 * get the next page of results in subsequent list requests. Acceptable values
324 * are `0` to `500`, inclusive. (Default: `500`)
325 * @opt_param string orderBy Sorts list results by a certain order. By default,
326 * results are returned in alphanumerical order based on the resource name. You
327 * can also sort results in descending order based on the creation timestamp
328 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
329 * `creationTimestamp` field in reverse chronological order (newest result
330 * first). Use this to sort resources like operations so that the newest
331 * operation is returned first. Currently, only sorting by `name` or
332 * `creationTimestamp desc` is supported.
333 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
334 * the `nextPageToken` returned by a previous list request to get the next page
335 * of results.
336 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
337 * which provides partial results in case of failure. The default value is
338 * false. For example, when partial success behavior is enabled, aggregatedList
339 * for a single zone scope either returns all resources in the zone or no
340 * resources, with an error code.
341 * @return RegionInstanceGroupManagerList
342 * @throws \Google\Service\Exception
343 */
344 public function listRegionInstanceGroupManagers($project, $region, $optParams = [])
345 {
346 $params = ['project' => $project, 'region' => $region];
347 $params = array_merge($params, $optParams);
348 return $this->call('list', [$params], RegionInstanceGroupManagerList::class);
349 }
350 /**
351 * Lists all errors thrown by actions on instances for a given regional managed
352 * instance group. The filter and orderBy query parameters are not supported.
353 * (regionInstanceGroupManagers.listErrors)
354 *
355 * @param string $project Project ID for this request.
356 * @param string $region Name of the region scoping this request. This should
357 * conform to RFC1035.
358 * @param string $instanceGroupManager The name of the managed instance group.
359 * It must be a string that meets the requirements in RFC1035, or an unsigned
360 * long integer: must match regexp pattern:
361 * (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
362 * @param array $optParams Optional parameters.
363 *
364 * @opt_param string filter A filter expression that filters resources listed in
365 * the response. Most Compute resources support two types of filter expressions:
366 * expressions that support regular expressions and expressions that follow API
367 * improvement proposal AIP-160. These two types of filter expressions cannot be
368 * mixed in one request. If you want to use AIP-160, your expression must
369 * specify the field name, an operator, and the value that you want to use for
370 * filtering. The value must be a string, a number, or a boolean. The operator
371 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
372 * are filtering Compute Engine instances, you can exclude instances named
373 * `example-instance` by specifying `name != example-instance`. The `:*`
374 * comparison can be used to test whether a key has been defined. For example,
375 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
376 * also filter nested fields. For example, you could specify
377 * `scheduling.automaticRestart = false` to include instances only if they are
378 * not scheduled for automatic restarts. You can use filtering on nested fields
379 * to filter based on resource labels. To filter on multiple expressions,
380 * provide each separate expression within parentheses. For example: ```
381 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
382 * default, each expression is an `AND` expression. However, you can include
383 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
384 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
385 * (scheduling.automaticRestart = true) ``` If you want to use a regular
386 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
387 * single un-parenthesized expression with or without quotes or against multiple
388 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
389 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
390 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
391 * interpreted as a regular expression using Google RE2 library syntax. The
392 * literal value must match the entire field. For example, to filter for
393 * instances that do not end with name "instance", you would use `name ne
394 * .*instance`. You cannot combine constraints on multiple fields using regular
395 * expressions.
396 * @opt_param string maxResults The maximum number of results per page that
397 * should be returned. If the number of available results is larger than
398 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
399 * get the next page of results in subsequent list requests. Acceptable values
400 * are `0` to `500`, inclusive. (Default: `500`)
401 * @opt_param string orderBy Sorts list results by a certain order. By default,
402 * results are returned in alphanumerical order based on the resource name. You
403 * can also sort results in descending order based on the creation timestamp
404 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
405 * `creationTimestamp` field in reverse chronological order (newest result
406 * first). Use this to sort resources like operations so that the newest
407 * operation is returned first. Currently, only sorting by `name` or
408 * `creationTimestamp desc` is supported.
409 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
410 * the `nextPageToken` returned by a previous list request to get the next page
411 * of results.
412 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
413 * which provides partial results in case of failure. The default value is
414 * false. For example, when partial success behavior is enabled, aggregatedList
415 * for a single zone scope either returns all resources in the zone or no
416 * resources, with an error code.
417 * @return RegionInstanceGroupManagersListErrorsResponse
418 * @throws \Google\Service\Exception
419 */
420 public function listErrors($project, $region, $instanceGroupManager, $optParams = [])
421 {
422 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
423 $params = array_merge($params, $optParams);
424 return $this->call('listErrors', [$params], RegionInstanceGroupManagersListErrorsResponse::class);
425 }
426 /**
427 * Lists the instances in the managed instance group and instances that are
428 * scheduled to be created. The list includes any current actions that the group
429 * has scheduled for its instances. The orderBy query parameter is not
430 * supported. The `pageToken` query parameter is supported only if the group's
431 * `listManagedInstancesResults` field is set to `PAGINATED`.
432 * (regionInstanceGroupManagers.listManagedInstances)
433 *
434 * @param string $project Project ID for this request.
435 * @param string $region Name of the region scoping this request.
436 * @param string $instanceGroupManager The name of the managed instance group.
437 * @param array $optParams Optional parameters.
438 *
439 * @opt_param string filter A filter expression that filters resources listed in
440 * the response. Most Compute resources support two types of filter expressions:
441 * expressions that support regular expressions and expressions that follow API
442 * improvement proposal AIP-160. These two types of filter expressions cannot be
443 * mixed in one request. If you want to use AIP-160, your expression must
444 * specify the field name, an operator, and the value that you want to use for
445 * filtering. The value must be a string, a number, or a boolean. The operator
446 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
447 * are filtering Compute Engine instances, you can exclude instances named
448 * `example-instance` by specifying `name != example-instance`. The `:*`
449 * comparison can be used to test whether a key has been defined. For example,
450 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
451 * also filter nested fields. For example, you could specify
452 * `scheduling.automaticRestart = false` to include instances only if they are
453 * not scheduled for automatic restarts. You can use filtering on nested fields
454 * to filter based on resource labels. To filter on multiple expressions,
455 * provide each separate expression within parentheses. For example: ```
456 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
457 * default, each expression is an `AND` expression. However, you can include
458 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
459 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
460 * (scheduling.automaticRestart = true) ``` If you want to use a regular
461 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
462 * single un-parenthesized expression with or without quotes or against multiple
463 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
464 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
465 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
466 * interpreted as a regular expression using Google RE2 library syntax. The
467 * literal value must match the entire field. For example, to filter for
468 * instances that do not end with name "instance", you would use `name ne
469 * .*instance`. You cannot combine constraints on multiple fields using regular
470 * expressions.
471 * @opt_param string maxResults The maximum number of results per page that
472 * should be returned. If the number of available results is larger than
473 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
474 * get the next page of results in subsequent list requests. Acceptable values
475 * are `0` to `500`, inclusive. (Default: `500`)
476 * @opt_param string orderBy Sorts list results by a certain order. By default,
477 * results are returned in alphanumerical order based on the resource name. You
478 * can also sort results in descending order based on the creation timestamp
479 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
480 * `creationTimestamp` field in reverse chronological order (newest result
481 * first). Use this to sort resources like operations so that the newest
482 * operation is returned first. Currently, only sorting by `name` or
483 * `creationTimestamp desc` is supported.
484 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
485 * the `nextPageToken` returned by a previous list request to get the next page
486 * of results.
487 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
488 * which provides partial results in case of failure. The default value is
489 * false. For example, when partial success behavior is enabled, aggregatedList
490 * for a single zone scope either returns all resources in the zone or no
491 * resources, with an error code.
492 * @return RegionInstanceGroupManagersListInstancesResponse
493 * @throws \Google\Service\Exception
494 */
495 public function listManagedInstances($project, $region, $instanceGroupManager, $optParams = [])
496 {
497 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
498 $params = array_merge($params, $optParams);
499 return $this->call('listManagedInstances', [$params], RegionInstanceGroupManagersListInstancesResponse::class);
500 }
501 /**
502 * Lists all of the per-instance configurations defined for the managed instance
503 * group. The orderBy query parameter is not supported.
504 * (regionInstanceGroupManagers.listPerInstanceConfigs)
505 *
506 * @param string $project Project ID for this request.
507 * @param string $region Name of the region scoping this request, should conform
508 * to RFC1035.
509 * @param string $instanceGroupManager The name of the managed instance group.
510 * It should conform to RFC1035.
511 * @param array $optParams Optional parameters.
512 *
513 * @opt_param string filter A filter expression that filters resources listed in
514 * the response. Most Compute resources support two types of filter expressions:
515 * expressions that support regular expressions and expressions that follow API
516 * improvement proposal AIP-160. These two types of filter expressions cannot be
517 * mixed in one request. If you want to use AIP-160, your expression must
518 * specify the field name, an operator, and the value that you want to use for
519 * filtering. The value must be a string, a number, or a boolean. The operator
520 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
521 * are filtering Compute Engine instances, you can exclude instances named
522 * `example-instance` by specifying `name != example-instance`. The `:*`
523 * comparison can be used to test whether a key has been defined. For example,
524 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
525 * also filter nested fields. For example, you could specify
526 * `scheduling.automaticRestart = false` to include instances only if they are
527 * not scheduled for automatic restarts. You can use filtering on nested fields
528 * to filter based on resource labels. To filter on multiple expressions,
529 * provide each separate expression within parentheses. For example: ```
530 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
531 * default, each expression is an `AND` expression. However, you can include
532 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
533 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
534 * (scheduling.automaticRestart = true) ``` If you want to use a regular
535 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
536 * single un-parenthesized expression with or without quotes or against multiple
537 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
538 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
539 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
540 * interpreted as a regular expression using Google RE2 library syntax. The
541 * literal value must match the entire field. For example, to filter for
542 * instances that do not end with name "instance", you would use `name ne
543 * .*instance`. You cannot combine constraints on multiple fields using regular
544 * expressions.
545 * @opt_param string maxResults The maximum number of results per page that
546 * should be returned. If the number of available results is larger than
547 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
548 * get the next page of results in subsequent list requests. Acceptable values
549 * are `0` to `500`, inclusive. (Default: `500`)
550 * @opt_param string orderBy Sorts list results by a certain order. By default,
551 * results are returned in alphanumerical order based on the resource name. You
552 * can also sort results in descending order based on the creation timestamp
553 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
554 * `creationTimestamp` field in reverse chronological order (newest result
555 * first). Use this to sort resources like operations so that the newest
556 * operation is returned first. Currently, only sorting by `name` or
557 * `creationTimestamp desc` is supported.
558 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
559 * the `nextPageToken` returned by a previous list request to get the next page
560 * of results.
561 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
562 * which provides partial results in case of failure. The default value is
563 * false. For example, when partial success behavior is enabled, aggregatedList
564 * for a single zone scope either returns all resources in the zone or no
565 * resources, with an error code.
566 * @return RegionInstanceGroupManagersListInstanceConfigsResp
567 * @throws \Google\Service\Exception
568 */
569 public function listPerInstanceConfigs($project, $region, $instanceGroupManager, $optParams = [])
570 {
571 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
572 $params = array_merge($params, $optParams);
573 return $this->call('listPerInstanceConfigs', [$params], RegionInstanceGroupManagersListInstanceConfigsResp::class);
574 }
575 /**
576 * Updates a managed instance group using the information that you specify in
577 * the request. This operation is marked as DONE when the group is patched even
578 * if the instances in the group are still in the process of being patched. You
579 * must separately verify the status of the individual instances with the
580 * listmanagedinstances method. This method supports PATCH semantics and uses
581 * the JSON merge patch format and processing rules. If you update your group to
582 * specify a new template or instance configuration, it's possible that your
583 * intended specification for each VM in the group is different from the current
584 * state of that VM. To learn how to apply an updated configuration to the VMs
585 * in a MIG, see Updating instances in a MIG.
586 * (regionInstanceGroupManagers.patch)
587 *
588 * @param string $project Project ID for this request.
589 * @param string $region Name of the region scoping this request.
590 * @param string $instanceGroupManager The name of the instance group manager.
591 * @param InstanceGroupManager $postBody
592 * @param array $optParams Optional parameters.
593 *
594 * @opt_param string requestId An optional request ID to identify requests.
595 * Specify a unique request ID so that if you must retry your request, the
596 * server will know to ignore the request if it has already been completed. For
597 * example, consider a situation where you make an initial request and the
598 * request times out. If you make the request again with the same request ID,
599 * the server can check if original operation with the same request ID was
600 * received, and if so, will ignore the second request. This prevents clients
601 * from accidentally creating duplicate commitments. The request ID must be a
602 * valid UUID with the exception that zero UUID is not supported (
603 * 00000000-0000-0000-0000-000000000000).
604 * @return Operation
605 * @throws \Google\Service\Exception
606 */
607 public function patch($project, $region, $instanceGroupManager, InstanceGroupManager $postBody, $optParams = [])
608 {
609 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
610 $params = array_merge($params, $optParams);
611 return $this->call('patch', [$params], Operation::class);
612 }
613 /**
614 * Inserts or patches per-instance configurations for the managed instance
615 * group. perInstanceConfig.name serves as a key used to distinguish whether to
616 * perform insert or patch.
617 * (regionInstanceGroupManagers.patchPerInstanceConfigs)
618 *
619 * @param string $project Project ID for this request.
620 * @param string $region Name of the region scoping this request, should conform
621 * to RFC1035.
622 * @param string $instanceGroupManager The name of the managed instance group.
623 * It should conform to RFC1035.
624 * @param RegionInstanceGroupManagerPatchInstanceConfigReq $postBody
625 * @param array $optParams Optional parameters.
626 *
627 * @opt_param string requestId An optional request ID to identify requests.
628 * Specify a unique request ID so that if you must retry your request, the
629 * server will know to ignore the request if it has already been completed. For
630 * example, consider a situation where you make an initial request and the
631 * request times out. If you make the request again with the same request ID,
632 * the server can check if original operation with the same request ID was
633 * received, and if so, will ignore the second request. This prevents clients
634 * from accidentally creating duplicate commitments. The request ID must be a
635 * valid UUID with the exception that zero UUID is not supported (
636 * 00000000-0000-0000-0000-000000000000).
637 * @return Operation
638 * @throws \Google\Service\Exception
639 */
640 public function patchPerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq $postBody, $optParams = [])
641 {
642 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
643 $params = array_merge($params, $optParams);
644 return $this->call('patchPerInstanceConfigs', [$params], Operation::class);
645 }
646 /**
647 * Flags the specified VM instances in the managed instance group to be
648 * immediately recreated. Each instance is recreated using the group's current
649 * configuration. This operation is marked as DONE when the flag is set even if
650 * the instances have not yet been recreated. You must separately verify the
651 * status of each instance by checking its currentAction field; for more
652 * information, see Checking the status of managed instances. If the group is
653 * part of a backend service that has enabled connection draining, it can take
654 * up to 60 seconds after the connection draining duration has elapsed before
655 * the VM instance is removed or deleted. You can specify a maximum of 1000
656 * instances with this method per request.
657 * (regionInstanceGroupManagers.recreateInstances)
658 *
659 * @param string $project Project ID for this request.
660 * @param string $region Name of the region scoping this request.
661 * @param string $instanceGroupManager Name of the managed instance group.
662 * @param RegionInstanceGroupManagersRecreateRequest $postBody
663 * @param array $optParams Optional parameters.
664 *
665 * @opt_param string requestId An optional request ID to identify requests.
666 * Specify a unique request ID so that if you must retry your request, the
667 * server will know to ignore the request if it has already been completed. For
668 * example, consider a situation where you make an initial request and the
669 * request times out. If you make the request again with the same request ID,
670 * the server can check if original operation with the same request ID was
671 * received, and if so, will ignore the second request. This prevents clients
672 * from accidentally creating duplicate commitments. The request ID must be a
673 * valid UUID with the exception that zero UUID is not supported (
674 * 00000000-0000-0000-0000-000000000000).
675 * @return Operation
676 * @throws \Google\Service\Exception
677 */
678 public function recreateInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersRecreateRequest $postBody, $optParams = [])
679 {
680 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
681 $params = array_merge($params, $optParams);
682 return $this->call('recreateInstances', [$params], Operation::class);
683 }
684 /**
685 * Changes the intended size of the managed instance group. If you increase the
686 * size, the group creates new instances using the current instance template. If
687 * you decrease the size, the group deletes one or more instances. The resize
688 * operation is marked DONE if the resize request is successful. The underlying
689 * actions take additional time. You must separately verify the status of the
690 * creating or deleting actions with the listmanagedinstances method. If the
691 * group is part of a backend service that has enabled connection draining, it
692 * can take up to 60 seconds after the connection draining duration has elapsed
693 * before the VM instance is removed or deleted.
694 * (regionInstanceGroupManagers.resize)
695 *
696 * @param string $project Project ID for this request.
697 * @param string $region Name of the region scoping this request.
698 * @param string $instanceGroupManager Name of the managed instance group.
699 * @param int $size Number of instances that should exist in this instance group
700 * manager.
701 * @param array $optParams Optional parameters.
702 *
703 * @opt_param string requestId An optional request ID to identify requests.
704 * Specify a unique request ID so that if you must retry your request, the
705 * server will know to ignore the request if it has already been completed. For
706 * example, consider a situation where you make an initial request and the
707 * request times out. If you make the request again with the same request ID,
708 * the server can check if original operation with the same request ID was
709 * received, and if so, will ignore the second request. This prevents clients
710 * from accidentally creating duplicate commitments. The request ID must be a
711 * valid UUID with the exception that zero UUID is not supported (
712 * 00000000-0000-0000-0000-000000000000).
713 * @return Operation
714 * @throws \Google\Service\Exception
715 */
716 public function resize($project, $region, $instanceGroupManager, $size, $optParams = [])
717 {
718 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'size' => $size];
719 $params = array_merge($params, $optParams);
720 return $this->call('resize', [$params], Operation::class);
721 }
722 /**
723 * Sets the instance template to use when creating new instances or recreating
724 * instances in this group. Existing instances are not affected.
725 * (regionInstanceGroupManagers.setInstanceTemplate)
726 *
727 * @param string $project Project ID for this request.
728 * @param string $region Name of the region scoping this request.
729 * @param string $instanceGroupManager The name of the managed instance group.
730 * @param RegionInstanceGroupManagersSetTemplateRequest $postBody
731 * @param array $optParams Optional parameters.
732 *
733 * @opt_param string requestId An optional request ID to identify requests.
734 * Specify a unique request ID so that if you must retry your request, the
735 * server will know to ignore the request if it has already been completed. For
736 * example, consider a situation where you make an initial request and the
737 * request times out. If you make the request again with the same request ID,
738 * the server can check if original operation with the same request ID was
739 * received, and if so, will ignore the second request. This prevents clients
740 * from accidentally creating duplicate commitments. The request ID must be a
741 * valid UUID with the exception that zero UUID is not supported (
742 * 00000000-0000-0000-0000-000000000000).
743 * @return Operation
744 * @throws \Google\Service\Exception
745 */
746 public function setInstanceTemplate($project, $region, $instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest $postBody, $optParams = [])
747 {
748 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
749 $params = array_merge($params, $optParams);
750 return $this->call('setInstanceTemplate', [$params], Operation::class);
751 }
752 /**
753 * Modifies the target pools to which all new instances in this group are
754 * assigned. Existing instances in the group are not affected.
755 * (regionInstanceGroupManagers.setTargetPools)
756 *
757 * @param string $project Project ID for this request.
758 * @param string $region Name of the region scoping this request.
759 * @param string $instanceGroupManager Name of the managed instance group.
760 * @param RegionInstanceGroupManagersSetTargetPoolsRequest $postBody
761 * @param array $optParams Optional parameters.
762 *
763 * @opt_param string requestId An optional request ID to identify requests.
764 * Specify a unique request ID so that if you must retry your request, the
765 * server will know to ignore the request if it has already been completed. For
766 * example, consider a situation where you make an initial request and the
767 * request times out. If you make the request again with the same request ID,
768 * the server can check if original operation with the same request ID was
769 * received, and if so, will ignore the second request. This prevents clients
770 * from accidentally creating duplicate commitments. The request ID must be a
771 * valid UUID with the exception that zero UUID is not supported (
772 * 00000000-0000-0000-0000-000000000000).
773 * @return Operation
774 * @throws \Google\Service\Exception
775 */
776 public function setTargetPools($project, $region, $instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest $postBody, $optParams = [])
777 {
778 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
779 $params = array_merge($params, $optParams);
780 return $this->call('setTargetPools', [$params], Operation::class);
781 }
782 /**
783 * Inserts or updates per-instance configurations for the managed instance
784 * group. perInstanceConfig.name serves as a key used to distinguish whether to
785 * perform insert or patch.
786 * (regionInstanceGroupManagers.updatePerInstanceConfigs)
787 *
788 * @param string $project Project ID for this request.
789 * @param string $region Name of the region scoping this request, should conform
790 * to RFC1035.
791 * @param string $instanceGroupManager The name of the managed instance group.
792 * It should conform to RFC1035.
793 * @param RegionInstanceGroupManagerUpdateInstanceConfigReq $postBody
794 * @param array $optParams Optional parameters.
795 *
796 * @opt_param string requestId An optional request ID to identify requests.
797 * Specify a unique request ID so that if you must retry your request, the
798 * server will know to ignore the request if it has already been completed. For
799 * example, consider a situation where you make an initial request and the
800 * request times out. If you make the request again with the same request ID,
801 * the server can check if original operation with the same request ID was
802 * received, and if so, will ignore the second request. This prevents clients
803 * from accidentally creating duplicate commitments. The request ID must be a
804 * valid UUID with the exception that zero UUID is not supported (
805 * 00000000-0000-0000-0000-000000000000).
806 * @return Operation
807 * @throws \Google\Service\Exception
808 */
809 public function updatePerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq $postBody, $optParams = [])
810 {
811 $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
812 $params = array_merge($params, $optParams);
813 return $this->call('updatePerInstanceConfigs', [$params], Operation::class);
814 }
815}
816
817// Adding a class alias for backwards compatibility with the previous class name.
818class_alias(RegionInstanceGroupManagers::class, 'Google_Service_Compute_Resource_RegionInstanceGroupManagers');
Note: See TracBrowser for help on using the repository browser.