blob: 351ecbbbcb07eeb2fc46fa650d3c6f9830115969 [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.regionInstanceGroupManagers.html">regionInstanceGroupManagers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040078 <code><a href="#abandonInstances">abandonInstances(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Flags the specified instances to be immediately 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>
80<p class="toc_element">
81 <code><a href="#applyUpdatesToInstances">applyUpdatesToInstances(project, region, instanceGroupManager, body)</a></code></p>
82<p class="firstline">Apply updates to selected instances the managed instance group.</p>
83<p class="toc_element">
84 <code><a href="#createInstances">createInstances(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
85<p class="firstline">Creates instances with per-instance configs in this regional 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>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070086<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040087 <code><a href="#delete">delete(project, region, instanceGroupManager, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070088<p class="firstline">Deletes the specified managed instance group and all of the instances in that group.</p>
89<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040090 <code><a href="#deleteInstances">deleteInstances(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Flags the specified instances in the managed instance group to be immediately deleted. 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. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method.</p>
92<p class="toc_element">
93 <code><a href="#deletePerInstanceConfigs">deletePerInstanceConfigs(project, region, instanceGroupManager, body)</a></code></p>
94<p class="firstline">Deletes selected per-instance configs for the managed instance group.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070095<p class="toc_element">
96 <code><a href="#get">get(project, region, instanceGroupManager)</a></code></p>
97<p class="firstline">Returns all of the details about the specified managed instance group.</p>
98<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040099 <code><a href="#insert">insert(project, region, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<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 -0700101<p class="toc_element">
102 <code><a href="#list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
103<p class="firstline">Retrieves the list of managed instance groups that are contained within the specified region.</p>
104<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105 <code><a href="#listErrors">listErrors(project, region, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
106<p class="firstline">Lists all errors thrown by actions on instances for a given regional managed instance group.</p>
107<p class="toc_element">
108 <code><a href="#listErrors_next">listErrors_next(previous_request, previous_response)</a></code></p>
109<p class="firstline">Retrieves the next page of results.</p>
110<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800111 <code><a href="#listManagedInstances">listManagedInstances(project, region, instanceGroupManager, order_by=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700112<p class="firstline">Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.</p>
113<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400114 <code><a href="#listManagedInstances_next">listManagedInstances_next(previous_request, previous_response)</a></code></p>
115<p class="firstline">Retrieves the next page of results.</p>
116<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 <code><a href="#listPerInstanceConfigs">listPerInstanceConfigs(project, region, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
118<p class="firstline">Lists all of the per-instance configs defined for the managed instance group.</p>
119<p class="toc_element">
120 <code><a href="#listPerInstanceConfigs_next">listPerInstanceConfigs_next(previous_request, previous_response)</a></code></p>
121<p class="firstline">Retrieves the next page of results.</p>
122<p class="toc_element">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700123 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
124<p class="firstline">Retrieves the next page of results.</p>
125<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400126 <code><a href="#patch">patch(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700127<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>
128<p class="toc_element">
129 <code><a href="#patchPerInstanceConfigs">patchPerInstanceConfigs(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
130<p class="firstline">Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700131<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400132 <code><a href="#recreateInstances">recreateInstances(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133<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 -0700134<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400135 <code><a href="#resize">resize(project, region, instanceGroupManager, size, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136<p class="firstline">Changes the intended size of 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 one or more instances.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700137<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400138 <code><a href="#setAutoHealingPolicies">setAutoHealingPolicies(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139<p class="firstline">Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700140<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400141 <code><a href="#setInstanceTemplate">setInstanceTemplate(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700142<p class="firstline">Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.</p>
143<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400144 <code><a href="#setTargetPools">setTargetPools(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700145<p class="firstline">Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.</p>
146<p class="toc_element">
147 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body)</a></code></p>
148<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
149<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400150 <code><a href="#update">update(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700151<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 -0700152<p class="toc_element">
153 <code><a href="#updatePerInstanceConfigs">updatePerInstanceConfigs(project, region, instanceGroupManager, body, requestId=None)</a></code></p>
154<p class="firstline">Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700155<h3>Method Details</h3>
156<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400157 <code class="details" id="abandonInstances">abandonInstances(project, region, instanceGroupManager, body, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 <pre>Flags the specified instances to be immediately 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 -0700159
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400160If 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.
161
162You can specify a maximum of 1000 instances with this method per request.
163
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700164Args:
165 project: string, Project ID for this request. (required)
166 region: string, Name of the region scoping this request. (required)
167 instanceGroupManager: string, Name of the managed instance group. (required)
168 body: object, The request body. (required)
169 The object takes the form of:
170
171{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400172 "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 -0700173 "A String",
174 ],
175 }
176
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 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.
178
179For 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.
180
181The 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 -0700182
183Returns:
184 An object of the form:
185
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700186 { # Represents an Operation resource.
187 #
188 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
189 #
190 # Operations can be global, regional or zonal.
191 # - For global operations, use the globalOperations resource.
192 # - For regional operations, use the regionOperations resource.
193 # - For zonal operations, use the zonalOperations resource.
194 #
195 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700196 "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 -0700197 "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 -0400198 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700199 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700200 "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 -0700201 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
202 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
203 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
204 "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.
205 "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.
206 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
207 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
208 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
209 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
210 {
211 "message": "A String", # [Output Only] A human-readable description of the warning code.
212 "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.
213 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
214 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
215 {
216 "value": "A String", # [Output Only] A warning data value corresponding to the key.
217 "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).
218 },
219 ],
220 },
221 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700222 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700223 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
224 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
225 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
226 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700227 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
228 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
229 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
230 {
231 "message": "A String", # [Output Only] An optional, human-readable error message.
232 "code": "A String", # [Output Only] The error type identifier for this error.
233 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
234 },
235 ],
236 },
237 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
238 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
239 "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.
240 }</pre>
241</div>
242
243<div class="method">
244 <code class="details" id="applyUpdatesToInstances">applyUpdatesToInstances(project, region, instanceGroupManager, body)</code>
245 <pre>Apply updates to selected instances the managed instance group.
246
247Args:
248 project: string, Project ID for this request. (required)
249 region: string, Name of the region scoping this request, should conform to RFC1035. (required)
250 instanceGroupManager: string, The name of the managed instance group, should conform to RFC1035. (required)
251 body: object, The request body. (required)
252 The object takes the form of:
253
254{ # InstanceGroupManagers.applyUpdatesToInstances
255 "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.
256 "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].
257 "A String",
258 ],
259 "mostDisruptiveAllowedAction": "A String", # The most disruptive action that you want to perform on each instance during the update:
260 # - REPLACE: Delete the instance and create it again.
261 # - RESTART: Stop the instance and start it again.
262 # - REFRESH: Do not stop the instance.
263 # - 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.
264 "minimalAction": "A String", # The minimal action that you want to perform on each instance during the update:
265 # - REPLACE: At minimum, delete the instance and create it again.
266 # - RESTART: Stop the instance and start it again.
267 # - REFRESH: Do not stop the instance.
268 # - 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.
269 }
270
271
272Returns:
273 An object of the form:
274
275 { # Represents an Operation resource.
276 #
277 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
278 #
279 # Operations can be global, regional or zonal.
280 # - For global operations, use the globalOperations resource.
281 # - For regional operations, use the regionOperations resource.
282 # - For zonal operations, use the zonalOperations resource.
283 #
284 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
285 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
286 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
287 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
288 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
289 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
290 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
291 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
292 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
293 "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.
294 "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.
295 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
296 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
297 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
298 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
299 {
300 "message": "A String", # [Output Only] A human-readable description of the warning code.
301 "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.
302 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
303 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
304 {
305 "value": "A String", # [Output Only] A warning data value corresponding to the key.
306 "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).
307 },
308 ],
309 },
310 ],
311 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
312 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
313 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
314 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
315 "name": "A String", # [Output Only] Name of the resource.
316 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
317 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
318 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
319 {
320 "message": "A String", # [Output Only] An optional, human-readable error message.
321 "code": "A String", # [Output Only] The error type identifier for this error.
322 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
323 },
324 ],
325 },
326 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
327 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
328 "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.
329 }</pre>
330</div>
331
332<div class="method">
333 <code class="details" id="createInstances">createInstances(project, region, instanceGroupManager, body, requestId=None)</code>
334 <pre>Creates instances with per-instance configs in this regional 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.
335
336Args:
337 project: string, Project ID for this request. (required)
338 region: string, The name of the region where the managed instance group is located. It should conform to RFC1035. (required)
339 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
340 body: object, The request body. (required)
341 The object takes the form of:
342
343{ # RegionInstanceGroupManagers.createInstances
344 "instances": [ # [Required] List of specifications of per-instance configs.
345 {
346 "override": { # Overrides of stateful properties for a given instance
347 "origin": "A String", # [Output Only] Indicates where does the override come from.
348 "disks": [ # Disk overrides defined for this instance. According to documentation the maximum number of disks attached to an instance is 128: https://cloud.google.com/compute/docs/disks/ However, compute API defines the limit at 140, so this is what we check.
349 {
350 "deviceName": "A String", # The name of the device on the VM
351 "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.
352 "source": "A String", # The disk that is/will be mounted
353 },
354 ],
355 "metadata": [ # Metadata overrides defined for this instance. TODO(b/69785416) validate the total length is <9 KB
356 {
357 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).
358 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
359 },
360 ],
361 },
362 "instance": "A String", # The URL of the instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if per-instance config with the same instance URL exists then it will be updated, otherwise a new one will be created.
363 "name": "A String", # The name of the per-instance config and the corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if 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 a failure.
364 "preservedState": { # Preserved state for a given instance. # Intended preserved state for the given instance. Does not contain state generated based on Stateful Policy.
365 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
366 "a_key": {
367 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
368 "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.
369 "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.
370 },
371 },
372 "metadata": { # Preserved metadata defined for this instance.
373 "a_key": "A String",
374 },
375 },
376 "fingerprint": "A String", # Fingerprint of this per-instance config. This field may be used in optimistic locking. It will be 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.
377 },
378 ],
379 }
380
381 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.
382
383For 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.
384
385The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
386
387Returns:
388 An object of the form:
389
390 { # Represents an Operation resource.
391 #
392 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
393 #
394 # Operations can be global, regional or zonal.
395 # - For global operations, use the globalOperations resource.
396 # - For regional operations, use the regionOperations resource.
397 # - For zonal operations, use the zonalOperations resource.
398 #
399 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
400 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
401 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
402 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
403 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
404 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
405 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
406 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
407 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
408 "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.
409 "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.
410 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
411 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
412 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
413 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
414 {
415 "message": "A String", # [Output Only] A human-readable description of the warning code.
416 "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.
417 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
418 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
419 {
420 "value": "A String", # [Output Only] A warning data value corresponding to the key.
421 "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).
422 },
423 ],
424 },
425 ],
426 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
427 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
428 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
429 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
430 "name": "A String", # [Output Only] Name of the resource.
431 "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 -0700432 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
433 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
434 {
435 "message": "A String", # [Output Only] An optional, human-readable error message.
436 "code": "A String", # [Output Only] The error type identifier for this error.
437 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
438 },
439 ],
440 },
441 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
442 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800443 "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 -0700444 }</pre>
445</div>
446
447<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400448 <code class="details" id="delete">delete(project, region, instanceGroupManager, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700449 <pre>Deletes the specified managed instance group and all of the instances in that group.
450
451Args:
452 project: string, Project ID for this request. (required)
453 region: string, Name of the region scoping this request. (required)
454 instanceGroupManager: string, Name of the managed instance group to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 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.
456
457For 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.
458
459The 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 -0700460
461Returns:
462 An object of the form:
463
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700464 { # Represents an Operation resource.
465 #
466 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
467 #
468 # Operations can be global, regional or zonal.
469 # - For global operations, use the globalOperations resource.
470 # - For regional operations, use the regionOperations resource.
471 # - For zonal operations, use the zonalOperations resource.
472 #
473 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700474 "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 -0700475 "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 -0400476 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700477 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700478 "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 -0700479 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
480 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
481 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
482 "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.
483 "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.
484 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
485 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
486 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
487 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
488 {
489 "message": "A String", # [Output Only] A human-readable description of the warning code.
490 "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.
491 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
492 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
493 {
494 "value": "A String", # [Output Only] A warning data value corresponding to the key.
495 "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).
496 },
497 ],
498 },
499 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700500 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700501 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
502 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
503 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
504 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700505 "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 -0700506 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
507 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
508 {
509 "message": "A String", # [Output Only] An optional, human-readable error message.
510 "code": "A String", # [Output Only] The error type identifier for this error.
511 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
512 },
513 ],
514 },
515 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
516 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800517 "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 -0700518 }</pre>
519</div>
520
521<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400522 <code class="details" id="deleteInstances">deleteInstances(project, region, instanceGroupManager, body, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 <pre>Flags the specified instances in the managed instance group to be immediately deleted. 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. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700524
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400525If 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.
526
527You can specify a maximum of 1000 instances with this method per request.
528
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700529Args:
530 project: string, Project ID for this request. (required)
531 region: string, Name of the region scoping this request. (required)
532 instanceGroupManager: string, Name of the managed instance group. (required)
533 body: object, The request body. (required)
534 The object takes the form of:
535
536{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400537 "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 -0700538 "A String",
539 ],
540 }
541
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700542 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.
543
544For 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.
545
546The 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 -0700547
548Returns:
549 An object of the form:
550
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700551 { # Represents an Operation resource.
552 #
553 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
554 #
555 # Operations can be global, regional or zonal.
556 # - For global operations, use the globalOperations resource.
557 # - For regional operations, use the regionOperations resource.
558 # - For zonal operations, use the zonalOperations resource.
559 #
560 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700561 "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 -0700562 "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 -0400563 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700564 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700565 "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 -0700566 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
567 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
568 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
569 "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.
570 "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.
571 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
572 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
573 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
574 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
575 {
576 "message": "A String", # [Output Only] A human-readable description of the warning code.
577 "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.
578 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
579 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
580 {
581 "value": "A String", # [Output Only] A warning data value corresponding to the key.
582 "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).
583 },
584 ],
585 },
586 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700587 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700588 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
589 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
590 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
591 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700592 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
593 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
594 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
595 {
596 "message": "A String", # [Output Only] An optional, human-readable error message.
597 "code": "A String", # [Output Only] The error type identifier for this error.
598 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
599 },
600 ],
601 },
602 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
603 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
604 "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.
605 }</pre>
606</div>
607
608<div class="method">
609 <code class="details" id="deletePerInstanceConfigs">deletePerInstanceConfigs(project, region, instanceGroupManager, body)</code>
610 <pre>Deletes selected per-instance configs for the managed instance group.
611
612Args:
613 project: string, Project ID for this request. (required)
614 region: string, Name of the region scoping this request, should conform to RFC1035. (required)
615 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
616 body: object, The request body. (required)
617 The object takes the form of:
618
619{ # RegionInstanceGroupManagers.deletePerInstanceConfigs
620 "instances": [ # The list of instances for which we want to delete per-instance configs on this managed instance group.
621 "A String",
622 ],
623 "names": [ # The list of instance names for which we want to delete per-instance configs on this managed instance group.
624 "A String",
625 ],
626 }
627
628
629Returns:
630 An object of the form:
631
632 { # Represents an Operation resource.
633 #
634 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
635 #
636 # Operations can be global, regional or zonal.
637 # - For global operations, use the globalOperations resource.
638 # - For regional operations, use the regionOperations resource.
639 # - For zonal operations, use the zonalOperations resource.
640 #
641 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
642 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
643 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
644 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
645 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
646 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
647 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
648 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
649 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
650 "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.
651 "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.
652 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
653 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
654 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
655 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
656 {
657 "message": "A String", # [Output Only] A human-readable description of the warning code.
658 "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.
659 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
660 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
661 {
662 "value": "A String", # [Output Only] A warning data value corresponding to the key.
663 "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).
664 },
665 ],
666 },
667 ],
668 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
669 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
670 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
671 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
672 "name": "A String", # [Output Only] Name of the resource.
673 "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 -0700674 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
675 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
676 {
677 "message": "A String", # [Output Only] An optional, human-readable error message.
678 "code": "A String", # [Output Only] The error type identifier for this error.
679 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
680 },
681 ],
682 },
683 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
684 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800685 "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 -0700686 }</pre>
687</div>
688
689<div class="method">
690 <code class="details" id="get">get(project, region, instanceGroupManager)</code>
691 <pre>Returns all of the details about the specified managed instance group.
692
693Args:
694 project: string, Project ID for this request. (required)
695 region: string, Name of the region scoping this request. (required)
696 instanceGroupManager: string, Name of the managed instance group to return. (required)
697
698Returns:
699 An object of the form:
700
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700701 { # Represents a Managed Instance Group resource.
702 #
703 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
704 #
705 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
706 #
707 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700708 "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 -0700709 "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.
710 "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.
711 "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.
712 "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.
713 "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 -0700714 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800715 "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 -0800716 "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 -0700717 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
718 "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 -0800719 "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 -0700720 "updatePolicy": { # The update policy for this managed instance group.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700721 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
722 "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.
723 #
724 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
725 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
726 #
727 #
728 # - If the value is fixed, then the calculated value is equal to the fixed value.
729 # - 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.
730 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
731 "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 -0700732 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 "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.
734 "instanceRedistributionType": "A String",
735 "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:
736 #
737 #
738 # - The instance's status is RUNNING.
739 # - 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.
740 #
741 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
742 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
743 #
744 #
745 # - If the value is fixed, then the calculated value is equal to the fixed value.
746 # - 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.
747 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
748 "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 -0700749 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700750 "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 -0700751 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
752 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800753 "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.
754 "A String",
755 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700756 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
757 { # The named port. For example: .
758 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
759 "port": 42, # The port number, which can be a value between 1 and 65535.
760 },
761 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700762 "status": { # [Output Only] The status of this managed instance group.
763 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
764 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group is stateful, i.e. has any disks in Stateful Policy or at least one per-instance config. This is determined based on the user intent, the group may be reported as not stateful even when there is still some preserved state on managed instances.
765 },
766 "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.
767 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
768 "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.
769 },
770 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800771 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
772 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
773 {
774 "healthCheck": "A String", # The URL for the health check that signals autohealing.
775 "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 -0700776 "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.
777 #
778 # 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.
779 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
780 #
781 #
782 # - If the value is fixed, then the calculated value is equal to the fixed value.
783 # - 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.
784 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
785 "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 -0800786 },
787 },
788 ],
789 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700790 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
791 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800792 "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 -0700793 "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.
794 #
795 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800796 "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.
797 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
798 "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.
799 "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.
800 #
801 # 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 -0700802 "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 -0800803 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
804 "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.
805 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
806 "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.
807 "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.
808 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700809 "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 -0700810 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
811 #
812 # 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 -0800813 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700814 "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:
815 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
816 # - 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.
817 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
818 #
819 #
820 # - If the value is fixed, then the calculated value is equal to the fixed value.
821 # - 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.
822 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
823 "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 -0800824 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700825 "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 -0400826 "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'.
827 "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 -0800828 },
829 ],
830 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700831 "targetSize": 42, # The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.
832 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
833 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400834 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700835 "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 -0400836 },
837 ],
838 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400839 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700840 "preservedResources": { # Configuration of all preserved resources.
841 "disks": [ # Disks created on the instances that will be preserved on instance delete, resize down, etc.
842 {
843 "deviceName": "A String", # Device name of the disk to be preserved
844 },
845 ],
846 },
847 "preservedState": { # Configuration of preserved resources.
848 "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.
849 "a_key": {
850 "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.
851 },
852 },
853 },
854 },
855 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
856 }</pre>
857</div>
858
859<div class="method">
860 <code class="details" id="insert">insert(project, region, body, requestId=None)</code>
861 <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.
862
863A regional managed instance group can contain up to 2000 instances.
864
865Args:
866 project: string, Project ID for this request. (required)
867 region: string, Name of the region scoping this request. (required)
868 body: object, The request body. (required)
869 The object takes the form of:
870
871{ # Represents a Managed Instance Group resource.
872 #
873 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
874 #
875 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
876 #
877 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)
878 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
879 "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.
880 "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.
881 "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.
882 "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.
883 "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.
884 },
885 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
886 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
887 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
888 "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.
889 "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.
890 "updatePolicy": { # The update policy for this managed instance group.
891 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
892 "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.
893 #
894 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
895 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
896 #
897 #
898 # - If the value is fixed, then the calculated value is equal to the fixed value.
899 # - 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.
900 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
901 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
902 },
903 "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.
904 "instanceRedistributionType": "A String",
905 "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:
906 #
907 #
908 # - The instance's status is RUNNING.
909 # - 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.
910 #
911 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
912 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
913 #
914 #
915 # - If the value is fixed, then the calculated value is equal to the fixed value.
916 # - 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.
917 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
918 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
919 },
920 "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).
921 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
922 },
923 "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.
924 "A String",
925 ],
926 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
927 { # The named port. For example: .
928 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
929 "port": 42, # The port number, which can be a value between 1 and 65535.
930 },
931 ],
932 "status": { # [Output Only] The status of this managed instance group.
933 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
934 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group is stateful, i.e. has any disks in Stateful Policy or at least one per-instance config. This is determined based on the user intent, the group may be reported as not stateful even when there is still some preserved state on managed instances.
935 },
936 "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.
937 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
938 "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.
939 },
940 },
941 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
942 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
943 {
944 "healthCheck": "A String", # The URL for the health check that signals autohealing.
945 "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].
946 "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.
947 #
948 # 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.
949 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
950 #
951 #
952 # - If the value is fixed, then the calculated value is equal to the fixed value.
953 # - 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.
954 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
955 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
956 },
957 },
958 ],
959 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
960 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
961 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
962 "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.
963 "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.
964 #
965 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
966 "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.
967 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
968 "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.
969 "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.
970 #
971 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
972 "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.
973 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
974 "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.
975 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
976 "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.
977 "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.
978 },
979 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
980 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
981 #
982 # 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.
983 {
984 "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:
985 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
986 # - 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.
987 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
988 #
989 #
990 # - If the value is fixed, then the calculated value is equal to the fixed value.
991 # - 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.
992 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
993 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
994 },
995 "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.
996 "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'.
997 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
998 },
999 ],
1000 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
1001 "targetSize": 42, # The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.
1002 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1003 "zones": [ # Zones where the regional managed instance group will create and manage instances.
1004 {
1005 "zone": "A String", # The URL of the zone. The zone must exist in the region where the managed instance group is located.
1006 },
1007 ],
1008 },
1009 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
1010 "preservedResources": { # Configuration of all preserved resources.
1011 "disks": [ # Disks created on the instances that will be preserved on instance delete, resize down, etc.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001012 {
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001013 "deviceName": "A String", # Device name of the disk to be preserved
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001014 },
1015 ],
1016 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001017 "preservedState": { # Configuration of preserved resources.
1018 "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.
1019 "a_key": {
1020 "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.
1021 },
1022 },
1023 },
1024 },
1025 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1026}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001027
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001028 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.
1029
1030For 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.
1031
1032The 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 -07001033
1034Returns:
1035 An object of the form:
1036
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001037 { # Represents an Operation resource.
1038 #
1039 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1040 #
1041 # Operations can be global, regional or zonal.
1042 # - For global operations, use the globalOperations resource.
1043 # - For regional operations, use the regionOperations resource.
1044 # - For zonal operations, use the zonalOperations resource.
1045 #
1046 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001047 "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 -07001048 "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 -04001049 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001050 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001051 "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 -07001052 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1053 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1054 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1055 "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.
1056 "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.
1057 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1058 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1059 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1060 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1061 {
1062 "message": "A String", # [Output Only] A human-readable description of the warning code.
1063 "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.
1064 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1065 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1066 {
1067 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1068 "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).
1069 },
1070 ],
1071 },
1072 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001073 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001074 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1075 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1076 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1077 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001078 "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 -07001079 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1080 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1081 {
1082 "message": "A String", # [Output Only] An optional, human-readable error message.
1083 "code": "A String", # [Output Only] The error type identifier for this error.
1084 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1085 },
1086 ],
1087 },
1088 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1089 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001090 "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 -07001091 }</pre>
1092</div>
1093
1094<div class="method">
1095 <code class="details" id="list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1096 <pre>Retrieves the list of managed instance groups that are contained within the specified region.
1097
1098Args:
1099 project: string, Project ID for this request. (required)
1100 region: string, Name of the region scoping this request. (required)
1101 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1102
1103You 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.
1104
1105Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001106 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)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001107 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001108 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 =, !=, >, or <.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001109
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110For 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 -07001111
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001112You 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 -07001113
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001114To 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 -07001115
1116Returns:
1117 An object of the form:
1118
1119 { # Contains a list of managed instance groups.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001120 "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.
1121 "kind": "compute#regionInstanceGroupManagerList", # [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope.
1122 "items": [ # A list of InstanceGroupManager resources.
1123 { # Represents a Managed Instance Group resource.
1124 #
1125 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
1126 #
1127 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
1128 #
1129 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)
1130 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
1131 "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.
1132 "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.
1133 "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.
1134 "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.
1135 "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.
1136 },
1137 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
1138 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
1139 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
1140 "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.
1141 "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.
1142 "updatePolicy": { # The update policy for this managed instance group.
1143 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
1144 "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.
1145 #
1146 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
1147 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001148 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001149 #
1150 # - If the value is fixed, then the calculated value is equal to the fixed value.
1151 # - 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.
1152 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1153 "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 -08001154 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001155 "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.
1156 "instanceRedistributionType": "A String",
1157 "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:
1158 #
1159 #
1160 # - The instance's status is RUNNING.
1161 # - 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.
1162 #
1163 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
1164 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1165 #
1166 #
1167 # - If the value is fixed, then the calculated value is equal to the fixed value.
1168 # - 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.
1169 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1170 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1171 },
1172 "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).
1173 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1174 },
1175 "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.
1176 "A String",
1177 ],
1178 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1179 { # The named port. For example: .
1180 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1181 "port": 42, # The port number, which can be a value between 1 and 65535.
1182 },
1183 ],
1184 "status": { # [Output Only] The status of this managed instance group.
1185 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
1186 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group is stateful, i.e. has any disks in Stateful Policy or at least one per-instance config. This is determined based on the user intent, the group may be reported as not stateful even when there is still some preserved state on managed instances.
1187 },
1188 "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.
1189 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1190 "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.
1191 },
1192 },
1193 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1194 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1195 {
1196 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1197 "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].
1198 "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.
1199 #
1200 # 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.
1201 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1202 #
1203 #
1204 # - If the value is fixed, then the calculated value is equal to the fixed value.
1205 # - 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.
1206 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1207 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1208 },
1209 },
1210 ],
1211 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
1212 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1213 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1214 "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.
1215 "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.
1216 #
1217 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
1218 "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.
1219 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1220 "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.
1221 "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.
1222 #
1223 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
1224 "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.
1225 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1226 "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.
1227 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1228 "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.
1229 "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.
1230 },
1231 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
1232 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1233 #
1234 # 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.
1235 {
1236 "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:
1237 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1238 # - 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.
1239 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1240 #
1241 #
1242 # - If the value is fixed, then the calculated value is equal to the fixed value.
1243 # - 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.
1244 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1245 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1246 },
1247 "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.
1248 "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'.
1249 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
1250 },
1251 ],
1252 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
1253 "targetSize": 42, # The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.
1254 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1255 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001256 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001257 "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 -08001258 },
1259 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001260 },
1261 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
1262 "preservedResources": { # Configuration of all preserved resources.
1263 "disks": [ # Disks created on the instances that will be preserved on instance delete, resize down, etc.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001264 {
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001265 "deviceName": "A String", # Device name of the disk to be preserved
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001266 },
1267 ],
1268 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001269 "preservedState": { # Configuration of preserved resources.
1270 "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.
1271 "a_key": {
1272 "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.
1273 },
1274 },
1275 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001276 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001277 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1278 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001279 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001280 "warning": { # [Output Only] Informational warning message.
1281 "message": "A String", # [Output Only] A human-readable description of the warning code.
1282 "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.
1283 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1284 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1285 {
1286 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1287 "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).
1288 },
1289 ],
1290 },
1291 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
1292 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001293 }</pre>
1294</div>
1295
1296<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001297 <code class="details" id="listErrors">listErrors(project, region, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1298 <pre>Lists all errors thrown by actions on instances for a given regional managed instance group.
1299
1300Args:
1301 project: string, Project ID for this request. (required)
1302 region: string, Name of the region scoping this request. This should conform to RFC1035. (required)
1303 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)
1304 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1305
1306You 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.
1307
1308Currently, only sorting by name or creationTimestamp desc is supported.
1309 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)
1310 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.
1311 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 =, !=, >, or <.
1312
1313For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
1314
1315You 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.
1316
1317To 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).
1318
1319Returns:
1320 An object of the form:
1321
1322 {
1323 "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.
1324 "items": [ # [Output Only] The list of errors of the managed instance group.
1325 {
1326 "timestamp": "A String", # [Output Only] The time that this error occurred. This value is in RFC3339 text format.
1327 "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.
1328 "action": "A String", # [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values:
1329 "instance": "A String", # [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created.
1330 "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.
1331 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
1332 "name": "A String", # [Output Only] Name of the version.
1333 },
1334 },
1335 "error": { # [Output Only] Contents of the error.
1336 "message": "A String", # [Output Only] Error message.
1337 "code": "A String", # [Output Only] Error code.
1338 },
1339 },
1340 ],
1341 }</pre>
1342</div>
1343
1344<div class="method">
1345 <code class="details" id="listErrors_next">listErrors_next(previous_request, previous_response)</code>
1346 <pre>Retrieves the next page of results.
1347
1348Args:
1349 previous_request: The request for the previous page. (required)
1350 previous_response: The response from the request for the previous page. (required)
1351
1352Returns:
1353 A request object that you can call 'execute()' on to request the next
1354 page. Returns None if there are no more items in the collection.
1355 </pre>
1356</div>
1357
1358<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001359 <code class="details" id="listManagedInstances">listManagedInstances(project, region, instanceGroupManager, order_by=None, maxResults=None, pageToken=None, filter=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001360 <pre>Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.
1361
1362Args:
1363 project: string, Project ID for this request. (required)
1364 region: string, Name of the region scoping this request. (required)
1365 instanceGroupManager: string, The name of the managed instance group. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001366 order_by: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1367
1368You 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.
1369
1370Currently, only sorting by name or creationTimestamp desc is supported.
1371 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)
1372 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.
1373 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 =, !=, >, or <.
1374
1375For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
1376
1377You 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.
1378
1379To 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 -07001380
1381Returns:
1382 An object of the form:
1383
1384 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001385 "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 -07001386 "managedInstances": [ # A list of managed instances.
1387 { # A Managed Instance resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001388 "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 -04001389 "version": { # [Output Only] Intended version of this instance.
1390 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
1391 "name": "A String", # [Output Only] Name of the version.
1392 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001393 "instanceHealth": [ # [Output Only] Health state of the instance per health-check.
1394 {
1395 "healthCheck": "A String", # [Output Only] The URL for the health check that verifies whether the instance is healthy.
1396 "detailedHealthState": "A String", # [Output Only] The current detailed instance health state.
1397 "healthState": "A String", # [Output Only] The current instance health state.
1398 },
1399 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001400 "lastAttempt": { # [Output Only] Information about the last attempt to create or delete the instance.
1401 "errors": { # [Output Only] Encountered errors during the last attempt to create or delete the instance.
1402 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1403 {
1404 "message": "A String", # [Output Only] An optional, human-readable error message.
1405 "code": "A String", # [Output Only] The error type identifier for this error.
1406 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1407 },
1408 ],
1409 },
1410 },
1411 "tag": "A String", # [Output Only] Tag describing the version.
1412 "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 -07001413 "preservedStateFromPolicy": { # Preserved state for a given instance. # [Output Only] Preserved state generated based on stateful policy for this instance.
1414 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1415 "a_key": {
1416 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1417 "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.
1418 "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.
1419 },
1420 },
1421 "metadata": { # Preserved metadata defined for this instance.
1422 "a_key": "A String",
1423 },
1424 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001425 "instanceTemplate": "A String", # [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001426 "override": { # Overrides of stateful properties for a given instance # [Output Only] Override defined for this instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001427 "origin": "A String", # [Output Only] Indicates where does the override come from.
1428 "disks": [ # Disk overrides defined for this instance. According to documentation the maximum number of disks attached to an instance is 128: https://cloud.google.com/compute/docs/disks/ However, compute API defines the limit at 140, so this is what we check.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001429 {
1430 "deviceName": "A String", # The name of the device on the VM
1431 "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.
1432 "source": "A String", # The disk that is/will be mounted
1433 },
1434 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001435 "metadata": [ # Metadata overrides defined for this instance. TODO(b/69785416) validate the total length is <9 KB
1436 {
1437 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).
1438 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
1439 },
1440 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001441 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001442 "currentAction": "A String", # [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values:
1443 # - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance.
1444 # - 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.
1445 # - 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.
1446 # - RECREATING The managed instance group is recreating this instance.
1447 # - DELETING The managed instance group is permanently deleting this instance.
1448 # - 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.
1449 # - RESTARTING The managed instance group is restarting the instance.
1450 # - 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 -07001451 # - VERIFYING The managed instance group has created the instance and it is in the process of being verified.
1452 "preservedStateFromConfig": { # Preserved state for a given instance. # [Output Only] Preserved state applied from per-instance config for this instance.
1453 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1454 "a_key": {
1455 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1456 "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.
1457 "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.
1458 },
1459 },
1460 "metadata": { # Preserved metadata defined for this instance.
1461 "a_key": "A String",
1462 },
1463 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001464 "id": "A String", # [Output only] The unique identifier for this resource. This field is empty when instance does not exist.
1465 },
1466 ],
1467 }</pre>
1468</div>
1469
1470<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001471 <code class="details" id="listManagedInstances_next">listManagedInstances_next(previous_request, previous_response)</code>
1472 <pre>Retrieves the next page of results.
1473
1474Args:
1475 previous_request: The request for the previous page. (required)
1476 previous_response: The response from the request for the previous page. (required)
1477
1478Returns:
1479 A request object that you can call 'execute()' on to request the next
1480 page. Returns None if there are no more items in the collection.
1481 </pre>
1482</div>
1483
1484<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001485 <code class="details" id="listPerInstanceConfigs">listPerInstanceConfigs(project, region, instanceGroupManager, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1486 <pre>Lists all of the per-instance configs defined for the managed instance group.
1487
1488Args:
1489 project: string, Project ID for this request. (required)
1490 region: string, Name of the region scoping this request, should conform to RFC1035. (required)
1491 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
1492 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1493
1494You 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.
1495
1496Currently, only sorting by name or creationTimestamp desc is supported.
1497 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)
1498 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.
1499 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 =, !=, >, or <.
1500
1501For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
1502
1503You 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.
1504
1505To 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).
1506
1507Returns:
1508 An object of the form:
1509
1510 {
1511 "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.
1512 "items": [ # [Output Only] The list of PerInstanceConfig.
1513 {
1514 "override": { # Overrides of stateful properties for a given instance
1515 "origin": "A String", # [Output Only] Indicates where does the override come from.
1516 "disks": [ # Disk overrides defined for this instance. According to documentation the maximum number of disks attached to an instance is 128: https://cloud.google.com/compute/docs/disks/ However, compute API defines the limit at 140, so this is what we check.
1517 {
1518 "deviceName": "A String", # The name of the device on the VM
1519 "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.
1520 "source": "A String", # The disk that is/will be mounted
1521 },
1522 ],
1523 "metadata": [ # Metadata overrides defined for this instance. TODO(b/69785416) validate the total length is <9 KB
1524 {
1525 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).
1526 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
1527 },
1528 ],
1529 },
1530 "instance": "A String", # The URL of the instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if per-instance config with the same instance URL exists then it will be updated, otherwise a new one will be created.
1531 "name": "A String", # The name of the per-instance config and the corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if 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 a failure.
1532 "preservedState": { # Preserved state for a given instance. # Intended preserved state for the given instance. Does not contain state generated based on Stateful Policy.
1533 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1534 "a_key": {
1535 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1536 "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.
1537 "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.
1538 },
1539 },
1540 "metadata": { # Preserved metadata defined for this instance.
1541 "a_key": "A String",
1542 },
1543 },
1544 "fingerprint": "A String", # Fingerprint of this per-instance config. This field may be used in optimistic locking. It will be 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.
1545 },
1546 ],
1547 "warning": { # [Output Only] Informational warning message.
1548 "message": "A String", # [Output Only] A human-readable description of the warning code.
1549 "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.
1550 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1551 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1552 {
1553 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1554 "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).
1555 },
1556 ],
1557 },
1558 }</pre>
1559</div>
1560
1561<div class="method">
1562 <code class="details" id="listPerInstanceConfigs_next">listPerInstanceConfigs_next(previous_request, previous_response)</code>
1563 <pre>Retrieves the next page of results.
1564
1565Args:
1566 previous_request: The request for the previous page. (required)
1567 previous_response: The response from the request for the previous page. (required)
1568
1569Returns:
1570 A request object that you can call 'execute()' on to request the next
1571 page. Returns None if there are no more items in the collection.
1572 </pre>
1573</div>
1574
1575<div class="method">
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001576 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1577 <pre>Retrieves the next page of results.
1578
1579Args:
1580 previous_request: The request for the previous page. (required)
1581 previous_response: The response from the request for the previous page. (required)
1582
1583Returns:
1584 A request object that you can call 'execute()' on to request the next
1585 page. Returns None if there are no more items in the collection.
1586 </pre>
1587</div>
1588
1589<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001590 <code class="details" id="patch">patch(project, region, instanceGroupManager, body, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001591 <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 -07001592
1593Args:
1594 project: string, Project ID for this request. (required)
1595 region: string, Name of the region scoping this request. (required)
1596 instanceGroupManager: string, The name of the instance group manager. (required)
1597 body: object, The request body. (required)
1598 The object takes the form of:
1599
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001600{ # Represents a Managed Instance Group resource.
1601 #
1602 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
1603 #
1604 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
1605 #
1606 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)
1607 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
1608 "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.
1609 "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.
1610 "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.
1611 "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.
1612 "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.
1613 },
1614 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
1615 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
1616 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
1617 "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.
1618 "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.
1619 "updatePolicy": { # The update policy for this managed instance group.
1620 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
1621 "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.
1622 #
1623 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
1624 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001625 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001626 #
1627 # - If the value is fixed, then the calculated value is equal to the fixed value.
1628 # - 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.
1629 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1630 "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 -08001631 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001632 "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.
1633 "instanceRedistributionType": "A String",
1634 "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:
1635 #
1636 #
1637 # - The instance's status is RUNNING.
1638 # - 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.
1639 #
1640 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
1641 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1642 #
1643 #
1644 # - If the value is fixed, then the calculated value is equal to the fixed value.
1645 # - 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.
1646 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1647 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1648 },
1649 "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).
1650 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
1651 },
1652 "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.
1653 "A String",
1654 ],
1655 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
1656 { # The named port. For example: .
1657 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
1658 "port": 42, # The port number, which can be a value between 1 and 65535.
1659 },
1660 ],
1661 "status": { # [Output Only] The status of this managed instance group.
1662 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
1663 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group is stateful, i.e. has any disks in Stateful Policy or at least one per-instance config. This is determined based on the user intent, the group may be reported as not stateful even when there is still some preserved state on managed instances.
1664 },
1665 "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.
1666 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
1667 "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.
1668 },
1669 },
1670 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1671 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
1672 {
1673 "healthCheck": "A String", # The URL for the health check that signals autohealing.
1674 "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].
1675 "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.
1676 #
1677 # 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.
1678 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1679 #
1680 #
1681 # - If the value is fixed, then the calculated value is equal to the fixed value.
1682 # - 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.
1683 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1684 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1685 },
1686 },
1687 ],
1688 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
1689 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
1690 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1691 "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.
1692 "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.
1693 #
1694 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
1695 "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.
1696 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
1697 "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.
1698 "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.
1699 #
1700 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
1701 "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.
1702 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
1703 "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.
1704 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
1705 "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.
1706 "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.
1707 },
1708 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
1709 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
1710 #
1711 # 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.
1712 {
1713 "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:
1714 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
1715 # - 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.
1716 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1717 #
1718 #
1719 # - If the value is fixed, then the calculated value is equal to the fixed value.
1720 # - 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.
1721 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1722 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1723 },
1724 "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.
1725 "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'.
1726 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
1727 },
1728 ],
1729 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
1730 "targetSize": 42, # The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.
1731 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
1732 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001733 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001734 "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 -08001735 },
1736 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001737 },
1738 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
1739 "preservedResources": { # Configuration of all preserved resources.
1740 "disks": [ # Disks created on the instances that will be preserved on instance delete, resize down, etc.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001741 {
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001742 "deviceName": "A String", # Device name of the disk to be preserved
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001743 },
1744 ],
1745 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001746 "preservedState": { # Configuration of preserved resources.
1747 "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.
1748 "a_key": {
1749 "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.
1750 },
1751 },
1752 },
1753 },
1754 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
1755}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001756
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001757 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.
1758
1759For 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.
1760
1761The 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 -07001762
1763Returns:
1764 An object of the form:
1765
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001766 { # Represents an Operation resource.
1767 #
1768 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1769 #
1770 # Operations can be global, regional or zonal.
1771 # - For global operations, use the globalOperations resource.
1772 # - For regional operations, use the regionOperations resource.
1773 # - For zonal operations, use the zonalOperations resource.
1774 #
1775 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001776 "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 -07001777 "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 -04001778 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001779 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001780 "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 -07001781 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1782 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1783 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1784 "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.
1785 "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.
1786 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1787 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1788 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1789 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1790 {
1791 "message": "A String", # [Output Only] A human-readable description of the warning code.
1792 "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.
1793 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1794 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1795 {
1796 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1797 "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).
1798 },
1799 ],
1800 },
1801 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001802 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001803 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1804 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1805 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1806 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001807 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1808 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1809 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1810 {
1811 "message": "A String", # [Output Only] An optional, human-readable error message.
1812 "code": "A String", # [Output Only] The error type identifier for this error.
1813 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1814 },
1815 ],
1816 },
1817 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1818 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1819 "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.
1820 }</pre>
1821</div>
1822
1823<div class="method">
1824 <code class="details" id="patchPerInstanceConfigs">patchPerInstanceConfigs(project, region, instanceGroupManager, body, requestId=None)</code>
1825 <pre>Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.
1826
1827Args:
1828 project: string, Project ID for this request. (required)
1829 region: string, Name of the region scoping this request, should conform to RFC1035. (required)
1830 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
1831 body: object, The request body. (required)
1832 The object takes the form of:
1833
1834{ # RegionInstanceGroupManagers.patchPerInstanceConfigs
1835 "perInstanceConfigs": [ # The list of per-instance configs to insert or patch on this managed instance group.
1836 {
1837 "override": { # Overrides of stateful properties for a given instance
1838 "origin": "A String", # [Output Only] Indicates where does the override come from.
1839 "disks": [ # Disk overrides defined for this instance. According to documentation the maximum number of disks attached to an instance is 128: https://cloud.google.com/compute/docs/disks/ However, compute API defines the limit at 140, so this is what we check.
1840 {
1841 "deviceName": "A String", # The name of the device on the VM
1842 "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.
1843 "source": "A String", # The disk that is/will be mounted
1844 },
1845 ],
1846 "metadata": [ # Metadata overrides defined for this instance. TODO(b/69785416) validate the total length is <9 KB
1847 {
1848 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).
1849 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
1850 },
1851 ],
1852 },
1853 "instance": "A String", # The URL of the instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if per-instance config with the same instance URL exists then it will be updated, otherwise a new one will be created.
1854 "name": "A String", # The name of the per-instance config and the corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if 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 a failure.
1855 "preservedState": { # Preserved state for a given instance. # Intended preserved state for the given instance. Does not contain state generated based on Stateful Policy.
1856 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
1857 "a_key": {
1858 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
1859 "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.
1860 "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.
1861 },
1862 },
1863 "metadata": { # Preserved metadata defined for this instance.
1864 "a_key": "A String",
1865 },
1866 },
1867 "fingerprint": "A String", # Fingerprint of this per-instance config. This field may be used in optimistic locking. It will be 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.
1868 },
1869 ],
1870 }
1871
1872 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.
1873
1874For 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.
1875
1876The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1877
1878Returns:
1879 An object of the form:
1880
1881 { # Represents an Operation resource.
1882 #
1883 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1884 #
1885 # Operations can be global, regional or zonal.
1886 # - For global operations, use the globalOperations resource.
1887 # - For regional operations, use the regionOperations resource.
1888 # - For zonal operations, use the zonalOperations resource.
1889 #
1890 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
1891 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1892 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1893 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
1894 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1895 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
1896 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1897 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1898 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1899 "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.
1900 "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.
1901 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1902 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1903 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1904 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1905 {
1906 "message": "A String", # [Output Only] A human-readable description of the warning code.
1907 "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.
1908 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1909 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1910 {
1911 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1912 "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).
1913 },
1914 ],
1915 },
1916 ],
1917 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
1918 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1919 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1920 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1921 "name": "A String", # [Output Only] Name of the resource.
1922 "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 -07001923 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1924 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1925 {
1926 "message": "A String", # [Output Only] An optional, human-readable error message.
1927 "code": "A String", # [Output Only] The error type identifier for this error.
1928 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1929 },
1930 ],
1931 },
1932 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1933 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001934 "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 -07001935 }</pre>
1936</div>
1937
1938<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001939 <code class="details" id="recreateInstances">recreateInstances(project, region, instanceGroupManager, body, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001940 <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 -07001941
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001942If 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.
1943
1944You can specify a maximum of 1000 instances with this method per request.
1945
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001946Args:
1947 project: string, Project ID for this request. (required)
1948 region: string, Name of the region scoping this request. (required)
1949 instanceGroupManager: string, Name of the managed instance group. (required)
1950 body: object, The request body. (required)
1951 The object takes the form of:
1952
1953{
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001954 "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 -07001955 "A String",
1956 ],
1957 }
1958
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001959 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.
1960
1961For 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.
1962
1963The 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 -07001964
1965Returns:
1966 An object of the form:
1967
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001968 { # Represents an Operation resource.
1969 #
1970 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1971 #
1972 # Operations can be global, regional or zonal.
1973 # - For global operations, use the globalOperations resource.
1974 # - For regional operations, use the regionOperations resource.
1975 # - For zonal operations, use the zonalOperations resource.
1976 #
1977 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001978 "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 -07001979 "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 -04001980 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001981 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001982 "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 -07001983 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1984 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1985 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1986 "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.
1987 "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.
1988 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1989 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1990 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1991 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1992 {
1993 "message": "A String", # [Output Only] A human-readable description of the warning code.
1994 "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.
1995 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1996 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1997 {
1998 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1999 "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).
2000 },
2001 ],
2002 },
2003 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002004 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002005 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2006 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2007 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2008 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002009 "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 -07002010 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2011 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2012 {
2013 "message": "A String", # [Output Only] An optional, human-readable error message.
2014 "code": "A String", # [Output Only] The error type identifier for this error.
2015 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2016 },
2017 ],
2018 },
2019 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2020 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002021 "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 -07002022 }</pre>
2023</div>
2024
2025<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002026 <code class="details" id="resize">resize(project, region, instanceGroupManager, size, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002027 <pre>Changes the intended size of 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 one or more instances.
2028
2029The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002030
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002031If 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.
2032
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002033Args:
2034 project: string, Project ID for this request. (required)
2035 region: string, Name of the region scoping this request. (required)
2036 instanceGroupManager: string, Name of the managed instance group. (required)
2037 size: integer, Number of instances that should exist in this instance group manager. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002038 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.
2039
2040For 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.
2041
2042The 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 -07002043
2044Returns:
2045 An object of the form:
2046
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002047 { # Represents an Operation resource.
2048 #
2049 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2050 #
2051 # Operations can be global, regional or zonal.
2052 # - For global operations, use the globalOperations resource.
2053 # - For regional operations, use the regionOperations resource.
2054 # - For zonal operations, use the zonalOperations resource.
2055 #
2056 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002057 "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 -07002058 "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 -04002059 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002060 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002061 "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 -07002062 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2063 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2064 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2065 "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.
2066 "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.
2067 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2068 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2069 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2070 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2071 {
2072 "message": "A String", # [Output Only] A human-readable description of the warning code.
2073 "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.
2074 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2075 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2076 {
2077 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2078 "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).
2079 },
2080 ],
2081 },
2082 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002083 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002084 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2085 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2086 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2087 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002088 "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 -07002089 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2090 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2091 {
2092 "message": "A String", # [Output Only] An optional, human-readable error message.
2093 "code": "A String", # [Output Only] The error type identifier for this error.
2094 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2095 },
2096 ],
2097 },
2098 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2099 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002100 "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 -07002101 }</pre>
2102</div>
2103
2104<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002105 <code class="details" id="setAutoHealingPolicies">setAutoHealingPolicies(project, region, instanceGroupManager, body, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002106 <pre>Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002107
2108Args:
2109 project: string, Project ID for this request. (required)
2110 region: string, Name of the region scoping this request. (required)
2111 instanceGroupManager: string, Name of the managed instance group. (required)
2112 body: object, The request body. (required)
2113 The object takes the form of:
2114
2115{
2116 "autoHealingPolicies": [
2117 {
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002118 "healthCheck": "A String", # The URL for the health check that signals autohealing.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002119 "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 -07002120 "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.
2121 #
2122 # 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.
2123 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2124 #
2125 #
2126 # - If the value is fixed, then the calculated value is equal to the fixed value.
2127 # - 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.
2128 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2129 "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 -07002130 },
2131 },
2132 ],
2133 }
2134
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002135 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.
2136
2137For 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.
2138
2139The 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 -07002140
2141Returns:
2142 An object of the form:
2143
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002144 { # Represents an Operation resource.
2145 #
2146 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2147 #
2148 # Operations can be global, regional or zonal.
2149 # - For global operations, use the globalOperations resource.
2150 # - For regional operations, use the regionOperations resource.
2151 # - For zonal operations, use the zonalOperations resource.
2152 #
2153 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002154 "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 -07002155 "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 -04002156 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002157 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002158 "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 -07002159 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2160 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2161 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2162 "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.
2163 "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.
2164 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2165 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2166 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2167 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2168 {
2169 "message": "A String", # [Output Only] A human-readable description of the warning code.
2170 "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.
2171 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2172 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2173 {
2174 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2175 "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).
2176 },
2177 ],
2178 },
2179 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002180 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002181 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2182 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2183 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2184 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002185 "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 -07002186 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2187 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2188 {
2189 "message": "A String", # [Output Only] An optional, human-readable error message.
2190 "code": "A String", # [Output Only] The error type identifier for this error.
2191 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2192 },
2193 ],
2194 },
2195 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2196 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002197 "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 -07002198 }</pre>
2199</div>
2200
2201<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002202 <code class="details" id="setInstanceTemplate">setInstanceTemplate(project, region, instanceGroupManager, body, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002203 <pre>Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.
2204
2205Args:
2206 project: string, Project ID for this request. (required)
2207 region: string, Name of the region scoping this request. (required)
2208 instanceGroupManager: string, The name of the managed instance group. (required)
2209 body: object, The request body. (required)
2210 The object takes the form of:
2211
2212{
2213 "instanceTemplate": "A String", # URL of the InstanceTemplate resource from which all new instances will be created.
2214 }
2215
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002216 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.
2217
2218For 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.
2219
2220The 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 -07002221
2222Returns:
2223 An object of the form:
2224
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002225 { # Represents an Operation resource.
2226 #
2227 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2228 #
2229 # Operations can be global, regional or zonal.
2230 # - For global operations, use the globalOperations resource.
2231 # - For regional operations, use the regionOperations resource.
2232 # - For zonal operations, use the zonalOperations resource.
2233 #
2234 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002235 "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 -07002236 "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 -04002237 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002238 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002239 "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 -07002240 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2241 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2242 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2243 "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.
2244 "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.
2245 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2246 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2247 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2248 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2249 {
2250 "message": "A String", # [Output Only] A human-readable description of the warning code.
2251 "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.
2252 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2253 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2254 {
2255 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2256 "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).
2257 },
2258 ],
2259 },
2260 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002261 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002262 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2263 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2264 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2265 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002266 "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 -07002267 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2268 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2269 {
2270 "message": "A String", # [Output Only] An optional, human-readable error message.
2271 "code": "A String", # [Output Only] The error type identifier for this error.
2272 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2273 },
2274 ],
2275 },
2276 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2277 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002278 "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 -07002279 }</pre>
2280</div>
2281
2282<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002283 <code class="details" id="setTargetPools">setTargetPools(project, region, instanceGroupManager, body, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002284 <pre>Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
2285
2286Args:
2287 project: string, Project ID for this request. (required)
2288 region: string, Name of the region scoping this request. (required)
2289 instanceGroupManager: string, Name of the managed instance group. (required)
2290 body: object, The request body. (required)
2291 The object takes the form of:
2292
2293{
2294 "targetPools": [ # The URL of 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.
2295 "A String",
2296 ],
2297 "fingerprint": "A String", # Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional.
2298 }
2299
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002300 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.
2301
2302For 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.
2303
2304The 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 -07002305
2306Returns:
2307 An object of the form:
2308
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002309 { # Represents an Operation resource.
2310 #
2311 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2312 #
2313 # Operations can be global, regional or zonal.
2314 # - For global operations, use the globalOperations resource.
2315 # - For regional operations, use the regionOperations resource.
2316 # - For zonal operations, use the zonalOperations resource.
2317 #
2318 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002319 "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 -07002320 "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 -04002321 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002322 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002323 "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 -07002324 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2325 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2326 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2327 "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.
2328 "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.
2329 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2330 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2331 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2332 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2333 {
2334 "message": "A String", # [Output Only] A human-readable description of the warning code.
2335 "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.
2336 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2337 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2338 {
2339 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2340 "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).
2341 },
2342 ],
2343 },
2344 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002345 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002346 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2347 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2348 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2349 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002350 "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 -07002351 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2352 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2353 {
2354 "message": "A String", # [Output Only] An optional, human-readable error message.
2355 "code": "A String", # [Output Only] The error type identifier for this error.
2356 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2357 },
2358 ],
2359 },
2360 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2361 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002362 "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 -07002363 }</pre>
2364</div>
2365
2366<div class="method">
2367 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body)</code>
2368 <pre>Returns permissions that a caller has on the specified resource.
2369
2370Args:
2371 project: string, Project ID for this request. (required)
2372 region: string, The name of the region for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002373 resource: string, Name or id of the resource for this request. (required)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002374 body: object, The request body. (required)
2375 The object takes the form of:
2376
2377{
2378 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2379 "A String",
2380 ],
2381 }
2382
2383
2384Returns:
2385 An object of the form:
2386
2387 {
2388 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2389 "A String",
2390 ],
2391 }</pre>
2392</div>
2393
2394<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002395 <code class="details" id="update">update(project, region, instanceGroupManager, body, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002396 <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.
2397
2398Args:
2399 project: string, Project ID for this request. (required)
2400 region: string, Name of the region scoping this request. (required)
2401 instanceGroupManager: string, The name of the instance group manager. (required)
2402 body: object, The request body. (required)
2403 The object takes the form of:
2404
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002405{ # Represents a Managed Instance Group resource.
2406 #
2407 # An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups.
2408 #
2409 # For zonal Managed Instance Group, use the instanceGroupManagers resource.
2410 #
2411 # For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)
2412 "failoverAction": "A String", # The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
2413 "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.
2414 "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.
2415 "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.
2416 "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.
2417 "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.
2418 },
2419 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this managed instance group in RFC3339 text format.
2420 "id": "A String", # [Output Only] A unique identifier for this resource type. The server generates this identifier.
2421 "zone": "A String", # [Output Only] The URL of the zone where the managed instance group is located (for zonal resources).
2422 "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.
2423 "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.
2424 "updatePolicy": { # The update policy for this managed instance group.
2425 "replacementMethod": "A String", # What action should be used to replace instances. See minimal_action.REPLACE
2426 "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.
2427 #
2428 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge.
2429 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002430 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002431 #
2432 # - If the value is fixed, then the calculated value is equal to the fixed value.
2433 # - 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.
2434 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2435 "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 -08002436 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002437 "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.
2438 "instanceRedistributionType": "A String",
2439 "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:
2440 #
2441 #
2442 # - The instance's status is RUNNING.
2443 # - 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.
2444 #
2445 # At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable.
2446 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2447 #
2448 #
2449 # - If the value is fixed, then the calculated value is equal to the fixed value.
2450 # - 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.
2451 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2452 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2453 },
2454 "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).
2455 "minReadySec": 42, # Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].
2456 },
2457 "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.
2458 "A String",
2459 ],
2460 "namedPorts": [ # Named ports configured for the Instance Groups complementary to this Instance Group Manager.
2461 { # The named port. For example: .
2462 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
2463 "port": 42, # The port number, which can be a value between 1 and 65535.
2464 },
2465 ],
2466 "status": { # [Output Only] The status of this managed instance group.
2467 "stateful": { # [Output Only] Stateful status of the given Instance Group Manager.
2468 "isStateful": True or False, # [Output Only] A bit indicating whether the managed instance group is stateful, i.e. has any disks in Stateful Policy or at least one per-instance config. This is determined based on the user intent, the group may be reported as not stateful even when there is still some preserved state on managed instances.
2469 },
2470 "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.
2471 "versionTarget": { # [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager.
2472 "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.
2473 },
2474 },
2475 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
2476 "autoHealingPolicies": [ # The autohealing policy for this managed instance group. You can specify only one value.
2477 {
2478 "healthCheck": "A String", # The URL for the health check that signals autohealing.
2479 "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].
2480 "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.
2481 #
2482 # 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.
2483 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2484 #
2485 #
2486 # - If the value is fixed, then the calculated value is equal to the fixed value.
2487 # - 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.
2488 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2489 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2490 },
2491 },
2492 ],
2493 "instanceGroup": "A String", # [Output Only] The URL of the Instance Group resource.
2494 "kind": "compute#instanceGroupManager", # [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.
2495 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
2496 "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.
2497 "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.
2498 #
2499 # To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
2500 "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.
2501 "none": 42, # [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.
2502 "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.
2503 "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.
2504 #
2505 # If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
2506 "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.
2507 "restarting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
2508 "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.
2509 "deleting": 42, # [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
2510 "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.
2511 "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.
2512 },
2513 "name": "A String", # The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.
2514 "versions": [ # Specifies the instance templates used by this managed instance group to create instances.
2515 #
2516 # 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.
2517 {
2518 "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:
2519 # - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
2520 # - 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.
2521 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
2522 #
2523 #
2524 # - If the value is fixed, then the calculated value is equal to the fixed value.
2525 # - 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.
2526 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
2527 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
2528 },
2529 "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.
2530 "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'.
2531 "name": "A String", # Name of the version. Unique among all versions in the scope of this managed instance group.
2532 },
2533 ],
2534 "region": "A String", # [Output Only] The URL of the region where the managed instance group resides (for regional resources).
2535 "targetSize": 42, # The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.
2536 "distributionPolicy": { # Policy specifying intended distribution of instances in regional managed instance group.
2537 "zones": [ # Zones where the regional managed instance group will create and manage instances.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002538 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002539 "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 -08002540 },
2541 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002542 },
2543 "statefulPolicy": { # Stateful configuration for this Instanced Group Manager
2544 "preservedResources": { # Configuration of all preserved resources.
2545 "disks": [ # Disks created on the instances that will be preserved on instance delete, resize down, etc.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002546 {
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002547 "deviceName": "A String", # Device name of the disk to be preserved
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002548 },
2549 ],
2550 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002551 "preservedState": { # Configuration of preserved resources.
2552 "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.
2553 "a_key": {
2554 "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.
2555 },
2556 },
2557 },
2558 },
2559 "selfLink": "A String", # [Output Only] The URL for this managed instance group. The server defines this URL.
2560}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002561
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002562 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.
2563
2564For 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.
2565
2566The 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 -07002567
2568Returns:
2569 An object of the form:
2570
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002571 { # Represents an Operation resource.
2572 #
2573 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2574 #
2575 # Operations can be global, regional or zonal.
2576 # - For global operations, use the globalOperations resource.
2577 # - For regional operations, use the regionOperations resource.
2578 # - For zonal operations, use the zonalOperations resource.
2579 #
2580 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002581 "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 -07002582 "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 -04002583 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002584 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002585 "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 -07002586 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2587 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2588 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2589 "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.
2590 "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.
2591 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2592 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2593 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2594 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2595 {
2596 "message": "A String", # [Output Only] A human-readable description of the warning code.
2597 "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.
2598 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2599 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2600 {
2601 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2602 "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).
2603 },
2604 ],
2605 },
2606 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002607 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002608 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2609 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2610 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2611 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002612 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
2613 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2614 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2615 {
2616 "message": "A String", # [Output Only] An optional, human-readable error message.
2617 "code": "A String", # [Output Only] The error type identifier for this error.
2618 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2619 },
2620 ],
2621 },
2622 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2623 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2624 "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.
2625 }</pre>
2626</div>
2627
2628<div class="method">
2629 <code class="details" id="updatePerInstanceConfigs">updatePerInstanceConfigs(project, region, instanceGroupManager, body, requestId=None)</code>
2630 <pre>Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.
2631
2632Args:
2633 project: string, Project ID for this request. (required)
2634 region: string, Name of the region scoping this request, should conform to RFC1035. (required)
2635 instanceGroupManager: string, The name of the managed instance group. It should conform to RFC1035. (required)
2636 body: object, The request body. (required)
2637 The object takes the form of:
2638
2639{ # RegionInstanceGroupManagers.updatePerInstanceConfigs
2640 "perInstanceConfigs": [ # The list of per-instance configs to insert or patch on this managed instance group.
2641 {
2642 "override": { # Overrides of stateful properties for a given instance
2643 "origin": "A String", # [Output Only] Indicates where does the override come from.
2644 "disks": [ # Disk overrides defined for this instance. According to documentation the maximum number of disks attached to an instance is 128: https://cloud.google.com/compute/docs/disks/ However, compute API defines the limit at 140, so this is what we check.
2645 {
2646 "deviceName": "A String", # The name of the device on the VM
2647 "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.
2648 "source": "A String", # The disk that is/will be mounted
2649 },
2650 ],
2651 "metadata": [ # Metadata overrides defined for this instance. TODO(b/69785416) validate the total length is <9 KB
2652 {
2653 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).
2654 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
2655 },
2656 ],
2657 },
2658 "instance": "A String", # The URL of the instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if per-instance config with the same instance URL exists then it will be updated, otherwise a new one will be created.
2659 "name": "A String", # The name of the per-instance config and the corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operation, i.e. if 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 a failure.
2660 "preservedState": { # Preserved state for a given instance. # Intended preserved state for the given instance. Does not contain state generated based on Stateful Policy.
2661 "disks": { # Preserved disks defined for this instance. This map is keyed with the device names of the disks.
2662 "a_key": {
2663 "source": "A String", # The URL of the disk resource that is stateful and should be attached to the VM instance.
2664 "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.
2665 "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.
2666 },
2667 },
2668 "metadata": { # Preserved metadata defined for this instance.
2669 "a_key": "A String",
2670 },
2671 },
2672 "fingerprint": "A String", # Fingerprint of this per-instance config. This field may be used in optimistic locking. It will be 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.
2673 },
2674 ],
2675 }
2676
2677 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.
2678
2679For 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.
2680
2681The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2682
2683Returns:
2684 An object of the form:
2685
2686 { # Represents an Operation resource.
2687 #
2688 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2689 #
2690 # Operations can be global, regional or zonal.
2691 # - For global operations, use the globalOperations resource.
2692 # - For regional operations, use the regionOperations resource.
2693 # - For zonal operations, use the zonalOperations resource.
2694 #
2695 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
2696 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2697 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
2698 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
2699 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2700 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
2701 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2702 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2703 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2704 "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.
2705 "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.
2706 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2707 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2708 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2709 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2710 {
2711 "message": "A String", # [Output Only] A human-readable description of the warning code.
2712 "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.
2713 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2714 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2715 {
2716 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2717 "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).
2718 },
2719 ],
2720 },
2721 ],
2722 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
2723 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2724 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2725 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2726 "name": "A String", # [Output Only] Name of the resource.
2727 "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 -07002728 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2729 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2730 {
2731 "message": "A String", # [Output Only] An optional, human-readable error message.
2732 "code": "A String", # [Output Only] The error type identifier for this error.
2733 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2734 },
2735 ],
2736 },
2737 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2738 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002739 "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 -07002740 }</pre>
2741</div>
2742
2743</body></html>