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   */
79  public function abandonInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest $postBody, $optParams = [])
80  {
81    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
82    $params = array_merge($params, $optParams);
83    return $this->call('abandonInstances', [$params], Operation::class);
84  }
85  /**
86   * Apply updates to selected instances the managed instance group.
87   * (regionInstanceGroupManagers.applyUpdatesToInstances)
88   *
89   * @param string $project Project ID for this request.
90   * @param string $region Name of the region scoping this request, should conform
91   * to RFC1035.
92   * @param string $instanceGroupManager The name of the managed instance group,
93   * should conform to RFC1035.
94   * @param RegionInstanceGroupManagersApplyUpdatesRequest $postBody
95   * @param array $optParams Optional parameters.
96   * @return Operation
97   */
98  public function applyUpdatesToInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest $postBody, $optParams = [])
99  {
100    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
101    $params = array_merge($params, $optParams);
102    return $this->call('applyUpdatesToInstances', [$params], Operation::class);
103  }
104  /**
105   * Creates instances with per-instance configurations in this regional managed
106   * instance group. Instances are created using the current instance template.
107   * The create instances operation is marked DONE if the createInstances request
108   * is successful. The underlying actions take additional time. You must
109   * separately verify the status of the creating or actions with the
110   * listmanagedinstances method. (regionInstanceGroupManagers.createInstances)
111   *
112   * @param string $project Project ID for this request.
113   * @param string $region The name of the region where the managed instance group
114   * is located. It should conform to RFC1035.
115   * @param string $instanceGroupManager The name of the managed instance group.
116   * It should conform to RFC1035.
117   * @param RegionInstanceGroupManagersCreateInstancesRequest $postBody
118   * @param array $optParams Optional parameters.
119   *
120   * @opt_param string requestId An optional request ID to identify requests.
121   * Specify a unique request ID so that if you must retry your request, the
122   * server will know to ignore the request if it has already been completed. For
123   * example, consider a situation where you make an initial request and the
124   * request times out. If you make the request again with the same request ID,
125   * the server can check if original operation with the same request ID was
126   * received, and if so, will ignore the second request. The request ID must be a
127   * valid UUID with the exception that zero UUID is not supported (
128   * 00000000-0000-0000-0000-000000000000).
129   * @return Operation
130   */
131  public function createInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest $postBody, $optParams = [])
132  {
133    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
134    $params = array_merge($params, $optParams);
135    return $this->call('createInstances', [$params], Operation::class);
136  }
137  /**
138   * Deletes the specified managed instance group and all of the instances in that
139   * group. (regionInstanceGroupManagers.delete)
140   *
141   * @param string $project Project ID for this request.
142   * @param string $region Name of the region scoping this request.
143   * @param string $instanceGroupManager Name of the managed instance group to
144   * delete.
145   * @param array $optParams Optional parameters.
146   *
147   * @opt_param string requestId An optional request ID to identify requests.
148   * Specify a unique request ID so that if you must retry your request, the
149   * server will know to ignore the request if it has already been completed. For
150   * example, consider a situation where you make an initial request and the
151   * request times out. If you make the request again with the same request ID,
152   * the server can check if original operation with the same request ID was
153   * received, and if so, will ignore the second request. This prevents clients
154   * from accidentally creating duplicate commitments. The request ID must be a
155   * valid UUID with the exception that zero UUID is not supported (
156   * 00000000-0000-0000-0000-000000000000).
157   * @return Operation
158   */
159  public function delete($project, $region, $instanceGroupManager, $optParams = [])
160  {
161    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
162    $params = array_merge($params, $optParams);
163    return $this->call('delete', [$params], Operation::class);
164  }
165  /**
166   * Flags the specified instances in the managed instance group to be immediately
167   * deleted. The instances are also removed from any target pools of which they
168   * were a member. This method reduces the targetSize of the managed instance
169   * group by the number of instances that you delete. The deleteInstances
170   * operation is marked DONE if the deleteInstances request is successful. The
171   * underlying actions take additional time. You must separately verify the
172   * status of the deleting action with the listmanagedinstances method. If the
173   * group is part of a backend service that has enabled connection draining, it
174   * can take up to 60 seconds after the connection draining duration has elapsed
175   * before the VM instance is removed or deleted. You can specify a maximum of
176   * 1000 instances with this method per request.
177   * (regionInstanceGroupManagers.deleteInstances)
178   *
179   * @param string $project Project ID for this request.
180   * @param string $region Name of the region scoping this request.
181   * @param string $instanceGroupManager Name of the managed instance group.
182   * @param RegionInstanceGroupManagersDeleteInstancesRequest $postBody
183   * @param array $optParams Optional parameters.
184   *
185   * @opt_param string requestId An optional request ID to identify requests.
186   * Specify a unique request ID so that if you must retry your request, the
187   * server will know to ignore the request if it has already been completed. For
188   * example, consider a situation where you make an initial request and the
189   * request times out. If you make the request again with the same request ID,
190   * the server can check if original operation with the same request ID was
191   * received, and if so, will ignore the second request. This prevents clients
192   * from accidentally creating duplicate commitments. The request ID must be a
193   * valid UUID with the exception that zero UUID is not supported (
194   * 00000000-0000-0000-0000-000000000000).
195   * @return Operation
196   */
197  public function deleteInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest $postBody, $optParams = [])
198  {
199    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
200    $params = array_merge($params, $optParams);
201    return $this->call('deleteInstances', [$params], Operation::class);
202  }
203  /**
204   * Deletes selected per-instance configurations for the managed instance group.
205   * (regionInstanceGroupManagers.deletePerInstanceConfigs)
206   *
207   * @param string $project Project ID for this request.
208   * @param string $region Name of the region scoping this request, should conform
209   * to RFC1035.
210   * @param string $instanceGroupManager The name of the managed instance group.
211   * It should conform to RFC1035.
212   * @param RegionInstanceGroupManagerDeleteInstanceConfigReq $postBody
213   * @param array $optParams Optional parameters.
214   * @return Operation
215   */
216  public function deletePerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq $postBody, $optParams = [])
217  {
218    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
219    $params = array_merge($params, $optParams);
220    return $this->call('deletePerInstanceConfigs', [$params], Operation::class);
221  }
222  /**
223   * Returns all of the details about the specified managed instance group.
224   * (regionInstanceGroupManagers.get)
225   *
226   * @param string $project Project ID for this request.
227   * @param string $region Name of the region scoping this request.
228   * @param string $instanceGroupManager Name of the managed instance group to
229   * return.
230   * @param array $optParams Optional parameters.
231   * @return InstanceGroupManager
232   */
233  public function get($project, $region, $instanceGroupManager, $optParams = [])
234  {
235    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
236    $params = array_merge($params, $optParams);
237    return $this->call('get', [$params], InstanceGroupManager::class);
238  }
239  /**
240   * Creates a managed instance group using the information that you specify in
241   * the request. After the group is created, instances in the group are created
242   * using the specified instance template. This operation is marked as DONE when
243   * the group is created even if the instances in the group have not yet been
244   * created. You must separately verify the status of the individual instances
245   * with the listmanagedinstances method. A regional managed instance group can
246   * contain up to 2000 instances. (regionInstanceGroupManagers.insert)
247   *
248   * @param string $project Project ID for this request.
249   * @param string $region Name of the region scoping this request.
250   * @param InstanceGroupManager $postBody
251   * @param array $optParams Optional parameters.
252   *
253   * @opt_param string requestId An optional request ID to identify requests.
254   * Specify a unique request ID so that if you must retry your request, the
255   * server will know to ignore the request if it has already been completed. For
256   * example, consider a situation where you make an initial request and the
257   * request times out. If you make the request again with the same request ID,
258   * the server can check if original operation with the same request ID was
259   * received, and if so, will ignore the second request. This prevents clients
260   * from accidentally creating duplicate commitments. The request ID must be a
261   * valid UUID with the exception that zero UUID is not supported (
262   * 00000000-0000-0000-0000-000000000000).
263   * @return Operation
264   */
265  public function insert($project, $region, InstanceGroupManager $postBody, $optParams = [])
266  {
267    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
268    $params = array_merge($params, $optParams);
269    return $this->call('insert', [$params], Operation::class);
270  }
271  /**
272   * Retrieves the list of managed instance groups that are contained within the
273   * specified region.
274   * (regionInstanceGroupManagers.listRegionInstanceGroupManagers)
275   *
276   * @param string $project Project ID for this request.
277   * @param string $region Name of the region scoping this request.
278   * @param array $optParams Optional parameters.
279   *
280   * @opt_param string filter A filter expression that filters resources listed in
281   * the response. The expression must specify the field name, an operator, and
282   * the value that you want to use for filtering. The value must be a string, a
283   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
284   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
285   * can exclude instances named `example-instance` by specifying `name !=
286   * example-instance`. The `:` operator can be used with string fields to match
287   * substrings. For non-string fields it is equivalent to the `=` operator. The
288   * `:*` comparison can be used to test whether a key has been defined. For
289   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
290   * You can also filter nested fields. For example, you could specify
291   * `scheduling.automaticRestart = false` to include instances only if they are
292   * not scheduled for automatic restarts. You can use filtering on nested fields
293   * to filter based on resource labels. To filter on multiple expressions,
294   * provide each separate expression within parentheses. For example: ```
295   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
296   * default, each expression is an `AND` expression. However, you can include
297   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
298   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
299   * (scheduling.automaticRestart = true) ```
300   * @opt_param string maxResults The maximum number of results per page that
301   * should be returned. If the number of available results is larger than
302   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
303   * get the next page of results in subsequent list requests. Acceptable values
304   * are `0` to `500`, inclusive. (Default: `500`)
305   * @opt_param string orderBy Sorts list results by a certain order. By default,
306   * results are returned in alphanumerical order based on the resource name. You
307   * can also sort results in descending order based on the creation timestamp
308   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
309   * `creationTimestamp` field in reverse chronological order (newest result
310   * first). Use this to sort resources like operations so that the newest
311   * operation is returned first. Currently, only sorting by `name` or
312   * `creationTimestamp desc` is supported.
313   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
314   * the `nextPageToken` returned by a previous list request to get the next page
315   * of results.
316   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
317   * which provides partial results in case of failure. The default value is
318   * false.
319   * @return RegionInstanceGroupManagerList
320   */
321  public function listRegionInstanceGroupManagers($project, $region, $optParams = [])
322  {
323    $params = ['project' => $project, 'region' => $region];
324    $params = array_merge($params, $optParams);
325    return $this->call('list', [$params], RegionInstanceGroupManagerList::class);
326  }
327  /**
328   * Lists all errors thrown by actions on instances for a given regional managed
329   * instance group. The filter and orderBy query parameters are not supported.
330   * (regionInstanceGroupManagers.listErrors)
331   *
332   * @param string $project Project ID for this request.
333   * @param string $region Name of the region scoping this request. This should
334   * conform to RFC1035.
335   * @param string $instanceGroupManager The name of the managed instance group.
336   * It must be a string that meets the requirements in RFC1035, or an unsigned
337   * long integer: must match regexp pattern:
338   * (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
339   * @param array $optParams Optional parameters.
340   *
341   * @opt_param string filter A filter expression that filters resources listed in
342   * the response. The expression must specify the field name, an operator, and
343   * the value that you want to use for filtering. The value must be a string, a
344   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
345   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
346   * can exclude instances named `example-instance` by specifying `name !=
347   * example-instance`. The `:` operator can be used with string fields to match
348   * substrings. For non-string fields it is equivalent to the `=` operator. The
349   * `:*` comparison can be used to test whether a key has been defined. For
350   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
351   * You can also filter nested fields. For example, you could specify
352   * `scheduling.automaticRestart = false` to include instances only if they are
353   * not scheduled for automatic restarts. You can use filtering on nested fields
354   * to filter based on resource labels. To filter on multiple expressions,
355   * provide each separate expression within parentheses. For example: ```
356   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
357   * default, each expression is an `AND` expression. However, you can include
358   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
359   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
360   * (scheduling.automaticRestart = true) ```
361   * @opt_param string maxResults The maximum number of results per page that
362   * should be returned. If the number of available results is larger than
363   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
364   * get the next page of results in subsequent list requests. Acceptable values
365   * are `0` to `500`, inclusive. (Default: `500`)
366   * @opt_param string orderBy Sorts list results by a certain order. By default,
367   * results are returned in alphanumerical order based on the resource name. You
368   * can also sort results in descending order based on the creation timestamp
369   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
370   * `creationTimestamp` field in reverse chronological order (newest result
371   * first). Use this to sort resources like operations so that the newest
372   * operation is returned first. Currently, only sorting by `name` or
373   * `creationTimestamp desc` is supported.
374   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
375   * the `nextPageToken` returned by a previous list request to get the next page
376   * of results.
377   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
378   * which provides partial results in case of failure. The default value is
379   * false.
380   * @return RegionInstanceGroupManagersListErrorsResponse
381   */
382  public function listErrors($project, $region, $instanceGroupManager, $optParams = [])
383  {
384    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
385    $params = array_merge($params, $optParams);
386    return $this->call('listErrors', [$params], RegionInstanceGroupManagersListErrorsResponse::class);
387  }
388  /**
389   * Lists the instances in the managed instance group and instances that are
390   * scheduled to be created. The list includes any current actions that the group
391   * has scheduled for its instances. The orderBy query parameter is not
392   * supported. (regionInstanceGroupManagers.listManagedInstances)
393   *
394   * @param string $project Project ID for this request.
395   * @param string $region Name of the region scoping this request.
396   * @param string $instanceGroupManager The name of the managed instance group.
397   * @param array $optParams Optional parameters.
398   *
399   * @opt_param string filter A filter expression that filters resources listed in
400   * the response. The expression must specify the field name, an operator, and
401   * the value that you want to use for filtering. The value must be a string, a
402   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
403   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
404   * can exclude instances named `example-instance` by specifying `name !=
405   * example-instance`. The `:` operator can be used with string fields to match
406   * substrings. For non-string fields it is equivalent to the `=` operator. The
407   * `:*` comparison can be used to test whether a key has been defined. For
408   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
409   * You can also filter nested fields. For example, you could specify
410   * `scheduling.automaticRestart = false` to include instances only if they are
411   * not scheduled for automatic restarts. You can use filtering on nested fields
412   * to filter based on resource labels. To filter on multiple expressions,
413   * provide each separate expression within parentheses. For example: ```
414   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
415   * default, each expression is an `AND` expression. However, you can include
416   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
417   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
418   * (scheduling.automaticRestart = true) ```
419   * @opt_param string maxResults The maximum number of results per page that
420   * should be returned. If the number of available results is larger than
421   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
422   * get the next page of results in subsequent list requests. Acceptable values
423   * are `0` to `500`, inclusive. (Default: `500`)
424   * @opt_param string orderBy Sorts list results by a certain order. By default,
425   * results are returned in alphanumerical order based on the resource name. You
426   * can also sort results in descending order based on the creation timestamp
427   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
428   * `creationTimestamp` field in reverse chronological order (newest result
429   * first). Use this to sort resources like operations so that the newest
430   * operation is returned first. Currently, only sorting by `name` or
431   * `creationTimestamp desc` is supported.
432   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
433   * the `nextPageToken` returned by a previous list request to get the next page
434   * of results.
435   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
436   * which provides partial results in case of failure. The default value is
437   * false.
438   * @return RegionInstanceGroupManagersListInstancesResponse
439   */
440  public function listManagedInstances($project, $region, $instanceGroupManager, $optParams = [])
441  {
442    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
443    $params = array_merge($params, $optParams);
444    return $this->call('listManagedInstances', [$params], RegionInstanceGroupManagersListInstancesResponse::class);
445  }
446  /**
447   * Lists all of the per-instance configurations defined for the managed instance
448   * group. The orderBy query parameter is not supported.
449   * (regionInstanceGroupManagers.listPerInstanceConfigs)
450   *
451   * @param string $project Project ID for this request.
452   * @param string $region Name of the region scoping this request, should conform
453   * to RFC1035.
454   * @param string $instanceGroupManager The name of the managed instance group.
455   * It should conform to RFC1035.
456   * @param array $optParams Optional parameters.
457   *
458   * @opt_param string filter A filter expression that filters resources listed in
459   * the response. The expression must specify the field name, an operator, and
460   * the value that you want to use for filtering. The value must be a string, a
461   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
462   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
463   * can exclude instances named `example-instance` by specifying `name !=
464   * example-instance`. The `:` operator can be used with string fields to match
465   * substrings. For non-string fields it is equivalent to the `=` operator. The
466   * `:*` comparison can be used to test whether a key has been defined. For
467   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
468   * You can also filter nested fields. For example, you could specify
469   * `scheduling.automaticRestart = false` to include instances only if they are
470   * not scheduled for automatic restarts. You can use filtering on nested fields
471   * to filter based on resource labels. To filter on multiple expressions,
472   * provide each separate expression within parentheses. For example: ```
473   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
474   * default, each expression is an `AND` expression. However, you can include
475   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
476   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
477   * (scheduling.automaticRestart = true) ```
478   * @opt_param string maxResults The maximum number of results per page that
479   * should be returned. If the number of available results is larger than
480   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
481   * get the next page of results in subsequent list requests. Acceptable values
482   * are `0` to `500`, inclusive. (Default: `500`)
483   * @opt_param string orderBy Sorts list results by a certain order. By default,
484   * results are returned in alphanumerical order based on the resource name. You
485   * can also sort results in descending order based on the creation timestamp
486   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
487   * `creationTimestamp` field in reverse chronological order (newest result
488   * first). Use this to sort resources like operations so that the newest
489   * operation is returned first. Currently, only sorting by `name` or
490   * `creationTimestamp desc` is supported.
491   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
492   * the `nextPageToken` returned by a previous list request to get the next page
493   * of results.
494   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
495   * which provides partial results in case of failure. The default value is
496   * false.
497   * @return RegionInstanceGroupManagersListInstanceConfigsResp
498   */
499  public function listPerInstanceConfigs($project, $region, $instanceGroupManager, $optParams = [])
500  {
501    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager];
502    $params = array_merge($params, $optParams);
503    return $this->call('listPerInstanceConfigs', [$params], RegionInstanceGroupManagersListInstanceConfigsResp::class);
504  }
505  /**
506   * Updates a managed instance group using the information that you specify in
507   * the request. This operation is marked as DONE when the group is patched even
508   * if the instances in the group are still in the process of being patched. You
509   * must separately verify the status of the individual instances with the
510   * listmanagedinstances method. This method supports PATCH semantics and uses
511   * the JSON merge patch format and processing rules. If you update your group to
512   * specify a new template or instance configuration, it's possible that your
513   * intended specification for each VM in the group is different from the current
514   * state of that VM. To learn how to apply an updated configuration to the VMs
515   * in a MIG, see Updating instances in a MIG.
516   * (regionInstanceGroupManagers.patch)
517   *
518   * @param string $project Project ID for this request.
519   * @param string $region Name of the region scoping this request.
520   * @param string $instanceGroupManager The name of the instance group manager.
521   * @param InstanceGroupManager $postBody
522   * @param array $optParams Optional parameters.
523   *
524   * @opt_param string requestId An optional request ID to identify requests.
525   * Specify a unique request ID so that if you must retry your request, the
526   * server will know to ignore the request if it has already been completed. For
527   * example, consider a situation where you make an initial request and the
528   * request times out. If you make the request again with the same request ID,
529   * the server can check if original operation with the same request ID was
530   * received, and if so, will ignore the second request. This prevents clients
531   * from accidentally creating duplicate commitments. The request ID must be a
532   * valid UUID with the exception that zero UUID is not supported (
533   * 00000000-0000-0000-0000-000000000000).
534   * @return Operation
535   */
536  public function patch($project, $region, $instanceGroupManager, InstanceGroupManager $postBody, $optParams = [])
537  {
538    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
539    $params = array_merge($params, $optParams);
540    return $this->call('patch', [$params], Operation::class);
541  }
542  /**
543   * Inserts or patches per-instance configurations for the managed instance
544   * group. perInstanceConfig.name serves as a key used to distinguish whether to
545   * perform insert or patch.
546   * (regionInstanceGroupManagers.patchPerInstanceConfigs)
547   *
548   * @param string $project Project ID for this request.
549   * @param string $region Name of the region scoping this request, should conform
550   * to RFC1035.
551   * @param string $instanceGroupManager The name of the managed instance group.
552   * It should conform to RFC1035.
553   * @param RegionInstanceGroupManagerPatchInstanceConfigReq $postBody
554   * @param array $optParams Optional parameters.
555   *
556   * @opt_param string requestId An optional request ID to identify requests.
557   * Specify a unique request ID so that if you must retry your request, the
558   * server will know to ignore the request if it has already been completed. For
559   * example, consider a situation where you make an initial request and the
560   * request times out. If you make the request again with the same request ID,
561   * the server can check if original operation with the same request ID was
562   * received, and if so, will ignore the second request. This prevents clients
563   * from accidentally creating duplicate commitments. The request ID must be a
564   * valid UUID with the exception that zero UUID is not supported (
565   * 00000000-0000-0000-0000-000000000000).
566   * @return Operation
567   */
568  public function patchPerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq $postBody, $optParams = [])
569  {
570    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
571    $params = array_merge($params, $optParams);
572    return $this->call('patchPerInstanceConfigs', [$params], Operation::class);
573  }
574  /**
575   * Flags the specified VM instances in the managed instance group to be
576   * immediately recreated. Each instance is recreated using the group's current
577   * configuration. This operation is marked as DONE when the flag is set even if
578   * the instances have not yet been recreated. You must separately verify the
579   * status of each instance by checking its currentAction field; for more
580   * information, see Checking the status of managed instances. If the group is
581   * part of a backend service that has enabled connection draining, it can take
582   * up to 60 seconds after the connection draining duration has elapsed before
583   * the VM instance is removed or deleted. You can specify a maximum of 1000
584   * instances with this method per request.
585   * (regionInstanceGroupManagers.recreateInstances)
586   *
587   * @param string $project Project ID for this request.
588   * @param string $region Name of the region scoping this request.
589   * @param string $instanceGroupManager Name of the managed instance group.
590   * @param RegionInstanceGroupManagersRecreateRequest $postBody
591   * @param array $optParams Optional parameters.
592   *
593   * @opt_param string requestId An optional request ID to identify requests.
594   * Specify a unique request ID so that if you must retry your request, the
595   * server will know to ignore the request if it has already been completed. For
596   * example, consider a situation where you make an initial request and the
597   * request times out. If you make the request again with the same request ID,
598   * the server can check if original operation with the same request ID was
599   * received, and if so, will ignore the second request. This prevents clients
600   * from accidentally creating duplicate commitments. The request ID must be a
601   * valid UUID with the exception that zero UUID is not supported (
602   * 00000000-0000-0000-0000-000000000000).
603   * @return Operation
604   */
605  public function recreateInstances($project, $region, $instanceGroupManager, RegionInstanceGroupManagersRecreateRequest $postBody, $optParams = [])
606  {
607    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
608    $params = array_merge($params, $optParams);
609    return $this->call('recreateInstances', [$params], Operation::class);
610  }
611  /**
612   * Changes the intended size of the managed instance group. If you increase the
613   * size, the group creates new instances using the current instance template. If
614   * you decrease the size, the group deletes one or more instances. The resize
615   * operation is marked DONE if the resize request is successful. The underlying
616   * actions take additional time. You must separately verify the status of the
617   * creating or deleting actions with the listmanagedinstances method. If the
618   * group is part of a backend service that has enabled connection draining, it
619   * can take up to 60 seconds after the connection draining duration has elapsed
620   * before the VM instance is removed or deleted.
621   * (regionInstanceGroupManagers.resize)
622   *
623   * @param string $project Project ID for this request.
624   * @param string $region Name of the region scoping this request.
625   * @param string $instanceGroupManager Name of the managed instance group.
626   * @param int $size Number of instances that should exist in this instance group
627   * manager.
628   * @param array $optParams Optional parameters.
629   *
630   * @opt_param string requestId An optional request ID to identify requests.
631   * Specify a unique request ID so that if you must retry your request, the
632   * server will know to ignore the request if it has already been completed. For
633   * example, consider a situation where you make an initial request and the
634   * request times out. If you make the request again with the same request ID,
635   * the server can check if original operation with the same request ID was
636   * received, and if so, will ignore the second request. This prevents clients
637   * from accidentally creating duplicate commitments. The request ID must be a
638   * valid UUID with the exception that zero UUID is not supported (
639   * 00000000-0000-0000-0000-000000000000).
640   * @return Operation
641   */
642  public function resize($project, $region, $instanceGroupManager, $size, $optParams = [])
643  {
644    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'size' => $size];
645    $params = array_merge($params, $optParams);
646    return $this->call('resize', [$params], Operation::class);
647  }
648  /**
649   * Sets the instance template to use when creating new instances or recreating
650   * instances in this group. Existing instances are not affected.
651   * (regionInstanceGroupManagers.setInstanceTemplate)
652   *
653   * @param string $project Project ID for this request.
654   * @param string $region Name of the region scoping this request.
655   * @param string $instanceGroupManager The name of the managed instance group.
656   * @param RegionInstanceGroupManagersSetTemplateRequest $postBody
657   * @param array $optParams Optional parameters.
658   *
659   * @opt_param string requestId An optional request ID to identify requests.
660   * Specify a unique request ID so that if you must retry your request, the
661   * server will know to ignore the request if it has already been completed. For
662   * example, consider a situation where you make an initial request and the
663   * request times out. If you make the request again with the same request ID,
664   * the server can check if original operation with the same request ID was
665   * received, and if so, will ignore the second request. This prevents clients
666   * from accidentally creating duplicate commitments. The request ID must be a
667   * valid UUID with the exception that zero UUID is not supported (
668   * 00000000-0000-0000-0000-000000000000).
669   * @return Operation
670   */
671  public function setInstanceTemplate($project, $region, $instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest $postBody, $optParams = [])
672  {
673    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
674    $params = array_merge($params, $optParams);
675    return $this->call('setInstanceTemplate', [$params], Operation::class);
676  }
677  /**
678   * Modifies the target pools to which all new instances in this group are
679   * assigned. Existing instances in the group are not affected.
680   * (regionInstanceGroupManagers.setTargetPools)
681   *
682   * @param string $project Project ID for this request.
683   * @param string $region Name of the region scoping this request.
684   * @param string $instanceGroupManager Name of the managed instance group.
685   * @param RegionInstanceGroupManagersSetTargetPoolsRequest $postBody
686   * @param array $optParams Optional parameters.
687   *
688   * @opt_param string requestId An optional request ID to identify requests.
689   * Specify a unique request ID so that if you must retry your request, the
690   * server will know to ignore the request if it has already been completed. For
691   * example, consider a situation where you make an initial request and the
692   * request times out. If you make the request again with the same request ID,
693   * the server can check if original operation with the same request ID was
694   * received, and if so, will ignore the second request. This prevents clients
695   * from accidentally creating duplicate commitments. The request ID must be a
696   * valid UUID with the exception that zero UUID is not supported (
697   * 00000000-0000-0000-0000-000000000000).
698   * @return Operation
699   */
700  public function setTargetPools($project, $region, $instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest $postBody, $optParams = [])
701  {
702    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
703    $params = array_merge($params, $optParams);
704    return $this->call('setTargetPools', [$params], Operation::class);
705  }
706  /**
707   * Inserts or updates per-instance configurations for the managed instance
708   * group. perInstanceConfig.name serves as a key used to distinguish whether to
709   * perform insert or patch.
710   * (regionInstanceGroupManagers.updatePerInstanceConfigs)
711   *
712   * @param string $project Project ID for this request.
713   * @param string $region Name of the region scoping this request, should conform
714   * to RFC1035.
715   * @param string $instanceGroupManager The name of the managed instance group.
716   * It should conform to RFC1035.
717   * @param RegionInstanceGroupManagerUpdateInstanceConfigReq $postBody
718   * @param array $optParams Optional parameters.
719   *
720   * @opt_param string requestId An optional request ID to identify requests.
721   * Specify a unique request ID so that if you must retry your request, the
722   * server will know to ignore the request if it has already been completed. For
723   * example, consider a situation where you make an initial request and the
724   * request times out. If you make the request again with the same request ID,
725   * the server can check if original operation with the same request ID was
726   * received, and if so, will ignore the second request. This prevents clients
727   * from accidentally creating duplicate commitments. The request ID must be a
728   * valid UUID with the exception that zero UUID is not supported (
729   * 00000000-0000-0000-0000-000000000000).
730   * @return Operation
731   */
732  public function updatePerInstanceConfigs($project, $region, $instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq $postBody, $optParams = [])
733  {
734    $params = ['project' => $project, 'region' => $region, 'instanceGroupManager' => $instanceGroupManager, 'postBody' => $postBody];
735    $params = array_merge($params, $optParams);
736    return $this->call('updatePerInstanceConfigs', [$params], Operation::class);
737  }
738}
739
740// Adding a class alias for backwards compatibility with the previous class name.
741class_alias(RegionInstanceGroupManagers::class, 'Google_Service_Compute_Resource_RegionInstanceGroupManagers');
742