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