blob: b1ff0125ac34db46ef13cdd8a54aac7779c9bf0c [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.instanceGroupManagers.html">instanceGroupManagers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#abandonInstances">abandonInstances(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070082<p class="firstline">Retrieves the list of managed instance groups and groups them by zone.</p>
83<p class="toc_element">
84 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
85<p class="firstline">Retrieves the next page of results.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#applyUpdatesToInstances">applyUpdatesToInstances(project, zone, instanceGroupManager, body=None)</a></code></p>
88<p class="firstline">Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#createInstances">createInstances(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.</p>
92<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093 <code><a href="#delete">delete(project, zone, instanceGroupManager, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070094<p class="firstline">Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#deleteInstances">deleteInstances(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.</p>
98<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#deletePerInstanceConfigs">deletePerInstanceConfigs(project, zone, instanceGroupManager, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">Deletes selected per-instance configs for the managed instance group.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700101<p class="toc_element">
102 <code><a href="#get">get(project, zone, instanceGroupManager)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103<p class="firstline">Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#insert">insert(project, zone, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700109<p class="firstline">Retrieves a list of managed instance groups that are contained within the specified project and zone.</p>
110<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code><a href="#listErrors">listErrors(project, zone, instanceGroupManager, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112<p class="firstline">Lists all errors thrown by actions on instances for a given managed instance group.</p>
113<p class="toc_element">
114 <code><a href="#listErrors_next">listErrors_next(previous_request, previous_response)</a></code></p>
115<p class="firstline">Retrieves the next page of results.</p>
116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#listManagedInstances">listManagedInstances(project, zone, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700118<p class="firstline">Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.</p>
119<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400120 <code><a href="#listManagedInstances_next">listManagedInstances_next(previous_request, previous_response)</a></code></p>
121<p class="firstline">Retrieves the next page of results.</p>
122<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700123 <code><a href="#listPerInstanceConfigs">listPerInstanceConfigs(project, zone, instanceGroupManager, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124<p class="firstline">Lists all of the per-instance configs defined for the managed instance group.</p>
125<p class="toc_element">
126 <code><a href="#listPerInstanceConfigs_next">listPerInstanceConfigs_next(previous_request, previous_response)</a></code></p>
127<p class="firstline">Retrieves the next page of results.</p>
128<p class="toc_element">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700129 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
130<p class="firstline">Retrieves the next page of results.</p>
131<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700132 <code><a href="#patch">patch(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133<p class="firstline">Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.</p>
134<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700135 <code><a href="#patchPerInstanceConfigs">patchPerInstanceConfigs(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
136<p class="firstline">Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700137<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700138 <code><a href="#recreateInstances">recreateInstances(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139<p class="firstline">Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700140<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400141 <code><a href="#resize">resize(project, zone, instanceGroupManager, size, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700142<p class="firstline">Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.</p>
143<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700144 <code><a href="#resizeAdvanced">resizeAdvanced(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700145<p class="firstline">Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.</p>
146<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 <code><a href="#setAutoHealingPolicies">setAutoHealingPolicies(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148<p class="firstline">Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700149<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700150 <code><a href="#setInstanceTemplate">setInstanceTemplate(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700151<p class="firstline">Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.</p>
152<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700153 <code><a href="#setTargetPools">setTargetPools(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700154<p class="firstline">Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.</p>
155<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700156 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700157<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
158<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 <code><a href="#update">update(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400160<p class="firstline">Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700162 <code><a href="#updatePerInstanceConfigs">updatePerInstanceConfigs(project, zone, instanceGroupManager, body=None, requestId=None)</a></code></p>
163<p class="firstline">Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700164<h3>Method Details</h3>
165<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 <code class="details" id="abandonInstances">abandonInstances(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 <pre>Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700168
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400169If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
170
171You can specify a maximum of 1000 instances with this method per request.
172
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700173Args:
174 project: string, Project ID for this request. (required)
175 zone: string, The name of the zone where the managed instance group is located. (required)
176 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700177 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700178 The object takes the form of:
179
180{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400181 "instances": [ # The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700182 "A String",
183 ],
184 }
185
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700186 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
187
188For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
189
190The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700191
192Returns:
193 An object of the form:
194
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700195 { # Represents an Operation resource.
196 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700197 # Google Compute Engine has three Operation resources:
198 #
199 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
200 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700201 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
202 #
203 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700204 # - For global operations, use the `globalOperations` resource.
205 # - For regional operations, use the `regionOperations` resource.
206 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700207 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700209 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700210 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400211 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700214 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700215 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
216 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700217 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700218 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700219 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700220 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700221 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
222 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
223 {
224 "message": "A String", # [Output Only] A human-readable description of the warning code.
225 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
226 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
227 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
228 {
229 "value": "A String", # [Output Only] A warning data value corresponding to the key.
230 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
231 },
232 ],
233 },
234 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700235 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700236 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700237 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700238 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
239 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700240 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700241 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
242 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
243 {
244 "message": "A String", # [Output Only] An optional, human-readable error message.
245 "code": "A String", # [Output Only] The error type identifier for this error.
246 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
247 },
248 ],
249 },
250 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
251 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800252 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700253 }</pre>
254</div>
255
256<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700257 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700258 <pre>Retrieves the list of managed instance groups and groups them by zone.
259
260Args:
261 project: string, Project ID for this request. (required)
262 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
263
Dan O'Mearadd494642020-05-01 07:42:23 -0700264You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700265
Dan O'Mearadd494642020-05-01 07:42:23 -0700266Currently, only sorting by `name` or `creationTimestamp desc` is supported.
267 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
268 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
269 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
270 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700271
Dan O'Mearadd494642020-05-01 07:42:23 -0700272For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700273
Dan O'Mearadd494642020-05-01 07:42:23 -0700274You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700275
Dan O'Mearadd494642020-05-01 07:42:23 -0700276To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
277 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700278
279Returns:
280 An object of the form:
281
282 {
283 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700284 "kind": "compute#instanceGroupManagerAggregatedList", # [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups.
285 "items": { # A list of InstanceGroupManagersScopedList resources.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700286 "a_key": { # [Output Only] The name of the scope that contains this set of managed instance groups.
287 "warning": { # [Output Only] The warning that replaces the list of managed instance groups when the list is empty.
288 "message": "A String", # [Output Only] A human-readable description of the warning code.
289 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
290 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
291 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
292 {
293 "value": "A String", # [Output Only] A warning data value corresponding to the key.
294 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
295 },
296 ],
297 },
298 "instanceGroupManagers": [ # [Output Only] The list of managed instance groups that are contained in the specified project and zone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 { # Represents a Managed Instance Group resource.
300 #
301 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
302 #
303 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
304 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700305 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700306 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
307 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
308 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
309 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
310 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
311 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
312 },
313 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
314 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
315 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
316 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
317 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
318 "updatePolicy": { # The update policy for this managed instance group.
319 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
320 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
321 #
322 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
323 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800324 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700325 #
326 # - If the value is fixed, then the calculated value is equal to the fixed value.
327 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
328 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
329 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800330 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -0700332 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
333 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
334 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700335 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
336 #
337 #
338 # - The instance's status is RUNNING.
339 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
340 #
341 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
342 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
343 #
344 #
345 # - If the value is fixed, then the calculated value is equal to the fixed value.
346 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
347 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
348 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
349 },
350 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
351 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
352 },
353 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
354 "A String",
355 ],
356 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
357 { # The named port. For example: .
358 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
359 "port": 42, # The port number, which can be a value between 1 and 65535.
360 },
361 ],
362 "status": { # [Output Only] The status of this managed instance group.
363 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -0700364 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
365 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 },
367 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
368 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
369 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
370 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700371 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700372 },
373 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
374 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
375 {
376 "healthCheck": "A String", # The URL for the health check that signals autohealing.
377 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
378 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
379 #
380 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
381 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
382 #
383 #
384 # - If the value is fixed, then the calculated value is equal to the fixed value.
385 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
386 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
387 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
388 },
389 },
390 ],
391 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
392 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
393 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
394 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
395 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
396 #
397 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
398 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
399 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
400 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
401 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
402 #
403 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
404 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
405 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
406 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
407 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
408 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
409 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
410 },
411 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
412 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
413 #
414 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
415 {
416 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
417 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
418 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
419 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
420 #
421 #
422 # - If the value is fixed, then the calculated value is equal to the fixed value.
423 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
424 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
425 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
426 },
427 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
428 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
429 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
430 },
431 ],
432 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700434 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
435 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800436 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700437 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800438 },
439 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700440 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700441 },
442 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700443 "preservedState": { # Configuration of preserved resources.
444 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
445 "a_key": {
446 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
447 },
448 },
449 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700450 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700451 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
452 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700453 ],
454 },
455 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700456 "warning": { # [Output Only] Informational warning message.
457 "message": "A String", # [Output Only] A human-readable description of the warning code.
458 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
459 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
460 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
461 {
462 "value": "A String", # [Output Only] A warning data value corresponding to the key.
463 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
464 },
465 ],
466 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700467 "unreachables": [ # [Output Only] Unreachable resources.
468 "A String",
469 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
471 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700472 }</pre>
473</div>
474
475<div class="method">
476 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
477 <pre>Retrieves the next page of results.
478
479Args:
480 previous_request: The request for the previous page. (required)
481 previous_response: The response from the request for the previous page. (required)
482
483Returns:
484 A request object that you can call 'execute()' on to request the next
485 page. Returns None if there are no more items in the collection.
486 </pre>
487</div>
488
489<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700490 <code class="details" id="applyUpdatesToInstances">applyUpdatesToInstances(project, zone, instanceGroupManager, body=None)</code>
491 <pre>Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700492
493Args:
494 project: string, Project ID for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700495 zone: string, The name of the zone where the managed instance group is located. Should conform to RFC1035. (required)
496 instanceGroupManager: string, The name of the managed instance group, should conform to RFC1035. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700497 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700498 The object takes the form of:
499
500{ # InstanceGroupManagers.applyUpdatesToInstances
501 "maximalAction": "A String", # The maximal action that should be performed on the instances. By default REPLACE. This field is deprecated, please use most_disruptive_allowed_action.
502 "instances": [ # The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
503 "A String",
504 ],
505 "mostDisruptiveAllowedAction": "A String", # The most disruptive action that you want to perform on each instance during the update:
506 # - REPLACE: Delete the instance and create it again.
507 # - RESTART: Stop the instance and start it again.
508 # - REFRESH: Do not stop the instance.
509 # - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail.
510 "minimalAction": "A String", # The minimal action that you want to perform on each instance during the update:
511 # - REPLACE: At minimum, delete the instance and create it again.
512 # - RESTART: Stop the instance and start it again.
513 # - REFRESH: Do not stop the instance.
514 # - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update.
515 }
516
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700517
518Returns:
519 An object of the form:
520
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700521 { # Represents an Operation resource.
522 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700523 # Google Compute Engine has three Operation resources:
524 #
525 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
526 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700527 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
528 #
529 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700530 # - For global operations, use the `globalOperations` resource.
531 # - For regional operations, use the `regionOperations` resource.
532 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700533 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700534 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700535 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700536 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400537 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700538 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700539 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700540 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700541 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
542 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700543 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700544 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700545 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700546 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700547 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
548 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
549 {
550 "message": "A String", # [Output Only] A human-readable description of the warning code.
551 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
552 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
553 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
554 {
555 "value": "A String", # [Output Only] A warning data value corresponding to the key.
556 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
557 },
558 ],
559 },
560 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700561 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700562 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700563 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700564 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
565 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700566 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
567 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
568 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
569 {
570 "message": "A String", # [Output Only] An optional, human-readable error message.
571 "code": "A String", # [Output Only] The error type identifier for this error.
572 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
573 },
574 ],
575 },
576 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
577 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
578 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
579 }</pre>
580</div>
581
582<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700583 <code class="details" id="createInstances">createInstances(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700584 <pre>Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.
585
586Args:
587 project: string, Project ID for this request. (required)
588 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
589 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700590 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700591 The object takes the form of:
592
593{ # InstanceGroupManagers.createInstances
594 "instances": [ # [Required] List of specifications of per-instance configs.
595 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700596 "name": "A String", # The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error.
597 "preservedState": { # Preserved state for a given instance. # The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700598 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
599 "a_key": {
600 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
601 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
602 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
603 },
604 },
605 "metadata": { # Preserved metadata defined for this instance.
606 "a_key": "A String",
607 },
608 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700609 "fingerprint": "A String", # Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700610 },
611 ],
612 }
613
614 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
615
616For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request.
617
618The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
619
620Returns:
621 An object of the form:
622
623 { # Represents an Operation resource.
624 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700625 # Google Compute Engine has three Operation resources:
626 #
627 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
628 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700629 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
630 #
631 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700632 # - For global operations, use the `globalOperations` resource.
633 # - For regional operations, use the `regionOperations` resource.
634 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700636 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700637 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
638 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
639 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700640 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700641 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
642 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700643 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
644 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700645 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700646 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700648 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700649 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
650 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
651 {
652 "message": "A String", # [Output Only] A human-readable description of the warning code.
653 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
654 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
655 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
656 {
657 "value": "A String", # [Output Only] A warning data value corresponding to the key.
658 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
659 },
660 ],
661 },
662 ],
663 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700664 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700665 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700666 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
667 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700668 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
669 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
670 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
671 {
672 "message": "A String", # [Output Only] An optional, human-readable error message.
673 "code": "A String", # [Output Only] The error type identifier for this error.
674 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
675 },
676 ],
677 },
678 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
679 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
680 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
681 }</pre>
682</div>
683
684<div class="method">
685 <code class="details" id="delete">delete(project, zone, instanceGroupManager, requestId=None)</code>
686 <pre>Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.
687
688Args:
689 project: string, Project ID for this request. (required)
690 zone: string, The name of the zone where the managed instance group is located. (required)
691 instanceGroupManager: string, The name of the managed instance group to delete. (required)
692 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
693
694For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
695
696The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
697
698Returns:
699 An object of the form:
700
701 { # Represents an Operation resource.
702 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700703 # Google Compute Engine has three Operation resources:
704 #
705 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
706 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700707 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
708 #
709 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700710 # - For global operations, use the `globalOperations` resource.
711 # - For regional operations, use the `regionOperations` resource.
712 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700713 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700714 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700715 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
716 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
717 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700718 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700719 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
720 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700721 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
722 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700723 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700724 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700725 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700726 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700727 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
728 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
729 {
730 "message": "A String", # [Output Only] A human-readable description of the warning code.
731 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
732 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
733 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
734 {
735 "value": "A String", # [Output Only] A warning data value corresponding to the key.
736 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
737 },
738 ],
739 },
740 ],
741 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700742 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700743 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700744 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
745 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700747 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
748 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
749 {
750 "message": "A String", # [Output Only] An optional, human-readable error message.
751 "code": "A String", # [Output Only] The error type identifier for this error.
752 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
753 },
754 ],
755 },
756 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
757 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800758 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700759 }</pre>
760</div>
761
762<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700763 <code class="details" id="deleteInstances">deleteInstances(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700764 <pre>Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700765
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400766If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
767
768You can specify a maximum of 1000 instances with this method per request.
769
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700770Args:
771 project: string, Project ID for this request. (required)
772 zone: string, The name of the zone where the managed instance group is located. (required)
773 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700774 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700775 The object takes the form of:
776
777{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400778 "instances": [ # The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700779 "A String",
780 ],
781 }
782
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700783 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
784
785For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
786
787The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700788
789Returns:
790 An object of the form:
791
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700792 { # Represents an Operation resource.
793 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700794 # Google Compute Engine has three Operation resources:
795 #
796 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
797 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700798 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
799 #
800 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700801 # - For global operations, use the `globalOperations` resource.
802 # - For regional operations, use the `regionOperations` resource.
803 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700804 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700805 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700806 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700807 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400808 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700810 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700811 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700812 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
813 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700814 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700815 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700816 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700817 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700818 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
819 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
820 {
821 "message": "A String", # [Output Only] A human-readable description of the warning code.
822 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
823 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
824 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
825 {
826 "value": "A String", # [Output Only] A warning data value corresponding to the key.
827 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
828 },
829 ],
830 },
831 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700832 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700833 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700834 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700835 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
836 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700837 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
838 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
839 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
840 {
841 "message": "A String", # [Output Only] An optional, human-readable error message.
842 "code": "A String", # [Output Only] The error type identifier for this error.
843 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
844 },
845 ],
846 },
847 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
848 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
849 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
850 }</pre>
851</div>
852
853<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700854 <code class="details" id="deletePerInstanceConfigs">deletePerInstanceConfigs(project, zone, instanceGroupManager, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700855 <pre>Deletes selected per-instance configs for the managed instance group.
856
857Args:
858 project: string, Project ID for this request. (required)
859 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
860 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700861 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700862 The object takes the form of:
863
864{ # InstanceGroupManagers.deletePerInstanceConfigs
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700865 "names": [ # The list of instance names for which we want to delete per-instance configs on this managed instance group.
866 "A String",
867 ],
868 }
869
870
871Returns:
872 An object of the form:
873
874 { # Represents an Operation resource.
875 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700876 # Google Compute Engine has three Operation resources:
877 #
878 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
879 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700880 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
881 #
882 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700883 # - For global operations, use the `globalOperations` resource.
884 # - For regional operations, use the `regionOperations` resource.
885 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700886 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700887 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700888 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
889 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
890 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700891 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700892 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
893 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700894 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
895 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700896 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700897 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700898 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700899 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700900 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
901 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
902 {
903 "message": "A String", # [Output Only] A human-readable description of the warning code.
904 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
905 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
906 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
907 {
908 "value": "A String", # [Output Only] A warning data value corresponding to the key.
909 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
910 },
911 ],
912 },
913 ],
914 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700915 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700916 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700917 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
918 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700919 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700920 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
921 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
922 {
923 "message": "A String", # [Output Only] An optional, human-readable error message.
924 "code": "A String", # [Output Only] The error type identifier for this error.
925 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
926 },
927 ],
928 },
929 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
930 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800931 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700932 }</pre>
933</div>
934
935<div class="method">
936 <code class="details" id="get">get(project, zone, instanceGroupManager)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700937 <pre>Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700938
939Args:
940 project: string, Project ID for this request. (required)
941 zone: string, The name of the zone where the managed instance group is located. (required)
942 instanceGroupManager: string, The name of the managed instance group. (required)
943
944Returns:
945 An object of the form:
946
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700947 { # Represents a Managed Instance Group resource.
948 #
949 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
950 #
951 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
952 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700953 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700954 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700955 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
956 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
957 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
958 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
959 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700960 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800961 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800962 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700963 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
964 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800965 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700966 "updatePolicy": { # The update policy for this managed instance group.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700967 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
968 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
969 #
970 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
971 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
972 #
973 #
974 # - If the value is fixed, then the calculated value is equal to the fixed value.
975 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
976 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
977 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700978 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700979 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -0700980 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
981 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
982 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700983 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
984 #
985 #
986 # - The instance's status is RUNNING.
987 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
988 #
989 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
990 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
991 #
992 #
993 # - If the value is fixed, then the calculated value is equal to the fixed value.
994 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
995 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
996 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700997 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700998 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700999 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1000 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001001 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
1002 "A String",
1003 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001004 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1005 { # The named port. For example: .
1006 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1007 "port": 42, # The port number, which can be a value between 1 and 65535.
1008 },
1009 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001010 "status": { # [Output Only] The status of this managed instance group.
1011 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -07001012 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
1013 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001014 },
1015 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
1016 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1017 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
1018 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001019 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001020 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001021 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1022 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1023 {
1024 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1025 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001026 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
1027 #
1028 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
1029 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1030 #
1031 #
1032 # - If the value is fixed, then the calculated value is equal to the fixed value.
1033 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1034 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1035 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001036 },
1037 },
1038 ],
1039 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001040 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1041 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001042 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001043 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
1044 #
1045 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001046 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
1047 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1048 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
1049 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
1050 #
1051 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001052 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001053 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1054 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
1055 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1056 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
1057 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
1058 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001059 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001060 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1061 #
1062 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001063 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001064 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
1065 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1066 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
1067 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1068 #
1069 #
1070 # - If the value is fixed, then the calculated value is equal to the fixed value.
1071 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1072 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1073 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001074 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001075 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001076 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
1077 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001078 },
1079 ],
1080 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -07001081 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001082 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1083 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001084 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001085 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001086 },
1087 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001088 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001089 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001090 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001091 "preservedState": { # Configuration of preserved resources.
1092 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
1093 "a_key": {
1094 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1095 },
1096 },
1097 },
1098 },
1099 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1100 }</pre>
1101</div>
1102
1103<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001104 <code class="details" id="insert">insert(project, zone, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001105 <pre>Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.
1106
1107A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.
1108
1109Args:
1110 project: string, Project ID for this request. (required)
1111 zone: string, The name of the zone where you want to create the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001112 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001113 The object takes the form of:
1114
1115{ # Represents a Managed Instance Group resource.
1116 #
1117 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
1118 #
1119 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
1120 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001121 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001122 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
1123 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
1124 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
1125 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
1126 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
1127 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
1128 },
1129 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
1130 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
1131 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
1132 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
1133 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
1134 "updatePolicy": { # The update policy for this managed instance group.
1135 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
1136 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1137 #
1138 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
1139 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1140 #
1141 #
1142 # - If the value is fixed, then the calculated value is equal to the fixed value.
1143 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1144 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1145 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1146 },
1147 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -07001148 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
1149 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
1150 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001151 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
1152 #
1153 #
1154 # - The instance's status is RUNNING.
1155 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1156 #
1157 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
1158 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1159 #
1160 #
1161 # - If the value is fixed, then the calculated value is equal to the fixed value.
1162 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1163 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1164 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1165 },
1166 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
1167 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1168 },
1169 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
1170 "A String",
1171 ],
1172 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1173 { # The named port. For example: .
1174 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1175 "port": 42, # The port number, which can be a value between 1 and 65535.
1176 },
1177 ],
1178 "status": { # [Output Only] The status of this managed instance group.
1179 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -07001180 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
1181 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001182 },
1183 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
1184 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1185 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
1186 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001187 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001188 },
1189 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1190 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1191 {
1192 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1193 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
1194 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
1195 #
1196 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
1197 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1198 #
1199 #
1200 # - If the value is fixed, then the calculated value is equal to the fixed value.
1201 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1202 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1203 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1204 },
1205 },
1206 ],
1207 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
1208 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1209 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1210 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
1211 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
1212 #
1213 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
1214 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
1215 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1216 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
1217 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
1218 #
1219 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
1220 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
1221 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1222 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
1223 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1224 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
1225 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
1226 },
1227 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
1228 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1229 #
1230 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
1231 {
1232 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
1233 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1234 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
1235 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1236 #
1237 #
1238 # - If the value is fixed, then the calculated value is equal to the fixed value.
1239 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1240 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1241 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1242 },
1243 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
1244 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
1245 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
1246 },
1247 ],
1248 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -07001249 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001250 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1251 "zones": [ # Zones where the regional managed instance group will create and manage instances.
1252 {
1253 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
1254 },
1255 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001256 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001257 },
1258 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001259 "preservedState": { # Configuration of preserved resources.
1260 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
1261 "a_key": {
1262 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1263 },
1264 },
1265 },
1266 },
1267 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1268}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001269
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001270 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
1271
1272For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
1273
1274The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001275
1276Returns:
1277 An object of the form:
1278
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001279 { # Represents an Operation resource.
1280 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001281 # Google Compute Engine has three Operation resources:
1282 #
1283 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1284 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001285 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1286 #
1287 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001288 # - For global operations, use the `globalOperations` resource.
1289 # - For regional operations, use the `regionOperations` resource.
1290 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001291 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001292 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001293 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001294 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001295 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001296 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001297 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001298 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001299 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1300 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001301 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07001302 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001303 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07001304 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001305 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1306 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1307 {
1308 "message": "A String", # [Output Only] A human-readable description of the warning code.
1309 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1310 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1311 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1312 {
1313 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1314 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1315 },
1316 ],
1317 },
1318 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001319 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07001320 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001321 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001322 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1323 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001324 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001325 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1326 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1327 {
1328 "message": "A String", # [Output Only] An optional, human-readable error message.
1329 "code": "A String", # [Output Only] The error type identifier for this error.
1330 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1331 },
1332 ],
1333 },
1334 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1335 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001336 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001337 }</pre>
1338</div>
1339
1340<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001341 <code class="details" id="list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001342 <pre>Retrieves a list of managed instance groups that are contained within the specified project and zone.
1343
1344Args:
1345 project: string, Project ID for this request. (required)
1346 zone: string, The name of the zone where the managed instance group is located. (required)
1347 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1348
Dan O'Mearadd494642020-05-01 07:42:23 -07001349You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001350
Dan O'Mearadd494642020-05-01 07:42:23 -07001351Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1352 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1353 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1354 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1355 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001356
Dan O'Mearadd494642020-05-01 07:42:23 -07001357For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001358
Dan O'Mearadd494642020-05-01 07:42:23 -07001359You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001360
Dan O'Mearadd494642020-05-01 07:42:23 -07001361To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001362
1363Returns:
1364 An object of the form:
1365
1366 { # [Output Only] A list of managed instance groups.
1367 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001368 "kind": "compute#instanceGroupManagerList", # [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups.
1369 "items": [ # A list of InstanceGroupManager resources.
1370 { # Represents a Managed Instance Group resource.
1371 #
1372 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
1373 #
1374 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
1375 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001376 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001377 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
1378 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
1379 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
1380 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
1381 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
1382 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
1383 },
1384 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
1385 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
1386 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
1387 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
1388 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
1389 "updatePolicy": { # The update policy for this managed instance group.
1390 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
1391 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1392 #
1393 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
1394 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001395 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001396 #
1397 # - If the value is fixed, then the calculated value is equal to the fixed value.
1398 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1399 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1400 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001401 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001402 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -07001403 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
1404 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
1405 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001406 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
1407 #
1408 #
1409 # - The instance's status is RUNNING.
1410 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1411 #
1412 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
1413 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1414 #
1415 #
1416 # - If the value is fixed, then the calculated value is equal to the fixed value.
1417 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1418 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1419 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1420 },
1421 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
1422 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1423 },
1424 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
1425 "A String",
1426 ],
1427 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1428 { # The named port. For example: .
1429 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1430 "port": 42, # The port number, which can be a value between 1 and 65535.
1431 },
1432 ],
1433 "status": { # [Output Only] The status of this managed instance group.
1434 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -07001435 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
1436 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001437 },
1438 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
1439 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1440 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
1441 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001442 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001443 },
1444 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1445 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1446 {
1447 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1448 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
1449 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
1450 #
1451 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
1452 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1453 #
1454 #
1455 # - If the value is fixed, then the calculated value is equal to the fixed value.
1456 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1457 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1458 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1459 },
1460 },
1461 ],
1462 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
1463 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1464 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1465 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
1466 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
1467 #
1468 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
1469 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
1470 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1471 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
1472 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
1473 #
1474 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
1475 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
1476 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1477 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
1478 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1479 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
1480 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
1481 },
1482 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
1483 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1484 #
1485 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
1486 {
1487 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
1488 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1489 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
1490 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1491 #
1492 #
1493 # - If the value is fixed, then the calculated value is equal to the fixed value.
1494 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1495 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1496 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1497 },
1498 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
1499 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
1500 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
1501 },
1502 ],
1503 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -07001504 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001505 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1506 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001507 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001508 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001509 },
1510 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001511 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001512 },
1513 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001514 "preservedState": { # Configuration of preserved resources.
1515 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
1516 "a_key": {
1517 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1518 },
1519 },
1520 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001521 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001522 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1523 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001524 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001525 "warning": { # [Output Only] Informational warning message.
1526 "message": "A String", # [Output Only] A human-readable description of the warning code.
1527 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1528 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1529 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1530 {
1531 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1532 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1533 },
1534 ],
1535 },
1536 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001537 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1538 }</pre>
1539</div>
1540
1541<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001542 <code class="details" id="listErrors">listErrors(project, zone, instanceGroupManager, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001543 <pre>Lists all errors thrown by actions on instances for a given managed instance group.
1544
1545Args:
1546 project: string, Project ID for this request. (required)
1547 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
1548 instanceGroupManager: string, The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. (required)
1549 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1550
Dan O'Mearadd494642020-05-01 07:42:23 -07001551You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001552
Dan O'Mearadd494642020-05-01 07:42:23 -07001553Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1554 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1555 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1556 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1557 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001558
Dan O'Mearadd494642020-05-01 07:42:23 -07001559For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001560
Dan O'Mearadd494642020-05-01 07:42:23 -07001561You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001562
Dan O'Mearadd494642020-05-01 07:42:23 -07001563To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001564
1565Returns:
1566 An object of the form:
1567
1568 {
1569 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
1570 "items": [ # [Output Only] The list of errors of the managed instance group.
1571 {
1572 "timestamp": "A String", # [Output Only] The time that this error occurred. This value is in RFC3339 text format.
1573 "instanceActionDetails": { # [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional.
1574 "action": "A String", # [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values:
1575 "instance": "A String", # [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created.
1576 "version": { # [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created.
1577 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
1578 "name": "A String", # [Output Only] Name of the version.
1579 },
1580 },
1581 "error": { # [Output Only] Contents of the error.
1582 "message": "A String", # [Output Only] Error message.
1583 "code": "A String", # [Output Only] Error code.
1584 },
1585 },
1586 ],
1587 }</pre>
1588</div>
1589
1590<div class="method">
1591 <code class="details" id="listErrors_next">listErrors_next(previous_request, previous_response)</code>
1592 <pre>Retrieves the next page of results.
1593
1594Args:
1595 previous_request: The request for the previous page. (required)
1596 previous_response: The response from the request for the previous page. (required)
1597
1598Returns:
1599 A request object that you can call 'execute()' on to request the next
1600 page. Returns None if there are no more items in the collection.
1601 </pre>
1602</div>
1603
1604<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001605 <code class="details" id="listManagedInstances">listManagedInstances(project, zone, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001606 <pre>Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.
1607
1608Args:
1609 project: string, Project ID for this request. (required)
1610 zone: string, The name of the zone where the managed instance group is located. (required)
1611 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001612 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001613
Dan O'Mearadd494642020-05-01 07:42:23 -07001614You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001615
Dan O'Mearadd494642020-05-01 07:42:23 -07001616Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1617 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1618 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1619 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001620
Dan O'Mearadd494642020-05-01 07:42:23 -07001621For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001622
Dan O'Mearadd494642020-05-01 07:42:23 -07001623You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001624
Dan O'Mearadd494642020-05-01 07:42:23 -07001625To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001626
1627Returns:
1628 An object of the form:
1629
1630 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001631 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001632 "managedInstances": [ # [Output Only] The list of instances in the managed instance group.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001633 { # A Managed Instance resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001634 "instanceStatus": "A String", # [Output Only] The status of the instance. This field is empty when the instance does not exist.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001635 "version": { # [Output Only] Intended version of this instance.
1636 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
1637 "name": "A String", # [Output Only] Name of the version.
1638 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001639 "instanceHealth": [ # [Output Only] Health state of the instance per health-check.
1640 {
1641 "healthCheck": "A String", # [Output Only] The URL for the health check that verifies whether the instance is healthy.
1642 "detailedHealthState": "A String", # [Output Only] The current detailed instance health state.
Dan O'Mearadd494642020-05-01 07:42:23 -07001643 "healthState": "A String", # [Output Only] The current instance health state. This field will not get promoted to beta/GA and might be removed from alpha APIs after 01/12/2019. Please use detailed_health_state field instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001644 },
1645 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001646 "lastAttempt": { # [Output Only] Information about the last attempt to create or delete the instance.
1647 "errors": { # [Output Only] Encountered errors during the last attempt to create or delete the instance.
1648 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1649 {
1650 "message": "A String", # [Output Only] An optional, human-readable error message.
1651 "code": "A String", # [Output Only] The error type identifier for this error.
1652 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1653 },
1654 ],
1655 },
1656 },
1657 "tag": "A String", # [Output Only] Tag describing the version.
1658 "instance": "A String", # [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001659 "preservedStateFromPolicy": { # Preserved state for a given instance. # [Output Only] Preserved state generated based on stateful policy for this instance.
1660 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1661 "a_key": {
1662 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1663 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
1664 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1665 },
1666 },
1667 "metadata": { # Preserved metadata defined for this instance.
1668 "a_key": "A String",
1669 },
1670 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001671 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001672 "currentAction": "A String", # [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values:
1673 # - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance.
1674 # - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.
1675 # - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead.
1676 # - RECREATING The managed instance group is recreating this instance.
1677 # - DELETING The managed instance group is permanently deleting this instance.
1678 # - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.
1679 # - RESTARTING The managed instance group is restarting the instance.
1680 # - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001681 # - VERIFYING The managed instance group has created the instance and it is in the process of being verified.
1682 "preservedStateFromConfig": { # Preserved state for a given instance. # [Output Only] Preserved state applied from per-instance config for this instance.
1683 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1684 "a_key": {
1685 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1686 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
1687 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1688 },
1689 },
1690 "metadata": { # Preserved metadata defined for this instance.
1691 "a_key": "A String",
1692 },
1693 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001694 "id": "A String", # [Output only] The unique identifier for this resource. This field is empty when instance does not exist.
1695 },
1696 ],
1697 }</pre>
1698</div>
1699
1700<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001701 <code class="details" id="listManagedInstances_next">listManagedInstances_next(previous_request, previous_response)</code>
1702 <pre>Retrieves the next page of results.
1703
1704Args:
1705 previous_request: The request for the previous page. (required)
1706 previous_response: The response from the request for the previous page. (required)
1707
1708Returns:
1709 A request object that you can call 'execute()' on to request the next
1710 page. Returns None if there are no more items in the collection.
1711 </pre>
1712</div>
1713
1714<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001715 <code class="details" id="listPerInstanceConfigs">listPerInstanceConfigs(project, zone, instanceGroupManager, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001716 <pre>Lists all of the per-instance configs defined for the managed instance group.
1717
1718Args:
1719 project: string, Project ID for this request. (required)
1720 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
1721 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
1722 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1723
Dan O'Mearadd494642020-05-01 07:42:23 -07001724You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001725
Dan O'Mearadd494642020-05-01 07:42:23 -07001726Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1727 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1728 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1729 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1730 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001731
Dan O'Mearadd494642020-05-01 07:42:23 -07001732For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001733
Dan O'Mearadd494642020-05-01 07:42:23 -07001734You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001735
Dan O'Mearadd494642020-05-01 07:42:23 -07001736To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001737
1738Returns:
1739 An object of the form:
1740
1741 {
1742 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
1743 "items": [ # [Output Only] The list of PerInstanceConfig.
1744 {
Dan O'Mearadd494642020-05-01 07:42:23 -07001745 "name": "A String", # The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error.
1746 "preservedState": { # Preserved state for a given instance. # The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001747 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1748 "a_key": {
1749 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1750 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
1751 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1752 },
1753 },
1754 "metadata": { # Preserved metadata defined for this instance.
1755 "a_key": "A String",
1756 },
1757 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001758 "fingerprint": "A String", # Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001759 },
1760 ],
1761 "warning": { # [Output Only] Informational warning message.
1762 "message": "A String", # [Output Only] A human-readable description of the warning code.
1763 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1764 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1765 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1766 {
1767 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1768 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1769 },
1770 ],
1771 },
1772 }</pre>
1773</div>
1774
1775<div class="method">
1776 <code class="details" id="listPerInstanceConfigs_next">listPerInstanceConfigs_next(previous_request, previous_response)</code>
1777 <pre>Retrieves the next page of results.
1778
1779Args:
1780 previous_request: The request for the previous page. (required)
1781 previous_response: The response from the request for the previous page. (required)
1782
1783Returns:
1784 A request object that you can call 'execute()' on to request the next
1785 page. Returns None if there are no more items in the collection.
1786 </pre>
1787</div>
1788
1789<div class="method">
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001790 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1791 <pre>Retrieves the next page of results.
1792
1793Args:
1794 previous_request: The request for the previous page. (required)
1795 previous_response: The response from the request for the previous page. (required)
1796
1797Returns:
1798 A request object that you can call 'execute()' on to request the next
1799 page. Returns None if there are no more items in the collection.
1800 </pre>
1801</div>
1802
1803<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001804 <code class="details" id="patch">patch(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001805 <pre>Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001806
1807Args:
1808 project: string, Project ID for this request. (required)
1809 zone: string, The name of the zone where you want to create the managed instance group. (required)
1810 instanceGroupManager: string, The name of the instance group manager. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001811 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001812 The object takes the form of:
1813
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001814{ # Represents a Managed Instance Group resource.
1815 #
1816 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
1817 #
1818 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
1819 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001820 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001821 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
1822 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
1823 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
1824 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
1825 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
1826 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
1827 },
1828 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
1829 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
1830 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
1831 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
1832 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
1833 "updatePolicy": { # The update policy for this managed instance group.
1834 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
1835 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1836 #
1837 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
1838 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001839 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001840 #
1841 # - If the value is fixed, then the calculated value is equal to the fixed value.
1842 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1843 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1844 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001845 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001846 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -07001847 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
1848 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
1849 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001850 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
1851 #
1852 #
1853 # - The instance's status is RUNNING.
1854 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
1855 #
1856 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
1857 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1858 #
1859 #
1860 # - If the value is fixed, then the calculated value is equal to the fixed value.
1861 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1862 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1863 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1864 },
1865 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
1866 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1867 },
1868 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
1869 "A String",
1870 ],
1871 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1872 { # The named port. For example: .
1873 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1874 "port": 42, # The port number, which can be a value between 1 and 65535.
1875 },
1876 ],
1877 "status": { # [Output Only] The status of this managed instance group.
1878 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -07001879 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
1880 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001881 },
1882 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
1883 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1884 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
1885 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001886 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001887 },
1888 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1889 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1890 {
1891 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1892 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
1893 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
1894 #
1895 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
1896 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1897 #
1898 #
1899 # - If the value is fixed, then the calculated value is equal to the fixed value.
1900 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1901 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1902 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1903 },
1904 },
1905 ],
1906 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
1907 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1908 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1909 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
1910 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
1911 #
1912 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
1913 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
1914 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1915 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
1916 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
1917 #
1918 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
1919 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
1920 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1921 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
1922 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1923 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
1924 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
1925 },
1926 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
1927 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1928 #
1929 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
1930 {
1931 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
1932 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1933 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
1934 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1935 #
1936 #
1937 # - If the value is fixed, then the calculated value is equal to the fixed value.
1938 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1939 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1940 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1941 },
1942 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
1943 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
1944 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
1945 },
1946 ],
1947 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -07001948 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001949 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1950 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001951 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001952 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001953 },
1954 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001955 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001956 },
1957 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001958 "preservedState": { # Configuration of preserved resources.
1959 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
1960 "a_key": {
1961 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
1962 },
1963 },
1964 },
1965 },
1966 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1967}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001968
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001969 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
1970
1971For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
1972
1973The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001974
1975Returns:
1976 An object of the form:
1977
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001978 { # Represents an Operation resource.
1979 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001980 # Google Compute Engine has three Operation resources:
1981 #
1982 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1983 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001984 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1985 #
1986 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001987 # - For global operations, use the `globalOperations` resource.
1988 # - For regional operations, use the `regionOperations` resource.
1989 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001990 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001991 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001992 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001993 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001994 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001995 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001996 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001997 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001998 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1999 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002000 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002001 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002002 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002003 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002004 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2005 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2006 {
2007 "message": "A String", # [Output Only] A human-readable description of the warning code.
2008 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2009 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2010 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2011 {
2012 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2013 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2014 },
2015 ],
2016 },
2017 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002018 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002019 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002020 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002021 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2022 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002023 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
2024 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2025 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2026 {
2027 "message": "A String", # [Output Only] An optional, human-readable error message.
2028 "code": "A String", # [Output Only] The error type identifier for this error.
2029 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2030 },
2031 ],
2032 },
2033 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2034 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2035 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
2036 }</pre>
2037</div>
2038
2039<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002040 <code class="details" id="patchPerInstanceConfigs">patchPerInstanceConfigs(project, zone, instanceGroupManager, body=None, requestId=None)</code>
2041 <pre>Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002042
2043Args:
2044 project: string, Project ID for this request. (required)
2045 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
2046 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002047 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002048 The object takes the form of:
2049
2050{ # InstanceGroupManagers.patchPerInstanceConfigs
2051 "perInstanceConfigs": [ # The list of per-instance configs to insert or patch on this managed instance group.
2052 {
Dan O'Mearadd494642020-05-01 07:42:23 -07002053 "name": "A String", # The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error.
2054 "preservedState": { # Preserved state for a given instance. # The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002055 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
2056 "a_key": {
2057 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
2058 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
2059 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
2060 },
2061 },
2062 "metadata": { # Preserved metadata defined for this instance.
2063 "a_key": "A String",
2064 },
2065 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002066 "fingerprint": "A String", # Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002067 },
2068 ],
2069 }
2070
2071 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2072
2073For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2074
2075The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2076
2077Returns:
2078 An object of the form:
2079
2080 { # Represents an Operation resource.
2081 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002082 # Google Compute Engine has three Operation resources:
2083 #
2084 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2085 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002086 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2087 #
2088 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002089 # - For global operations, use the `globalOperations` resource.
2090 # - For regional operations, use the `regionOperations` resource.
2091 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002092 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002093 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002094 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2095 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
2096 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002097 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002098 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
2099 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002100 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2101 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002102 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002103 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002104 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002105 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002106 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2107 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2108 {
2109 "message": "A String", # [Output Only] A human-readable description of the warning code.
2110 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2111 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2112 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2113 {
2114 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2115 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2116 },
2117 ],
2118 },
2119 ],
2120 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002121 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002122 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002123 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2124 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002125 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002126 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2127 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2128 {
2129 "message": "A String", # [Output Only] An optional, human-readable error message.
2130 "code": "A String", # [Output Only] The error type identifier for this error.
2131 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2132 },
2133 ],
2134 },
2135 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2136 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002137 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002138 }</pre>
2139</div>
2140
2141<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002142 <code class="details" id="recreateInstances">recreateInstances(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002143 <pre>Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002144
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002145If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
2146
2147You can specify a maximum of 1000 instances with this method per request.
2148
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002149Args:
2150 project: string, Project ID for this request. (required)
2151 zone: string, The name of the zone where the managed instance group is located. (required)
2152 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002153 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002154 The object takes the form of:
2155
2156{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002157 "instances": [ # The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002158 "A String",
2159 ],
2160 }
2161
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002162 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2163
2164For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2165
2166The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002167
2168Returns:
2169 An object of the form:
2170
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002171 { # Represents an Operation resource.
2172 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002173 # Google Compute Engine has three Operation resources:
2174 #
2175 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2176 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002177 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2178 #
2179 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002180 # - For global operations, use the `globalOperations` resource.
2181 # - For regional operations, use the `regionOperations` resource.
2182 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002183 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002184 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002185 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002186 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002187 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002188 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002189 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002190 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002191 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2192 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002193 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002194 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002195 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002196 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002197 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2198 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2199 {
2200 "message": "A String", # [Output Only] A human-readable description of the warning code.
2201 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2202 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2203 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2204 {
2205 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2206 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2207 },
2208 ],
2209 },
2210 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002211 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002212 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002213 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002214 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2215 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002216 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002217 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2218 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2219 {
2220 "message": "A String", # [Output Only] An optional, human-readable error message.
2221 "code": "A String", # [Output Only] The error type identifier for this error.
2222 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2223 },
2224 ],
2225 },
2226 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2227 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002228 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002229 }</pre>
2230</div>
2231
2232<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002233 <code class="details" id="resize">resize(project, zone, instanceGroupManager, size, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002234 <pre>Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
2235
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002236When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including:
2237
2238+ The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance.
2239
2240This list is subject to change.
2241
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002242If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
2243
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002244Args:
2245 project: string, Project ID for this request. (required)
2246 zone: string, The name of the zone where the managed instance group is located. (required)
2247 instanceGroupManager: string, The name of the managed instance group. (required)
2248 size: integer, The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002249 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2250
2251For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2252
2253The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002254
2255Returns:
2256 An object of the form:
2257
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002258 { # Represents an Operation resource.
2259 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002260 # Google Compute Engine has three Operation resources:
2261 #
2262 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2263 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002264 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2265 #
2266 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002267 # - For global operations, use the `globalOperations` resource.
2268 # - For regional operations, use the `regionOperations` resource.
2269 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002270 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002271 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002272 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002273 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002274 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002275 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002276 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002277 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002278 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2279 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002280 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002281 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002282 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002283 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002284 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2285 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2286 {
2287 "message": "A String", # [Output Only] A human-readable description of the warning code.
2288 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2289 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2290 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2291 {
2292 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2293 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2294 },
2295 ],
2296 },
2297 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002298 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002299 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002300 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002301 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2302 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002303 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002304 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2305 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2306 {
2307 "message": "A String", # [Output Only] An optional, human-readable error message.
2308 "code": "A String", # [Output Only] The error type identifier for this error.
2309 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2310 },
2311 ],
2312 },
2313 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2314 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002315 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002316 }</pre>
2317</div>
2318
2319<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002320 <code class="details" id="resizeAdvanced">resizeAdvanced(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002321 <pre>Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.
2322
2323If you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.
2324
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002325If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
2326
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002327Args:
2328 project: string, Project ID for this request. (required)
2329 zone: string, The name of the zone where the managed instance group is located. (required)
2330 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002331 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002332 The object takes the form of:
2333
2334{
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002335 "noCreationRetries": True or False, # If this flag is true, the managed instance group attempts to create all instances initiated by this resize request only once. If there is an error during creation, the managed instance group does not retry create this instance, and we will decrease the targetSize of the request instead. If the flag is false, the group attempts to recreate each instance continuously until it succeeds.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002336 #
2337 # This flag matters only in the first attempt of creation of an instance. After an instance is successfully created while this flag is enabled, the instance behaves the same way as all the other instances created with a regular resize request. In particular, if a running instance dies unexpectedly at a later time and needs to be recreated, this mode does not affect the recreation behavior in that scenario.
2338 #
2339 # This flag is applicable only to the current resize request. It does not influence other resize requests in any way.
2340 #
2341 # You can see which instances is being creating in which mode by calling the get or listManagedInstances API.
2342 "targetSize": 42, # The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.
2343 }
2344
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002345 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2346
2347For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2348
2349The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002350
2351Returns:
2352 An object of the form:
2353
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002354 { # Represents an Operation resource.
2355 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002356 # Google Compute Engine has three Operation resources:
2357 #
2358 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2359 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002360 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2361 #
2362 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002363 # - For global operations, use the `globalOperations` resource.
2364 # - For regional operations, use the `regionOperations` resource.
2365 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002366 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002367 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002368 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002369 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002370 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002371 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002372 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002373 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002374 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2375 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002376 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002377 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002378 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002379 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002380 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2381 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2382 {
2383 "message": "A String", # [Output Only] A human-readable description of the warning code.
2384 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2385 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2386 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2387 {
2388 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2389 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2390 },
2391 ],
2392 },
2393 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002394 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002395 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002396 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002397 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2398 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002399 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002400 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2401 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2402 {
2403 "message": "A String", # [Output Only] An optional, human-readable error message.
2404 "code": "A String", # [Output Only] The error type identifier for this error.
2405 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2406 },
2407 ],
2408 },
2409 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2410 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002411 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002412 }</pre>
2413</div>
2414
2415<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002416 <code class="details" id="setAutoHealingPolicies">setAutoHealingPolicies(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002417 <pre>Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002418
2419Args:
2420 project: string, Project ID for this request. (required)
2421 zone: string, The name of the zone where the managed instance group is located. (required)
2422 instanceGroupManager: string, The name of the instance group manager. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002423 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002424 The object takes the form of:
2425
2426{
2427 "autoHealingPolicies": [
2428 {
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002429 "healthCheck": "A String", # The URL for the health check that signals autohealing.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002430 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002431 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
2432 #
2433 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
2434 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2435 #
2436 #
2437 # - If the value is fixed, then the calculated value is equal to the fixed value.
2438 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
2439 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2440 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002441 },
2442 },
2443 ],
2444 }
2445
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002446 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2447
2448For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2449
2450The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002451
2452Returns:
2453 An object of the form:
2454
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002455 { # Represents an Operation resource.
2456 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002457 # Google Compute Engine has three Operation resources:
2458 #
2459 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2460 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002461 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2462 #
2463 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002464 # - For global operations, use the `globalOperations` resource.
2465 # - For regional operations, use the `regionOperations` resource.
2466 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002467 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002468 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002469 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002470 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002471 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002472 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002473 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002474 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002475 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2476 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002477 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002478 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002479 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002480 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002481 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2482 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2483 {
2484 "message": "A String", # [Output Only] A human-readable description of the warning code.
2485 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2486 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2487 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2488 {
2489 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2490 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2491 },
2492 ],
2493 },
2494 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002495 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002496 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002497 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002498 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2499 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002500 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002501 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2502 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2503 {
2504 "message": "A String", # [Output Only] An optional, human-readable error message.
2505 "code": "A String", # [Output Only] The error type identifier for this error.
2506 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2507 },
2508 ],
2509 },
2510 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2511 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002512 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002513 }</pre>
2514</div>
2515
2516<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002517 <code class="details" id="setInstanceTemplate">setInstanceTemplate(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002518 <pre>Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.
2519
2520Args:
2521 project: string, Project ID for this request. (required)
2522 zone: string, The name of the zone where the managed instance group is located. (required)
2523 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002524 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002525 The object takes the form of:
2526
2527{
2528 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
2529 }
2530
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002531 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2532
2533For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2534
2535The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002536
2537Returns:
2538 An object of the form:
2539
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002540 { # Represents an Operation resource.
2541 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002542 # Google Compute Engine has three Operation resources:
2543 #
2544 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2545 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002546 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2547 #
2548 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002549 # - For global operations, use the `globalOperations` resource.
2550 # - For regional operations, use the `regionOperations` resource.
2551 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002552 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002553 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002554 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002555 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002556 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002557 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002558 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002559 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002560 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2561 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002562 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002563 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002564 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002565 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002566 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2567 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2568 {
2569 "message": "A String", # [Output Only] A human-readable description of the warning code.
2570 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2571 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2572 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2573 {
2574 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2575 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2576 },
2577 ],
2578 },
2579 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002580 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002581 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002582 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002583 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2584 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002585 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002586 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2587 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2588 {
2589 "message": "A String", # [Output Only] An optional, human-readable error message.
2590 "code": "A String", # [Output Only] The error type identifier for this error.
2591 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2592 },
2593 ],
2594 },
2595 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2596 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002597 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002598 }</pre>
2599</div>
2600
2601<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002602 <code class="details" id="setTargetPools">setTargetPools(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002603 <pre>Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.
2604
2605Args:
2606 project: string, Project ID for this request. (required)
2607 zone: string, The name of the zone where the managed instance group is located. (required)
2608 instanceGroupManager: string, The name of the managed instance group. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002609 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002610 The object takes the form of:
2611
2612{
2613 "targetPools": [ # The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings.
2614 "A String",
2615 ],
2616 "fingerprint": "A String", # The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.
2617 }
2618
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002619 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2620
2621For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2622
2623The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002624
2625Returns:
2626 An object of the form:
2627
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002628 { # Represents an Operation resource.
2629 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002630 # Google Compute Engine has three Operation resources:
2631 #
2632 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2633 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002634 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2635 #
2636 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002637 # - For global operations, use the `globalOperations` resource.
2638 # - For regional operations, use the `regionOperations` resource.
2639 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002640 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002641 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002642 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002643 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002644 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002645 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002646 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002647 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002648 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2649 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002650 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002651 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002652 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002653 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002654 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2655 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2656 {
2657 "message": "A String", # [Output Only] A human-readable description of the warning code.
2658 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2659 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2660 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2661 {
2662 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2663 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2664 },
2665 ],
2666 },
2667 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002668 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002669 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002670 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002671 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2672 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002673 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002674 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2675 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2676 {
2677 "message": "A String", # [Output Only] An optional, human-readable error message.
2678 "code": "A String", # [Output Only] The error type identifier for this error.
2679 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2680 },
2681 ],
2682 },
2683 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2684 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002685 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002686 }</pre>
2687</div>
2688
2689<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002690 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002691 <pre>Returns permissions that a caller has on the specified resource.
2692
2693Args:
2694 project: string, Project ID for this request. (required)
2695 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002696 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002697 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002698 The object takes the form of:
2699
2700{
2701 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2702 "A String",
2703 ],
2704 }
2705
2706
2707Returns:
2708 An object of the form:
2709
2710 {
2711 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2712 "A String",
2713 ],
2714 }</pre>
2715</div>
2716
2717<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002718 <code class="details" id="update">update(project, zone, instanceGroupManager, body=None, requestId=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002719 <pre>Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002720
2721Args:
2722 project: string, Project ID for this request. (required)
2723 zone: string, The name of the zone where you want to create the managed instance group. (required)
2724 instanceGroupManager: string, The name of the instance group manager. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002725 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002726 The object takes the form of:
2727
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002728{ # Represents a Managed Instance Group resource.
2729 #
2730 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
2731 #
2732 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
2733 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002734 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002735 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
2736 "pendingActions": { # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions.
2737 "recreating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be recreated.
2738 "deleting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be deleted.
2739 "creating": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be created.
2740 "restarting": 42, # [Deprecated] This field is deprecated and will be removed. Prefer using the status field instead. Please contact cloud-updater-feedback@google.com to leave feedback if your workload relies on this field. [Output Only] The number of instances in the managed instance group that are pending to be restarted.
2741 },
2742 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
2743 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
2744 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
2745 "serviceAccount": "A String", # The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used.
2746 "baseInstanceName": "A String", # The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.
2747 "updatePolicy": { # The update policy for this managed instance group.
2748 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
2749 "maxSurge": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
2750 #
2751 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
2752 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002753 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002754 #
2755 # - If the value is fixed, then the calculated value is equal to the fixed value.
2756 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
2757 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2758 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002759 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002760 "minimalAction": "A String", # Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
Dan O'Mearadd494642020-05-01 07:42:23 -07002761 "instanceRedistributionType": "A String", # The instance redistribution policy for regional managed instance groups. Valid values are:
2762 # - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region.
2763 # - NONE: For non-autoscaled groups, proactive redistribution is disabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002764 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:
2765 #
2766 #
2767 # - The instance's status is RUNNING.
2768 # - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.
2769 #
2770 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
2771 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2772 #
2773 #
2774 # - If the value is fixed, then the calculated value is equal to the fixed value.
2775 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
2776 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2777 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2778 },
2779 "type": "A String", # The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
2780 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
2781 },
2782 "targetPools": [ # The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
2783 "A String",
2784 ],
2785 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
2786 { # The named port. For example: .
2787 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
2788 "port": 42, # The port number, which can be a value between 1 and 65535.
2789 },
2790 ],
2791 "status": { # [Output Only] The status of this managed instance group.
2792 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
Dan O'Mearadd494642020-05-01 07:42:23 -07002793 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.
2794 "hasStatefulConfig": True or False, # [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002795 },
2796 "isStable": True or False, # [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
2797 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
2798 "isReached": True or False, # [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager.
2799 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002800 "autoscaler": "A String", # [Output Only] The URL of the Autoscaler that targets this instance group manager.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002801 },
2802 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
2803 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
2804 {
2805 "healthCheck": "A String", # The URL for the health check that signals autohealing.
2806 "initialDelaySec": 42, # The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].
2807 "maxUnavailable": { # Encapsulates numeric value that can be either absolute or relative. # Maximum number of instances that can be unavailable when autohealing. When 'percent' is used, the value is rounded UP. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's currentAction is NONE (in particular its liveness health check result was observed to be HEALTHY at least once as it passed VERIFYING). 3. There is no outgoing action on an instance triggered by IGM.
2808 #
2809 # By default, number of concurrently autohealed instances is smaller than the managed instance group target size. However, if a zonal managed instance group has only one instance, or a regional managed instance group has only one instance per zone, autohealing will recreate these instances when they become unhealthy.
2810 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2811 #
2812 #
2813 # - If the value is fixed, then the calculated value is equal to the fixed value.
2814 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
2815 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2816 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2817 },
2818 },
2819 ],
2820 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
2821 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
2822 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
2823 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.
2824 "fingerprint": "A String", # Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet.
2825 #
2826 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
2827 "currentActions": { # [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.
2828 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
2829 "recreating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
2830 "creating": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully.
2831 #
2832 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
2833 "verifying": 42, # [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
2834 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
2835 "abandoning": 42, # [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
2836 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
2837 "creatingWithoutRetries": 42, # [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
2838 "refreshing": 42, # [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
2839 },
2840 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
2841 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
2842 #
2843 # Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.
2844 {
2845 "targetSize": { # Encapsulates numeric value that can be either absolute or relative. # Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:
2846 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
2847 # - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.
2848 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2849 #
2850 #
2851 # - If the value is fixed, then the calculated value is equal to the fixed value.
2852 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
2853 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2854 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2855 },
2856 "instanceTemplate": "A String", # The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached.
2857 "tag": "A String", # Tag describing the version. Used to trigger rollout of a target version even if instance_template remains unchanged. Deprecated in favor of 'name'.
2858 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
2859 },
2860 ],
2861 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Dan O'Mearadd494642020-05-01 07:42:23 -07002862 "targetSize": 42, # The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002863 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
2864 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002865 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002866 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002867 },
2868 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07002869 "targetShape": "A String", # The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). The possible values are EVEN and ANY. For EVEN the group attempts to preserve a balanced number of instances across zones. For ANY the group creates new instances where resources are available to fulfill the request; as a result, instances may be distributed unevenly across zones in this mode. The default value is EVEN.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002870 },
2871 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002872 "preservedState": { # Configuration of preserved resources.
2873 "disks": { # Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
2874 "a_key": {
2875 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
2876 },
2877 },
2878 },
2879 },
2880 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
2881}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002882
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002883 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2884
2885For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2886
2887The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002888
2889Returns:
2890 An object of the form:
2891
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002892 { # Represents an Operation resource.
2893 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002894 # Google Compute Engine has three Operation resources:
2895 #
2896 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2897 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002898 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2899 #
2900 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002901 # - For global operations, use the `globalOperations` resource.
2902 # - For regional operations, use the `regionOperations` resource.
2903 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002904 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002905 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002906 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002907 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002908 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002909 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002910 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002911 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002912 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2913 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002914 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07002915 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002916 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002917 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002918 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2919 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2920 {
2921 "message": "A String", # [Output Only] A human-readable description of the warning code.
2922 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2923 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2924 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2925 {
2926 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2927 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2928 },
2929 ],
2930 },
2931 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002932 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002933 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002934 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002935 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2936 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002937 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
2938 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2939 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2940 {
2941 "message": "A String", # [Output Only] An optional, human-readable error message.
2942 "code": "A String", # [Output Only] The error type identifier for this error.
2943 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2944 },
2945 ],
2946 },
2947 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2948 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2949 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
2950 }</pre>
2951</div>
2952
2953<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002954 <code class="details" id="updatePerInstanceConfigs">updatePerInstanceConfigs(project, zone, instanceGroupManager, body=None, requestId=None)</code>
2955 <pre>Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002956
2957Args:
2958 project: string, Project ID for this request. (required)
2959 zone: string, The name of the zone where the managed instance group is located. It should conform to RFC1035. (required)
2960 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002961 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002962 The object takes the form of:
2963
2964{ # InstanceGroupManagers.updatePerInstanceConfigs
2965 "perInstanceConfigs": [ # The list of per-instance configs to insert or patch on this managed instance group.
2966 {
Dan O'Mearadd494642020-05-01 07:42:23 -07002967 "name": "A String", # The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error.
2968 "preservedState": { # Preserved state for a given instance. # The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002969 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
2970 "a_key": {
2971 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
2972 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
2973 "autoDelete": "A String", # These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.
2974 },
2975 },
2976 "metadata": { # Preserved metadata defined for this instance.
2977 "a_key": "A String",
2978 },
2979 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002980 "fingerprint": "A String", # Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002981 },
2982 ],
2983 }
2984
2985 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
2986
2987For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
2988
2989The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2990
2991Returns:
2992 An object of the form:
2993
2994 { # Represents an Operation resource.
2995 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002996 # Google Compute Engine has three Operation resources:
2997 #
2998 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2999 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003000 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
3001 #
3002 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07003003 # - For global operations, use the `globalOperations` resource.
3004 # - For regional operations, use the `regionOperations` resource.
3005 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003006 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003007 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003008 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
3009 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
3010 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07003011 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003012 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
3013 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07003014 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
3015 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003016 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -07003017 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003018 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07003019 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003020 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
3021 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
3022 {
3023 "message": "A String", # [Output Only] A human-readable description of the warning code.
3024 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
3025 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
3026 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
3027 {
3028 "value": "A String", # [Output Only] A warning data value corresponding to the key.
3029 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
3030 },
3031 ],
3032 },
3033 ],
3034 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07003035 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003036 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07003037 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
3038 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003039 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003040 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
3041 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
3042 {
3043 "message": "A String", # [Output Only] An optional, human-readable error message.
3044 "code": "A String", # [Output Only] The error type identifier for this error.
3045 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
3046 },
3047 ],
3048 },
3049 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
3050 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003051 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003052 }</pre>
3053</div>
3054
3055</body></html>