blob: 3c8d2f8beee25546e217e16d583b790926dd3874 [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_beta.html">Compute Engine API</a> . <a href="compute_beta.instances.html">instances</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</a></code></p>
79<p class="firstline">Adds an access config to an instance's network interface.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
82<p class="firstline">Retrieves aggregated list of instances.</p>
83<p class="toc_element">
84 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
85<p class="firstline">Retrieves the next page of results.</p>
86<p class="toc_element">
87 <code><a href="#attachDisk">attachDisk(project, zone, instance, body)</a></code></p>
88<p class="firstline">Attaches a Disk resource to an instance.</p>
89<p class="toc_element">
90 <code><a href="#delete">delete(project, zone, instance)</a></code></p>
91<p class="firstline">Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.</p>
92<p class="toc_element">
93 <code><a href="#deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</a></code></p>
94<p class="firstline">Deletes an access config from an instance's network interface.</p>
95<p class="toc_element">
96 <code><a href="#detachDisk">detachDisk(project, zone, instance, deviceName)</a></code></p>
97<p class="firstline">Detaches a disk from an instance.</p>
98<p class="toc_element">
99 <code><a href="#get">get(project, zone, instance)</a></code></p>
100<p class="firstline">Returns the specified Instance resource. Get a list of available instances by making a list() request.</p>
101<p class="toc_element">
102 <code><a href="#getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</a></code></p>
103<p class="firstline">Returns the specified instance's serial port output.</p>
104<p class="toc_element">
105 <code><a href="#insert">insert(project, zone, body)</a></code></p>
106<p class="firstline">Creates an instance resource in the specified project using the data included in the request.</p>
107<p class="toc_element">
108 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
109<p class="firstline">Retrieves the list of instances contained within the specified zone.</p>
110<p class="toc_element">
111 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
112<p class="firstline">Retrieves the next page of results.</p>
113<p class="toc_element">
114 <code><a href="#reset">reset(project, zone, instance)</a></code></p>
115<p class="firstline">Performs a hard reset on the instance.</p>
116<p class="toc_element">
117 <code><a href="#setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</a></code></p>
118<p class="firstline">Sets the auto-delete flag for a disk attached to an instance.</p>
119<p class="toc_element">
120 <code><a href="#setLabels">setLabels(project, zone, instance, body)</a></code></p>
121<p class="firstline">Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.</p>
122<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400123 <code><a href="#setMachineResources">setMachineResources(project, zone, instance, body)</a></code></p>
124<p class="firstline">Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.</p>
125<p class="toc_element">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700126 <code><a href="#setMachineType">setMachineType(project, zone, instance, body)</a></code></p>
127<p class="firstline">Changes the machine type for a stopped instance to the machine type specified in the request.</p>
128<p class="toc_element">
129 <code><a href="#setMetadata">setMetadata(project, zone, instance, body)</a></code></p>
130<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p>
131<p class="toc_element">
132 <code><a href="#setScheduling">setScheduling(project, zone, instance, body)</a></code></p>
133<p class="firstline">Sets an instance's scheduling options.</p>
134<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800135 <code><a href="#setServiceAccount">setServiceAccount(project, zone, instance, body)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400136<p class="firstline">Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.</p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800137<p class="toc_element">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700138 <code><a href="#setTags">setTags(project, zone, instance, body)</a></code></p>
139<p class="firstline">Sets tags for the specified instance to the data included in the request.</p>
140<p class="toc_element">
141 <code><a href="#start">start(project, zone, instance)</a></code></p>
142<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
143<p class="toc_element">
144 <code><a href="#startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</a></code></p>
145<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
146<p class="toc_element">
147 <code><a href="#stop">stop(project, zone, instance)</a></code></p>
148<p class="firstline">Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.</p>
149<p class="toc_element">
150 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
151<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
152<h3>Method Details</h3>
153<div class="method">
154 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
155 <pre>Adds an access config to an instance's network interface.
156
157Args:
158 project: string, Project ID for this request. (required)
159 zone: string, The name of the zone for this request. (required)
160 instance: string, The instance name for this request. (required)
161 networkInterface: string, The name of the network interface to add to this instance. (required)
162 body: object, The request body. (required)
163 The object takes the form of:
164
165{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
166 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
167 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
168 "name": "A String", # Name of this access configuration.
169 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
170}
171
172
173Returns:
174 An object of the form:
175
176 { # An Operation resource, used to manage asynchronous API requests.
177 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
178 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400179 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700180 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
181 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
182 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
183 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
184 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
185 "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.
186 "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.
187 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
188 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
189 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
190 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
191 {
192 "message": "A String", # [Output Only] A human-readable description of the warning code.
193 "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.
194 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
195 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
196 {
197 "value": "A String", # [Output Only] A warning data value corresponding to the key.
198 "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).
199 },
200 ],
201 },
202 ],
203 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
204 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
205 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
206 "name": "A String", # [Output Only] Name of the resource.
207 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
208 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
209 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
210 {
211 "message": "A String", # [Output Only] An optional, human-readable error message.
212 "code": "A String", # [Output Only] The error type identifier for this error.
213 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
214 },
215 ],
216 },
217 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
218 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800219 "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 -0700220 }</pre>
221</div>
222
223<div class="method">
224 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
225 <pre>Retrieves aggregated list of instances.
226
227Args:
228 project: string, Project ID for this request. (required)
229 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
230
231You 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.
232
233Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400234 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 -0700235 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.
236 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
237
238The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
239
240For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
241
242You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
243
244To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
245
246Returns:
247 An object of the form:
248
249 {
250 "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.
251 "items": { # [Output Only] A map of scoped instance lists.
252 "a_key": { # [Output Only] Name of the scope containing this set of instances.
253 "instances": [ # [Output Only] List of instances contained in this scope.
254 { # An Instance resource.
255 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
256 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
257 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400258 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700259 "a_key": "A String",
260 },
261 "canIpForward": True or False, # Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding.
262 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
263 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
264 "tags": { # A set of instance tags. # A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
265 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
266 "A String",
267 ],
268 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
269 #
270 # To see the latest fingerprint, make get() request to the instance.
271 },
272 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
273 #
274 # To see the latest fingerprint, make get() request to the instance.
275 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
276 { # An instance-attached disk resource.
277 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
278 #
279 # If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
280 #
281 # If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
282 #
283 # If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
284 #
285 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
286 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
287 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
288 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
289 #
290 # The key must meet the following requirements before you can provide it to Compute Engine:
291 # - The key is wrapped using a RSA public key certificate provided by Google.
292 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
293 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
294 },
295 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
296 #
297 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
298 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
299 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
300 #
301 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
302 #
303 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
304 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
305 #
306 # Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
307 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
308 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
309 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
310 #
311 # The key must meet the following requirements before you can provide it to Compute Engine:
312 # - The key is wrapped using a RSA public key certificate provided by Google.
313 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
314 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
315 },
316 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
317 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
318 #
319 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
320 #
321 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
322 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
323 # - projects/project/zones/zone/diskTypes/diskType
324 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
325 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800326 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700327 #
328 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
329 #
330 # projects/debian-cloud/global/images/family/debian-8
331 #
332 # Alternatively, use a specific version of a public operating system image:
333 #
334 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
335 #
336 # To create a disk with a private image that you created, specify the image name in the following format:
337 #
338 # global/images/my-private-image
339 #
340 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
341 #
342 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800343 #
344 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700345 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
346 },
347 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
348 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
349 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
350 "licenses": [ # [Output Only] Any valid publicly visible licenses.
351 "A String",
352 ],
353 "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.
354 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
355 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800356 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
357 #
358 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
359 #
360 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700361 },
362 ],
363 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400364 "networkInterfaces": [ # An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Only one interface is supported per instance.
365 { # A network interface resource attached to an instance.
366 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces.
367 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
368 { # An alias IP range attached to an instance's network interface.
369 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
370 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
371 },
372 ],
373 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred.
374 #
375 # This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is used.
376 #
377 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
378 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
379 # - projects/project/global/networks/network
380 # - global/networks/default
381 "accessConfigs": [ # An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.
382 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
383 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
384 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
385 "name": "A String", # Name of this access configuration.
386 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
387 },
388 ],
389 "networkIP": "A String", # An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
390 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
391 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
392 # - regions/region/subnetworks/subnetwork
393 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
394 },
395 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700396 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
397 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
398 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
399 "preemptible": True or False, # Whether the instance is preemptible.
400 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
401 },
402 "machineType": "A String", # Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:
403 #
404 # zones/us-central1-f/machineTypes/n1-standard-1
405 #
406 # To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):
407 #
408 # zones/zone/machineTypes/custom-CPUS-MEMORY
409 #
410 # For example: zones/us-central1-f/machineTypes/custom-4-5120
411 #
412 # For a full list of restrictions, read the Specifications for custom machine types.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400413 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.
414 #
415 # Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700416 { # A service account.
417 "scopes": [ # The list of scopes to be made available for this service account.
418 "A String",
419 ],
420 "email": "A String", # Email address of the service account.
421 },
422 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700423 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
424 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
425 {
426 "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 32768 bytes.
427 "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.
428 },
429 ],
430 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
431 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
432 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400433 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
434 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
435 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
436 "guestAccelerators": [
437 { # A specification of the type and number of accelerator cards attached to the instance.
438 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
439 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to expose to this instance.
440 },
441 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700442 },
443 ],
444 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
445 "message": "A String", # [Output Only] A human-readable description of the warning code.
446 "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.
447 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
448 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
449 {
450 "value": "A String", # [Output Only] A warning data value corresponding to the key.
451 "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).
452 },
453 ],
454 },
455 },
456 },
457 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.
458 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
459 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
460 }</pre>
461</div>
462
463<div class="method">
464 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
465 <pre>Retrieves the next page of results.
466
467Args:
468 previous_request: The request for the previous page. (required)
469 previous_response: The response from the request for the previous page. (required)
470
471Returns:
472 A request object that you can call 'execute()' on to request the next
473 page. Returns None if there are no more items in the collection.
474 </pre>
475</div>
476
477<div class="method">
478 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body)</code>
479 <pre>Attaches a Disk resource to an instance.
480
481Args:
482 project: string, Project ID for this request. (required)
483 zone: string, The name of the zone for this request. (required)
484 instance: string, The instance name for this request. (required)
485 body: object, The request body. (required)
486 The object takes the form of:
487
488{ # An instance-attached disk resource.
489 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
490 #
491 # If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
492 #
493 # If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
494 #
495 # If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
496 #
497 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
498 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
499 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
500 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
501 #
502 # The key must meet the following requirements before you can provide it to Compute Engine:
503 # - The key is wrapped using a RSA public key certificate provided by Google.
504 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
505 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
506 },
507 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
508 #
509 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
510 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
511 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
512 #
513 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
514 #
515 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
516 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
517 #
518 # Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
519 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
520 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
521 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
522 #
523 # The key must meet the following requirements before you can provide it to Compute Engine:
524 # - The key is wrapped using a RSA public key certificate provided by Google.
525 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
526 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
527 },
528 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
529 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
530 #
531 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
532 #
533 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
534 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
535 # - projects/project/zones/zone/diskTypes/diskType
536 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
537 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800538 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700539 #
540 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
541 #
542 # projects/debian-cloud/global/images/family/debian-8
543 #
544 # Alternatively, use a specific version of a public operating system image:
545 #
546 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
547 #
548 # To create a disk with a private image that you created, specify the image name in the following format:
549 #
550 # global/images/my-private-image
551 #
552 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
553 #
554 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800555 #
556 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700557 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
558 },
559 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
560 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
561 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
562 "licenses": [ # [Output Only] Any valid publicly visible licenses.
563 "A String",
564 ],
565 "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.
566 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
567 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800568 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
569 #
570 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
571 #
572 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700573}
574
575
576Returns:
577 An object of the form:
578
579 { # An Operation resource, used to manage asynchronous API requests.
580 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
581 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400582 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700583 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
584 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
585 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
586 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
587 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
588 "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.
589 "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.
590 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
591 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
592 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
593 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
594 {
595 "message": "A String", # [Output Only] A human-readable description of the warning code.
596 "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.
597 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
598 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
599 {
600 "value": "A String", # [Output Only] A warning data value corresponding to the key.
601 "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).
602 },
603 ],
604 },
605 ],
606 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
607 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
608 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
609 "name": "A String", # [Output Only] Name of the resource.
610 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
611 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
612 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
613 {
614 "message": "A String", # [Output Only] An optional, human-readable error message.
615 "code": "A String", # [Output Only] The error type identifier for this error.
616 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
617 },
618 ],
619 },
620 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
621 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800622 "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 -0700623 }</pre>
624</div>
625
626<div class="method">
627 <code class="details" id="delete">delete(project, zone, instance)</code>
628 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
629
630Args:
631 project: string, Project ID for this request. (required)
632 zone: string, The name of the zone for this request. (required)
633 instance: string, Name of the instance resource to delete. (required)
634
635Returns:
636 An object of the form:
637
638 { # An Operation resource, used to manage asynchronous API requests.
639 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
640 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400641 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700642 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
643 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
644 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
645 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
646 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
647 "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.
648 "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.
649 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
650 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
651 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
652 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
653 {
654 "message": "A String", # [Output Only] A human-readable description of the warning code.
655 "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.
656 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
657 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
658 {
659 "value": "A String", # [Output Only] A warning data value corresponding to the key.
660 "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).
661 },
662 ],
663 },
664 ],
665 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
666 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
667 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
668 "name": "A String", # [Output Only] Name of the resource.
669 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
670 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
671 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
672 {
673 "message": "A String", # [Output Only] An optional, human-readable error message.
674 "code": "A String", # [Output Only] The error type identifier for this error.
675 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
676 },
677 ],
678 },
679 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
680 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800681 "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 -0700682 }</pre>
683</div>
684
685<div class="method">
686 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
687 <pre>Deletes an access config from an instance's network interface.
688
689Args:
690 project: string, Project ID for this request. (required)
691 zone: string, The name of the zone for this request. (required)
692 instance: string, The instance name for this request. (required)
693 accessConfig: string, The name of the access config to delete. (required)
694 networkInterface: string, The name of the network interface. (required)
695
696Returns:
697 An object of the form:
698
699 { # An Operation resource, used to manage asynchronous API requests.
700 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
701 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400702 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700703 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
704 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
705 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
706 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
707 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
708 "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.
709 "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.
710 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
711 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
712 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
713 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
714 {
715 "message": "A String", # [Output Only] A human-readable description of the warning code.
716 "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.
717 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
718 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
719 {
720 "value": "A String", # [Output Only] A warning data value corresponding to the key.
721 "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).
722 },
723 ],
724 },
725 ],
726 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
727 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
728 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
729 "name": "A String", # [Output Only] Name of the resource.
730 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
731 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
732 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
733 {
734 "message": "A String", # [Output Only] An optional, human-readable error message.
735 "code": "A String", # [Output Only] The error type identifier for this error.
736 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
737 },
738 ],
739 },
740 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
741 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800742 "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 -0700743 }</pre>
744</div>
745
746<div class="method">
747 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
748 <pre>Detaches a disk from an instance.
749
750Args:
751 project: string, Project ID for this request. (required)
752 zone: string, The name of the zone for this request. (required)
753 instance: string, Instance name. (required)
754 deviceName: string, Disk device name to detach. (required)
755
756Returns:
757 An object of the form:
758
759 { # An Operation resource, used to manage asynchronous API requests.
760 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
761 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400762 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700763 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
764 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
765 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
766 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
767 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
768 "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.
769 "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.
770 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
771 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
772 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
773 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
774 {
775 "message": "A String", # [Output Only] A human-readable description of the warning code.
776 "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.
777 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
778 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
779 {
780 "value": "A String", # [Output Only] A warning data value corresponding to the key.
781 "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).
782 },
783 ],
784 },
785 ],
786 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
787 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
788 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
789 "name": "A String", # [Output Only] Name of the resource.
790 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
791 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
792 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
793 {
794 "message": "A String", # [Output Only] An optional, human-readable error message.
795 "code": "A String", # [Output Only] The error type identifier for this error.
796 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
797 },
798 ],
799 },
800 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
801 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800802 "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 -0700803 }</pre>
804</div>
805
806<div class="method">
807 <code class="details" id="get">get(project, zone, instance)</code>
808 <pre>Returns the specified Instance resource. Get a list of available instances by making a list() request.
809
810Args:
811 project: string, Project ID for this request. (required)
812 zone: string, The name of the zone for this request. (required)
813 instance: string, Name of the instance resource to return. (required)
814
815Returns:
816 An object of the form:
817
818 { # An Instance resource.
819 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
820 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
821 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400822 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700823 "a_key": "A String",
824 },
825 "canIpForward": True or False, # Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding.
826 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
827 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
828 "tags": { # A set of instance tags. # A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
829 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
830 "A String",
831 ],
832 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
833 #
834 # To see the latest fingerprint, make get() request to the instance.
835 },
836 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
837 #
838 # To see the latest fingerprint, make get() request to the instance.
839 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
840 { # An instance-attached disk resource.
841 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
842 #
843 # If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
844 #
845 # If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
846 #
847 # If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
848 #
849 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
850 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
851 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
852 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
853 #
854 # The key must meet the following requirements before you can provide it to Compute Engine:
855 # - The key is wrapped using a RSA public key certificate provided by Google.
856 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
857 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
858 },
859 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
860 #
861 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
862 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
863 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
864 #
865 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
866 #
867 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
868 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
869 #
870 # Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
871 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
872 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
873 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
874 #
875 # The key must meet the following requirements before you can provide it to Compute Engine:
876 # - The key is wrapped using a RSA public key certificate provided by Google.
877 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
878 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
879 },
880 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
881 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
882 #
883 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
884 #
885 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
886 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
887 # - projects/project/zones/zone/diskTypes/diskType
888 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
889 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800890 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700891 #
892 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
893 #
894 # projects/debian-cloud/global/images/family/debian-8
895 #
896 # Alternatively, use a specific version of a public operating system image:
897 #
898 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
899 #
900 # To create a disk with a private image that you created, specify the image name in the following format:
901 #
902 # global/images/my-private-image
903 #
904 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
905 #
906 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800907 #
908 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700909 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
910 },
911 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
912 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
913 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
914 "licenses": [ # [Output Only] Any valid publicly visible licenses.
915 "A String",
916 ],
917 "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.
918 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
919 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800920 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
921 #
922 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
923 #
924 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700925 },
926 ],
927 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400928 "networkInterfaces": [ # An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Only one interface is supported per instance.
929 { # A network interface resource attached to an instance.
930 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces.
931 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
932 { # An alias IP range attached to an instance's network interface.
933 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
934 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
935 },
936 ],
937 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred.
938 #
939 # This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is used.
940 #
941 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
942 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
943 # - projects/project/global/networks/network
944 # - global/networks/default
945 "accessConfigs": [ # An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.
946 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
947 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
948 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
949 "name": "A String", # Name of this access configuration.
950 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
951 },
952 ],
953 "networkIP": "A String", # An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
954 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
955 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
956 # - regions/region/subnetworks/subnetwork
957 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
958 },
959 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700960 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
961 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
962 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
963 "preemptible": True or False, # Whether the instance is preemptible.
964 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
965 },
966 "machineType": "A String", # Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:
967 #
968 # zones/us-central1-f/machineTypes/n1-standard-1
969 #
970 # To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):
971 #
972 # zones/zone/machineTypes/custom-CPUS-MEMORY
973 #
974 # For example: zones/us-central1-f/machineTypes/custom-4-5120
975 #
976 # For a full list of restrictions, read the Specifications for custom machine types.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400977 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.
978 #
979 # Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700980 { # A service account.
981 "scopes": [ # The list of scopes to be made available for this service account.
982 "A String",
983 ],
984 "email": "A String", # Email address of the service account.
985 },
986 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700987 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
988 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
989 {
990 "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 32768 bytes.
991 "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.
992 },
993 ],
994 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
995 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
996 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400997 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
998 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
999 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1000 "guestAccelerators": [
1001 { # A specification of the type and number of accelerator cards attached to the instance.
1002 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
1003 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to expose to this instance.
1004 },
1005 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001006 }</pre>
1007</div>
1008
1009<div class="method">
1010 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</code>
1011 <pre>Returns the specified instance's serial port output.
1012
1013Args:
1014 project: string, Project ID for this request. (required)
1015 zone: string, The name of the zone for this request. (required)
1016 instance: string, Name of the instance scoping this request. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001017 start: string, Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001018 port: integer, Specifies which COM or serial port to retrieve data from.
1019
1020Returns:
1021 An object of the form:
1022
1023 { # An instance's serial console output.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001024 "start": "A String", # The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer, older output will be overwritten by newer content and the start values will be mismatched.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001025 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
1026 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1027 "contents": "A String", # [Output Only] The contents of the console output.
1028 "next": "A String", # [Output Only] The position of the next byte of content from the serial console output. Use this value in the next request as the start parameter.
1029 }</pre>
1030</div>
1031
1032<div class="method">
1033 <code class="details" id="insert">insert(project, zone, body)</code>
1034 <pre>Creates an instance resource in the specified project using the data included in the request.
1035
1036Args:
1037 project: string, Project ID for this request. (required)
1038 zone: string, The name of the zone for this request. (required)
1039 body: object, The request body. (required)
1040 The object takes the form of:
1041
1042{ # An Instance resource.
1043 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1044 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1045 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001046 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001047 "a_key": "A String",
1048 },
1049 "canIpForward": True or False, # Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding.
1050 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1051 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1052 "tags": { # A set of instance tags. # A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
1053 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1054 "A String",
1055 ],
1056 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1057 #
1058 # To see the latest fingerprint, make get() request to the instance.
1059 },
1060 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1061 #
1062 # To see the latest fingerprint, make get() request to the instance.
1063 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1064 { # An instance-attached disk resource.
1065 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1066 #
1067 # If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
1068 #
1069 # If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
1070 #
1071 # If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
1072 #
1073 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1074 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1075 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1076 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1077 #
1078 # The key must meet the following requirements before you can provide it to Compute Engine:
1079 # - The key is wrapped using a RSA public key certificate provided by Google.
1080 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1081 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1082 },
1083 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
1084 #
1085 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
1086 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1087 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
1088 #
1089 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1090 #
1091 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1092 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
1093 #
1094 # Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
1095 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1096 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1097 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1098 #
1099 # The key must meet the following requirements before you can provide it to Compute Engine:
1100 # - The key is wrapped using a RSA public key certificate provided by Google.
1101 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1102 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1103 },
1104 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1105 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
1106 #
1107 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1108 #
1109 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
1110 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1111 # - projects/project/zones/zone/diskTypes/diskType
1112 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1113 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001114 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001115 #
1116 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
1117 #
1118 # projects/debian-cloud/global/images/family/debian-8
1119 #
1120 # Alternatively, use a specific version of a public operating system image:
1121 #
1122 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1123 #
1124 # To create a disk with a private image that you created, specify the image name in the following format:
1125 #
1126 # global/images/my-private-image
1127 #
1128 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
1129 #
1130 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001131 #
1132 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001133 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1134 },
1135 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
1136 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
1137 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
1138 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1139 "A String",
1140 ],
1141 "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.
1142 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
1143 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001144 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
1145 #
1146 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1147 #
1148 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001149 },
1150 ],
1151 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001152 "networkInterfaces": [ # An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Only one interface is supported per instance.
1153 { # A network interface resource attached to an instance.
1154 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces.
1155 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1156 { # An alias IP range attached to an instance's network interface.
1157 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
1158 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
1159 },
1160 ],
1161 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred.
1162 #
1163 # This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is used.
1164 #
1165 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1166 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1167 # - projects/project/global/networks/network
1168 # - global/networks/default
1169 "accessConfigs": [ # An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.
1170 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1171 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1172 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1173 "name": "A String", # Name of this access configuration.
1174 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
1175 },
1176 ],
1177 "networkIP": "A String", # An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
1178 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
1179 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1180 # - regions/region/subnetworks/subnetwork
1181 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1182 },
1183 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001184 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1185 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1186 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
1187 "preemptible": True or False, # Whether the instance is preemptible.
1188 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
1189 },
1190 "machineType": "A String", # Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:
1191 #
1192 # zones/us-central1-f/machineTypes/n1-standard-1
1193 #
1194 # To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):
1195 #
1196 # zones/zone/machineTypes/custom-CPUS-MEMORY
1197 #
1198 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1199 #
1200 # For a full list of restrictions, read the Specifications for custom machine types.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001201 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.
1202 #
1203 # Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001204 { # A service account.
1205 "scopes": [ # The list of scopes to be made available for this service account.
1206 "A String",
1207 ],
1208 "email": "A String", # Email address of the service account.
1209 },
1210 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001211 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1212 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1213 {
1214 "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 32768 bytes.
1215 "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.
1216 },
1217 ],
1218 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1219 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1220 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001221 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1222 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1223 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1224 "guestAccelerators": [
1225 { # A specification of the type and number of accelerator cards attached to the instance.
1226 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
1227 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to expose to this instance.
1228 },
1229 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001230}
1231
1232
1233Returns:
1234 An object of the form:
1235
1236 { # An Operation resource, used to manage asynchronous API requests.
1237 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1238 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001239 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001240 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1241 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1242 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1243 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1244 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1245 "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.
1246 "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.
1247 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1248 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1249 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1250 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1251 {
1252 "message": "A String", # [Output Only] A human-readable description of the warning code.
1253 "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.
1254 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1255 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1256 {
1257 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1258 "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).
1259 },
1260 ],
1261 },
1262 ],
1263 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1264 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1265 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1266 "name": "A String", # [Output Only] Name of the resource.
1267 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1268 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1269 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1270 {
1271 "message": "A String", # [Output Only] An optional, human-readable error message.
1272 "code": "A String", # [Output Only] The error type identifier for this error.
1273 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1274 },
1275 ],
1276 },
1277 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1278 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001279 "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 -07001280 }</pre>
1281</div>
1282
1283<div class="method">
1284 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1285 <pre>Retrieves the list of instances contained within the specified zone.
1286
1287Args:
1288 project: string, Project ID for this request. (required)
1289 zone: string, The name of the zone for this request. (required)
1290 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1291
1292You 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.
1293
1294Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001295 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 -07001296 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.
1297 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
1298
1299The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
1300
1301For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
1302
1303You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
1304
1305To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
1306
1307Returns:
1308 An object of the form:
1309
1310 { # Contains a list of instances.
1311 "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.
1312 "items": [ # [Output Only] A list of instances.
1313 { # An Instance resource.
1314 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1315 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1316 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001317 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001318 "a_key": "A String",
1319 },
1320 "canIpForward": True or False, # Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding.
1321 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1322 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1323 "tags": { # A set of instance tags. # A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
1324 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1325 "A String",
1326 ],
1327 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1328 #
1329 # To see the latest fingerprint, make get() request to the instance.
1330 },
1331 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1332 #
1333 # To see the latest fingerprint, make get() request to the instance.
1334 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1335 { # An instance-attached disk resource.
1336 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1337 #
1338 # If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
1339 #
1340 # If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
1341 #
1342 # If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
1343 #
1344 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1345 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1346 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1347 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1348 #
1349 # The key must meet the following requirements before you can provide it to Compute Engine:
1350 # - The key is wrapped using a RSA public key certificate provided by Google.
1351 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1352 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1353 },
1354 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
1355 #
1356 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
1357 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1358 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
1359 #
1360 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1361 #
1362 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1363 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
1364 #
1365 # Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
1366 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1367 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1368 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1369 #
1370 # The key must meet the following requirements before you can provide it to Compute Engine:
1371 # - The key is wrapped using a RSA public key certificate provided by Google.
1372 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1373 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1374 },
1375 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1376 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
1377 #
1378 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1379 #
1380 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
1381 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1382 # - projects/project/zones/zone/diskTypes/diskType
1383 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1384 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001385 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001386 #
1387 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
1388 #
1389 # projects/debian-cloud/global/images/family/debian-8
1390 #
1391 # Alternatively, use a specific version of a public operating system image:
1392 #
1393 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1394 #
1395 # To create a disk with a private image that you created, specify the image name in the following format:
1396 #
1397 # global/images/my-private-image
1398 #
1399 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
1400 #
1401 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001402 #
1403 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001404 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1405 },
1406 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
1407 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
1408 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
1409 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1410 "A String",
1411 ],
1412 "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.
1413 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
1414 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001415 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
1416 #
1417 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1418 #
1419 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001420 },
1421 ],
1422 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001423 "networkInterfaces": [ # An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Only one interface is supported per instance.
1424 { # A network interface resource attached to an instance.
1425 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces.
1426 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1427 { # An alias IP range attached to an instance's network interface.
1428 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
1429 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
1430 },
1431 ],
1432 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred.
1433 #
1434 # This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is used.
1435 #
1436 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1437 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1438 # - projects/project/global/networks/network
1439 # - global/networks/default
1440 "accessConfigs": [ # An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access.
1441 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1442 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1443 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1444 "name": "A String", # Name of this access configuration.
1445 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
1446 },
1447 ],
1448 "networkIP": "A String", # An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
1449 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
1450 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1451 # - regions/region/subnetworks/subnetwork
1452 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1453 },
1454 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001455 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1456 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1457 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
1458 "preemptible": True or False, # Whether the instance is preemptible.
1459 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
1460 },
1461 "machineType": "A String", # Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:
1462 #
1463 # zones/us-central1-f/machineTypes/n1-standard-1
1464 #
1465 # To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):
1466 #
1467 # zones/zone/machineTypes/custom-CPUS-MEMORY
1468 #
1469 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1470 #
1471 # For a full list of restrictions, read the Specifications for custom machine types.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001472 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.
1473 #
1474 # Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001475 { # A service account.
1476 "scopes": [ # The list of scopes to be made available for this service account.
1477 "A String",
1478 ],
1479 "email": "A String", # Email address of the service account.
1480 },
1481 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001482 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1483 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1484 {
1485 "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 32768 bytes.
1486 "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.
1487 },
1488 ],
1489 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1490 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1491 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001492 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1493 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1494 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1495 "guestAccelerators": [
1496 { # A specification of the type and number of accelerator cards attached to the instance.
1497 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
1498 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to expose to this instance.
1499 },
1500 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001501 },
1502 ],
1503 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
1504 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1505 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1506 }</pre>
1507</div>
1508
1509<div class="method">
1510 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1511 <pre>Retrieves the next page of results.
1512
1513Args:
1514 previous_request: The request for the previous page. (required)
1515 previous_response: The response from the request for the previous page. (required)
1516
1517Returns:
1518 A request object that you can call 'execute()' on to request the next
1519 page. Returns None if there are no more items in the collection.
1520 </pre>
1521</div>
1522
1523<div class="method">
1524 <code class="details" id="reset">reset(project, zone, instance)</code>
1525 <pre>Performs a hard reset on the instance.
1526
1527Args:
1528 project: string, Project ID for this request. (required)
1529 zone: string, The name of the zone for this request. (required)
1530 instance: string, Name of the instance scoping this request. (required)
1531
1532Returns:
1533 An object of the form:
1534
1535 { # An Operation resource, used to manage asynchronous API requests.
1536 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1537 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001538 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001539 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1540 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1541 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1542 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1543 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1544 "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.
1545 "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.
1546 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1547 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1548 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1549 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1550 {
1551 "message": "A String", # [Output Only] A human-readable description of the warning code.
1552 "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.
1553 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1554 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1555 {
1556 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1557 "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).
1558 },
1559 ],
1560 },
1561 ],
1562 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1563 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1564 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1565 "name": "A String", # [Output Only] Name of the resource.
1566 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1567 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1568 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1569 {
1570 "message": "A String", # [Output Only] An optional, human-readable error message.
1571 "code": "A String", # [Output Only] The error type identifier for this error.
1572 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1573 },
1574 ],
1575 },
1576 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1577 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001578 "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 -07001579 }</pre>
1580</div>
1581
1582<div class="method">
1583 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
1584 <pre>Sets the auto-delete flag for a disk attached to an instance.
1585
1586Args:
1587 project: string, Project ID for this request. (required)
1588 zone: string, The name of the zone for this request. (required)
1589 instance: string, The instance name. (required)
1590 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
1591 deviceName: string, The device name of the disk to modify. (required)
1592
1593Returns:
1594 An object of the form:
1595
1596 { # An Operation resource, used to manage asynchronous API requests.
1597 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1598 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001599 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001600 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1601 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1602 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1603 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1604 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1605 "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.
1606 "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.
1607 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1608 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1609 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1610 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1611 {
1612 "message": "A String", # [Output Only] A human-readable description of the warning code.
1613 "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.
1614 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1615 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1616 {
1617 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1618 "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).
1619 },
1620 ],
1621 },
1622 ],
1623 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1624 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1625 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1626 "name": "A String", # [Output Only] Name of the resource.
1627 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1628 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1629 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1630 {
1631 "message": "A String", # [Output Only] An optional, human-readable error message.
1632 "code": "A String", # [Output Only] The error type identifier for this error.
1633 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1634 },
1635 ],
1636 },
1637 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1638 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001639 "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 -07001640 }</pre>
1641</div>
1642
1643<div class="method">
1644 <code class="details" id="setLabels">setLabels(project, zone, instance, body)</code>
1645 <pre>Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.
1646
1647Args:
1648 project: string, Project ID for this request. (required)
1649 zone: string, The name of the zone for this request. (required)
1650 instance: string, Name of the instance scoping this request. (required)
1651 body: object, The request body. (required)
1652 The object takes the form of:
1653
1654{
1655 "labelFingerprint": "A String", # Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001656 "labels": {
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001657 "a_key": "A String",
1658 },
1659 }
1660
1661
1662Returns:
1663 An object of the form:
1664
1665 { # An Operation resource, used to manage asynchronous API requests.
1666 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1667 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001668 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
1669 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1670 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1671 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1672 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1673 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1674 "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.
1675 "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.
1676 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1677 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1678 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1679 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1680 {
1681 "message": "A String", # [Output Only] A human-readable description of the warning code.
1682 "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.
1683 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1684 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1685 {
1686 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1687 "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).
1688 },
1689 ],
1690 },
1691 ],
1692 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1693 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1694 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1695 "name": "A String", # [Output Only] Name of the resource.
1696 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1697 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1698 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1699 {
1700 "message": "A String", # [Output Only] An optional, human-readable error message.
1701 "code": "A String", # [Output Only] The error type identifier for this error.
1702 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1703 },
1704 ],
1705 },
1706 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1707 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1708 "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.
1709 }</pre>
1710</div>
1711
1712<div class="method">
1713 <code class="details" id="setMachineResources">setMachineResources(project, zone, instance, body)</code>
1714 <pre>Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
1715
1716Args:
1717 project: string, Project ID for this request. (required)
1718 zone: string, The name of the zone for this request. (required)
1719 instance: string, Name of the instance scoping this request. (required)
1720 body: object, The request body. (required)
1721 The object takes the form of:
1722
1723{
1724 "guestAccelerators": [
1725 { # A specification of the type and number of accelerator cards attached to the instance.
1726 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
1727 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to expose to this instance.
1728 },
1729 ],
1730 }
1731
1732
1733Returns:
1734 An object of the form:
1735
1736 { # An Operation resource, used to manage asynchronous API requests.
1737 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1738 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1739 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001740 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1741 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1742 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1743 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1744 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1745 "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.
1746 "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.
1747 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1748 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1749 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1750 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1751 {
1752 "message": "A String", # [Output Only] A human-readable description of the warning code.
1753 "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.
1754 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1755 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1756 {
1757 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1758 "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).
1759 },
1760 ],
1761 },
1762 ],
1763 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1764 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1765 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1766 "name": "A String", # [Output Only] Name of the resource.
1767 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1768 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1769 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1770 {
1771 "message": "A String", # [Output Only] An optional, human-readable error message.
1772 "code": "A String", # [Output Only] The error type identifier for this error.
1773 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1774 },
1775 ],
1776 },
1777 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1778 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001779 "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 -07001780 }</pre>
1781</div>
1782
1783<div class="method">
1784 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
1785 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
1786
1787Args:
1788 project: string, Project ID for this request. (required)
1789 zone: string, The name of the zone for this request. (required)
1790 instance: string, Name of the instance scoping this request. (required)
1791 body: object, The request body. (required)
1792 The object takes the form of:
1793
1794{
1795 "machineType": "A String", # Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1
1796 }
1797
1798
1799Returns:
1800 An object of the form:
1801
1802 { # An Operation resource, used to manage asynchronous API requests.
1803 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1804 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001805 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001806 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1807 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1808 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1809 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1810 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1811 "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.
1812 "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.
1813 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1814 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1815 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1816 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1817 {
1818 "message": "A String", # [Output Only] A human-readable description of the warning code.
1819 "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.
1820 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1821 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1822 {
1823 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1824 "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).
1825 },
1826 ],
1827 },
1828 ],
1829 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1830 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1831 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1832 "name": "A String", # [Output Only] Name of the resource.
1833 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1834 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1835 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1836 {
1837 "message": "A String", # [Output Only] An optional, human-readable error message.
1838 "code": "A String", # [Output Only] The error type identifier for this error.
1839 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1840 },
1841 ],
1842 },
1843 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1844 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001845 "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 -07001846 }</pre>
1847</div>
1848
1849<div class="method">
1850 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
1851 <pre>Sets metadata for the specified instance to the data included in the request.
1852
1853Args:
1854 project: string, Project ID for this request. (required)
1855 zone: string, The name of the zone for this request. (required)
1856 instance: string, Name of the instance scoping this request. (required)
1857 body: object, The request body. (required)
1858 The object takes the form of:
1859
1860{ # A metadata key/value entry.
1861 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1862 {
1863 "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 32768 bytes.
1864 "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.
1865 },
1866 ],
1867 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1868 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
1869}
1870
1871
1872Returns:
1873 An object of the form:
1874
1875 { # An Operation resource, used to manage asynchronous API requests.
1876 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1877 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001878 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001879 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1880 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1881 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1882 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1883 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1884 "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.
1885 "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.
1886 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1887 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1888 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1889 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1890 {
1891 "message": "A String", # [Output Only] A human-readable description of the warning code.
1892 "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.
1893 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1894 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1895 {
1896 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1897 "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).
1898 },
1899 ],
1900 },
1901 ],
1902 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1903 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1904 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1905 "name": "A String", # [Output Only] Name of the resource.
1906 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1907 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1908 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1909 {
1910 "message": "A String", # [Output Only] An optional, human-readable error message.
1911 "code": "A String", # [Output Only] The error type identifier for this error.
1912 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1913 },
1914 ],
1915 },
1916 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1917 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001918 "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 -07001919 }</pre>
1920</div>
1921
1922<div class="method">
1923 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
1924 <pre>Sets an instance's scheduling options.
1925
1926Args:
1927 project: string, Project ID for this request. (required)
1928 zone: string, The name of the zone for this request. (required)
1929 instance: string, Instance name. (required)
1930 body: object, The request body. (required)
1931 The object takes the form of:
1932
1933{ # Sets the scheduling options for an Instance.
1934 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
1935 "preemptible": True or False, # Whether the instance is preemptible.
1936 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
1937}
1938
1939
1940Returns:
1941 An object of the form:
1942
1943 { # An Operation resource, used to manage asynchronous API requests.
1944 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1945 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001946 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001947 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1948 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1949 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1950 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1951 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1952 "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.
1953 "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.
1954 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1955 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1956 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1957 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1958 {
1959 "message": "A String", # [Output Only] A human-readable description of the warning code.
1960 "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.
1961 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1962 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1963 {
1964 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1965 "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).
1966 },
1967 ],
1968 },
1969 ],
1970 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1971 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1972 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1973 "name": "A String", # [Output Only] Name of the resource.
1974 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1975 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1976 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1977 {
1978 "message": "A String", # [Output Only] An optional, human-readable error message.
1979 "code": "A String", # [Output Only] The error type identifier for this error.
1980 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1981 },
1982 ],
1983 },
1984 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1985 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001986 "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.
1987 }</pre>
1988</div>
1989
1990<div class="method">
1991 <code class="details" id="setServiceAccount">setServiceAccount(project, zone, instance, body)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001992 <pre>Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001993
1994Args:
1995 project: string, Project ID for this request. (required)
1996 zone: string, The name of the zone for this request. (required)
1997 instance: string, Name of the instance resource to start. (required)
1998 body: object, The request body. (required)
1999 The object takes the form of:
2000
2001{
2002 "scopes": [ # The list of scopes to be made available for this service account.
2003 "A String",
2004 ],
2005 "email": "A String", # Email address of the service account.
2006 }
2007
2008
2009Returns:
2010 An object of the form:
2011
2012 { # An Operation resource, used to manage asynchronous API requests.
2013 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2014 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002015 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002016 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2017 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2018 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2019 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2020 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2021 "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.
2022 "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.
2023 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2024 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2025 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2026 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2027 {
2028 "message": "A String", # [Output Only] A human-readable description of the warning code.
2029 "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.
2030 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2031 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2032 {
2033 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2034 "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).
2035 },
2036 ],
2037 },
2038 ],
2039 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2040 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2041 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2042 "name": "A String", # [Output Only] Name of the resource.
2043 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2044 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2045 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2046 {
2047 "message": "A String", # [Output Only] An optional, human-readable error message.
2048 "code": "A String", # [Output Only] The error type identifier for this error.
2049 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2050 },
2051 ],
2052 },
2053 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2054 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2055 "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 -07002056 }</pre>
2057</div>
2058
2059<div class="method">
2060 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
2061 <pre>Sets tags for the specified instance to the data included in the request.
2062
2063Args:
2064 project: string, Project ID for this request. (required)
2065 zone: string, The name of the zone for this request. (required)
2066 instance: string, Name of the instance scoping this request. (required)
2067 body: object, The request body. (required)
2068 The object takes the form of:
2069
2070{ # A set of instance tags.
2071 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
2072 "A String",
2073 ],
2074 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
2075 #
2076 # To see the latest fingerprint, make get() request to the instance.
2077}
2078
2079
2080Returns:
2081 An object of the form:
2082
2083 { # An Operation resource, used to manage asynchronous API requests.
2084 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2085 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002086 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002087 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2088 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2089 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2090 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2091 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2092 "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.
2093 "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.
2094 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2095 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2096 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2097 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2098 {
2099 "message": "A String", # [Output Only] A human-readable description of the warning code.
2100 "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.
2101 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2102 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2103 {
2104 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2105 "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).
2106 },
2107 ],
2108 },
2109 ],
2110 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2111 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2112 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2113 "name": "A String", # [Output Only] Name of the resource.
2114 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2115 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2116 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2117 {
2118 "message": "A String", # [Output Only] An optional, human-readable error message.
2119 "code": "A String", # [Output Only] The error type identifier for this error.
2120 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2121 },
2122 ],
2123 },
2124 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2125 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002126 "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 -07002127 }</pre>
2128</div>
2129
2130<div class="method">
2131 <code class="details" id="start">start(project, zone, instance)</code>
2132 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2133
2134Args:
2135 project: string, Project ID for this request. (required)
2136 zone: string, The name of the zone for this request. (required)
2137 instance: string, Name of the instance resource to start. (required)
2138
2139Returns:
2140 An object of the form:
2141
2142 { # An Operation resource, used to manage asynchronous API requests.
2143 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2144 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002145 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002146 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2147 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2148 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2149 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2150 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2151 "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.
2152 "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.
2153 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2154 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2155 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2156 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2157 {
2158 "message": "A String", # [Output Only] A human-readable description of the warning code.
2159 "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.
2160 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2161 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2162 {
2163 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2164 "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).
2165 },
2166 ],
2167 },
2168 ],
2169 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2170 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2171 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2172 "name": "A String", # [Output Only] Name of the resource.
2173 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2174 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2175 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2176 {
2177 "message": "A String", # [Output Only] An optional, human-readable error message.
2178 "code": "A String", # [Output Only] The error type identifier for this error.
2179 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2180 },
2181 ],
2182 },
2183 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2184 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002185 "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 -07002186 }</pre>
2187</div>
2188
2189<div class="method">
2190 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</code>
2191 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2192
2193Args:
2194 project: string, Project ID for this request. (required)
2195 zone: string, The name of the zone for this request. (required)
2196 instance: string, Name of the instance resource to start. (required)
2197 body: object, The request body. (required)
2198 The object takes the form of:
2199
2200{
2201 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key.
2202 #
2203 # In order to start the instance, the disk url and its corresponding key must be provided.
2204 #
2205 # If the disk is not protected with a customer-supplied encryption key it should not be specified.
2206 {
2207 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key.
2208 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2209 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2210 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2211 #
2212 # The key must meet the following requirements before you can provide it to Compute Engine:
2213 # - The key is wrapped using a RSA public key certificate provided by Google.
2214 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2215 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2216 },
2217 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
2218 },
2219 ],
2220 }
2221
2222
2223Returns:
2224 An object of the form:
2225
2226 { # An Operation resource, used to manage asynchronous API requests.
2227 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2228 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002229 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002230 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2231 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2232 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2233 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2234 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2235 "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.
2236 "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.
2237 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2238 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2239 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2240 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2241 {
2242 "message": "A String", # [Output Only] A human-readable description of the warning code.
2243 "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.
2244 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2245 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2246 {
2247 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2248 "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).
2249 },
2250 ],
2251 },
2252 ],
2253 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2254 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2255 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2256 "name": "A String", # [Output Only] Name of the resource.
2257 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2258 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2259 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2260 {
2261 "message": "A String", # [Output Only] An optional, human-readable error message.
2262 "code": "A String", # [Output Only] The error type identifier for this error.
2263 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2264 },
2265 ],
2266 },
2267 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2268 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002269 "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 -07002270 }</pre>
2271</div>
2272
2273<div class="method">
2274 <code class="details" id="stop">stop(project, zone, instance)</code>
2275 <pre>Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.
2276
2277Args:
2278 project: string, Project ID for this request. (required)
2279 zone: string, The name of the zone for this request. (required)
2280 instance: string, Name of the instance resource to stop. (required)
2281
2282Returns:
2283 An object of the form:
2284
2285 { # An Operation resource, used to manage asynchronous API requests.
2286 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2287 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002288 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002289 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2290 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2291 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2292 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2293 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2294 "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.
2295 "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.
2296 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2297 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2298 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2299 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2300 {
2301 "message": "A String", # [Output Only] A human-readable description of the warning code.
2302 "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.
2303 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2304 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2305 {
2306 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2307 "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).
2308 },
2309 ],
2310 },
2311 ],
2312 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2313 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2314 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2315 "name": "A String", # [Output Only] Name of the resource.
2316 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2317 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2318 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2319 {
2320 "message": "A String", # [Output Only] An optional, human-readable error message.
2321 "code": "A String", # [Output Only] The error type identifier for this error.
2322 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2323 },
2324 ],
2325 },
2326 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2327 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002328 "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 -07002329 }</pre>
2330</div>
2331
2332<div class="method">
2333 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
2334 <pre>Returns permissions that a caller has on the specified resource.
2335
2336Args:
2337 project: string, Project ID for this request. (required)
2338 zone: string, The name of the zone for this request. (required)
2339 resource: string, Name of the resource for this request. (required)
2340 body: object, The request body. (required)
2341 The object takes the form of:
2342
2343{
2344 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2345 "A String",
2346 ],
2347 }
2348
2349
2350Returns:
2351 An object of the form:
2352
2353 {
2354 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2355 "A String",
2356 ],
2357 }</pre>
2358</div>
2359
2360</body></html>