blob: 2b858322549cd3c58b8456641444aa69698fc687 [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">
123 <code><a href="#setMachineType">setMachineType(project, zone, instance, body)</a></code></p>
124<p class="firstline">Changes the machine type for a stopped instance to the machine type specified in the request.</p>
125<p class="toc_element">
126 <code><a href="#setMetadata">setMetadata(project, zone, instance, body)</a></code></p>
127<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p>
128<p class="toc_element">
129 <code><a href="#setScheduling">setScheduling(project, zone, instance, body)</a></code></p>
130<p class="firstline">Sets an instance's scheduling options.</p>
131<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800132 <code><a href="#setServiceAccount">setServiceAccount(project, zone, instance, body)</a></code></p>
133<p class="firstline">Sets the service account on the instance.</p>
134<p class="toc_element">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700135 <code><a href="#setTags">setTags(project, zone, instance, body)</a></code></p>
136<p class="firstline">Sets tags for the specified instance to the data included in the request.</p>
137<p class="toc_element">
138 <code><a href="#start">start(project, zone, instance)</a></code></p>
139<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
140<p class="toc_element">
141 <code><a href="#startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</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="#stop">stop(project, zone, instance)</a></code></p>
145<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>
146<p class="toc_element">
147 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
148<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
149<h3>Method Details</h3>
150<div class="method">
151 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
152 <pre>Adds an access config to an instance's network interface.
153
154Args:
155 project: string, Project ID for this request. (required)
156 zone: string, The name of the zone for this request. (required)
157 instance: string, The instance name for this request. (required)
158 networkInterface: string, The name of the network interface to add to this instance. (required)
159 body: object, The request body. (required)
160 The object takes the form of:
161
162{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
163 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
164 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
165 "name": "A String", # Name of this access configuration.
166 "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.
167}
168
169
170Returns:
171 An object of the form:
172
173 { # An Operation resource, used to manage asynchronous API requests.
174 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
175 "clientOperationId": "A String", # [Output Only] Reserved for future use.
176 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
177 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
178 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
179 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
180 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
181 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
182 "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.
183 "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.
184 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
185 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
186 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
187 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
188 {
189 "message": "A String", # [Output Only] A human-readable description of the warning code.
190 "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.
191 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
192 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
193 {
194 "value": "A String", # [Output Only] A warning data value corresponding to the key.
195 "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).
196 },
197 ],
198 },
199 ],
200 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
201 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
202 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
203 "name": "A String", # [Output Only] Name of the resource.
204 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
205 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
206 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
207 {
208 "message": "A String", # [Output Only] An optional, human-readable error message.
209 "code": "A String", # [Output Only] The error type identifier for this error.
210 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
211 },
212 ],
213 },
214 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
215 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800216 "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 -0700217 }</pre>
218</div>
219
220<div class="method">
221 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
222 <pre>Retrieves aggregated list of instances.
223
224Args:
225 project: string, Project ID for this request. (required)
226 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
227
228You 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.
229
230Currently, only sorting by name or creationTimestamp desc is supported.
231 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.
232 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.
233 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.
234
235The 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.
236
237For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
238
239You 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.
240
241To 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.
242
243Returns:
244 An object of the form:
245
246 {
247 "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.
248 "items": { # [Output Only] A map of scoped instance lists.
249 "a_key": { # [Output Only] Name of the scope containing this set of instances.
250 "instances": [ # [Output Only] List of instances contained in this scope.
251 { # An Instance resource.
252 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
253 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
254 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
255 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
256 "a_key": "A String",
257 },
258 "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.
259 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
260 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
261 "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.
262 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
263 "A String",
264 ],
265 "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.
266 #
267 # To see the latest fingerprint, make get() request to the instance.
268 },
269 "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.
270 #
271 # To see the latest fingerprint, make get() request to the instance.
272 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
273 { # An instance-attached disk resource.
274 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
275 #
276 # 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.
277 #
278 # 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.
279 #
280 # 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.
281 #
282 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
283 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
284 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
285 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
286 #
287 # The key must meet the following requirements before you can provide it to Compute Engine:
288 # - The key is wrapped using a RSA public key certificate provided by Google.
289 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
290 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
291 },
292 "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.
293 #
294 # 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.
295 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
296 "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.
297 #
298 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
299 #
300 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
301 "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.
302 #
303 # 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.
304 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
305 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
306 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
307 #
308 # The key must meet the following requirements before you can provide it to Compute Engine:
309 # - The key is wrapped using a RSA public key certificate provided by Google.
310 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
311 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
312 },
313 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
314 "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:
315 #
316 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
317 #
318 # 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:
319 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
320 # - projects/project/zones/zone/diskTypes/diskType
321 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
322 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800323 "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 -0700324 #
325 # 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:
326 #
327 # projects/debian-cloud/global/images/family/debian-8
328 #
329 # Alternatively, use a specific version of a public operating system image:
330 #
331 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
332 #
333 # To create a disk with a private image that you created, specify the image name in the following format:
334 #
335 # global/images/my-private-image
336 #
337 # 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:
338 #
339 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800340 #
341 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700342 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
343 },
344 "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).
345 "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.
346 "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.
347 "licenses": [ # [Output Only] Any valid publicly visible licenses.
348 "A String",
349 ],
350 "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.
351 "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.
352 "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 -0800353 "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.
354 #
355 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
356 #
357 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700358 },
359 ],
360 "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.
361 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
362 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
363 "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.
364 "preemptible": True or False, # Whether the instance is preemptible.
365 "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.
366 },
367 "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:
368 #
369 # zones/us-central1-f/machineTypes/n1-standard-1
370 #
371 # 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):
372 #
373 # zones/zone/machineTypes/custom-CPUS-MEMORY
374 #
375 # For example: zones/us-central1-f/machineTypes/custom-4-5120
376 #
377 # For a full list of restrictions, read the Specifications for custom machine types.
378 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. 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.
379 { # A service account.
380 "scopes": [ # The list of scopes to be made available for this service account.
381 "A String",
382 ],
383 "email": "A String", # Email address of the service account.
384 },
385 ],
386 "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.
387 { # A network interface resource attached to an instance.
388 "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.
389 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
390 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
391 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
392 "name": "A String", # Name of this access configuration.
393 "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.
394 },
395 ],
396 "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.
397 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
398 "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:
399 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
400 # - regions/region/subnetworks/subnetwork
401 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
402 #
403 # global/networks/default
404 #
405 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
406 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
407 # - projects/project/global/networks/network
408 # - global/networks/default
409 },
410 ],
411 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
412 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
413 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
414 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
415 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
416 {
417 "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.
418 "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.
419 },
420 ],
421 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
422 "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.
423 },
424 },
425 ],
426 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
427 "message": "A String", # [Output Only] A human-readable description of the warning code.
428 "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.
429 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
430 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
431 {
432 "value": "A String", # [Output Only] A warning data value corresponding to the key.
433 "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).
434 },
435 ],
436 },
437 },
438 },
439 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.
440 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
441 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
442 }</pre>
443</div>
444
445<div class="method">
446 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
447 <pre>Retrieves the next page of results.
448
449Args:
450 previous_request: The request for the previous page. (required)
451 previous_response: The response from the request for the previous page. (required)
452
453Returns:
454 A request object that you can call 'execute()' on to request the next
455 page. Returns None if there are no more items in the collection.
456 </pre>
457</div>
458
459<div class="method">
460 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body)</code>
461 <pre>Attaches a Disk resource to an instance.
462
463Args:
464 project: string, Project ID for this request. (required)
465 zone: string, The name of the zone for this request. (required)
466 instance: string, The instance name for this request. (required)
467 body: object, The request body. (required)
468 The object takes the form of:
469
470{ # An instance-attached disk resource.
471 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
472 #
473 # 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.
474 #
475 # 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.
476 #
477 # 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.
478 #
479 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
480 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
481 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
482 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
483 #
484 # The key must meet the following requirements before you can provide it to Compute Engine:
485 # - The key is wrapped using a RSA public key certificate provided by Google.
486 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
487 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
488 },
489 "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.
490 #
491 # 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.
492 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
493 "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.
494 #
495 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
496 #
497 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
498 "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.
499 #
500 # 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.
501 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
502 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
503 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
504 #
505 # The key must meet the following requirements before you can provide it to Compute Engine:
506 # - The key is wrapped using a RSA public key certificate provided by Google.
507 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
508 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
509 },
510 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
511 "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:
512 #
513 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
514 #
515 # 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:
516 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
517 # - projects/project/zones/zone/diskTypes/diskType
518 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
519 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800520 "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 -0700521 #
522 # 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:
523 #
524 # projects/debian-cloud/global/images/family/debian-8
525 #
526 # Alternatively, use a specific version of a public operating system image:
527 #
528 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
529 #
530 # To create a disk with a private image that you created, specify the image name in the following format:
531 #
532 # global/images/my-private-image
533 #
534 # 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:
535 #
536 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800537 #
538 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700539 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
540 },
541 "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).
542 "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.
543 "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.
544 "licenses": [ # [Output Only] Any valid publicly visible licenses.
545 "A String",
546 ],
547 "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.
548 "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.
549 "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 -0800550 "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.
551 #
552 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
553 #
554 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700555}
556
557
558Returns:
559 An object of the form:
560
561 { # An Operation resource, used to manage asynchronous API requests.
562 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
563 "clientOperationId": "A String", # [Output Only] Reserved for future use.
564 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
565 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
566 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
567 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
568 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
569 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
570 "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.
571 "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.
572 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
573 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
574 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
575 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
576 {
577 "message": "A String", # [Output Only] A human-readable description of the warning code.
578 "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.
579 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
580 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
581 {
582 "value": "A String", # [Output Only] A warning data value corresponding to the key.
583 "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).
584 },
585 ],
586 },
587 ],
588 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
589 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
590 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
591 "name": "A String", # [Output Only] Name of the resource.
592 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
593 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
594 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
595 {
596 "message": "A String", # [Output Only] An optional, human-readable error message.
597 "code": "A String", # [Output Only] The error type identifier for this error.
598 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
599 },
600 ],
601 },
602 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
603 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800604 "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 -0700605 }</pre>
606</div>
607
608<div class="method">
609 <code class="details" id="delete">delete(project, zone, instance)</code>
610 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
611
612Args:
613 project: string, Project ID for this request. (required)
614 zone: string, The name of the zone for this request. (required)
615 instance: string, Name of the instance resource to delete. (required)
616
617Returns:
618 An object of the form:
619
620 { # An Operation resource, used to manage asynchronous API requests.
621 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
622 "clientOperationId": "A String", # [Output Only] Reserved for future use.
623 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
624 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
625 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
626 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
627 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
628 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
629 "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.
630 "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.
631 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
632 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
633 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
634 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
635 {
636 "message": "A String", # [Output Only] A human-readable description of the warning code.
637 "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.
638 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
639 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
640 {
641 "value": "A String", # [Output Only] A warning data value corresponding to the key.
642 "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).
643 },
644 ],
645 },
646 ],
647 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
648 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
649 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
650 "name": "A String", # [Output Only] Name of the resource.
651 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
652 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
653 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
654 {
655 "message": "A String", # [Output Only] An optional, human-readable error message.
656 "code": "A String", # [Output Only] The error type identifier for this error.
657 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
658 },
659 ],
660 },
661 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
662 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800663 "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 -0700664 }</pre>
665</div>
666
667<div class="method">
668 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
669 <pre>Deletes an access config from an instance's network interface.
670
671Args:
672 project: string, Project ID for this request. (required)
673 zone: string, The name of the zone for this request. (required)
674 instance: string, The instance name for this request. (required)
675 accessConfig: string, The name of the access config to delete. (required)
676 networkInterface: string, The name of the network interface. (required)
677
678Returns:
679 An object of the form:
680
681 { # An Operation resource, used to manage asynchronous API requests.
682 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
683 "clientOperationId": "A String", # [Output Only] Reserved for future use.
684 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
685 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
686 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
687 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
688 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
689 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
690 "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.
691 "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.
692 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
693 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
694 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
695 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
696 {
697 "message": "A String", # [Output Only] A human-readable description of the warning code.
698 "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.
699 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
700 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
701 {
702 "value": "A String", # [Output Only] A warning data value corresponding to the key.
703 "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).
704 },
705 ],
706 },
707 ],
708 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
709 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
710 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
711 "name": "A String", # [Output Only] Name of the resource.
712 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
713 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
714 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
715 {
716 "message": "A String", # [Output Only] An optional, human-readable error message.
717 "code": "A String", # [Output Only] The error type identifier for this error.
718 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
719 },
720 ],
721 },
722 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
723 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800724 "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 -0700725 }</pre>
726</div>
727
728<div class="method">
729 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
730 <pre>Detaches a disk from an instance.
731
732Args:
733 project: string, Project ID for this request. (required)
734 zone: string, The name of the zone for this request. (required)
735 instance: string, Instance name. (required)
736 deviceName: string, Disk device name to detach. (required)
737
738Returns:
739 An object of the form:
740
741 { # An Operation resource, used to manage asynchronous API requests.
742 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
743 "clientOperationId": "A String", # [Output Only] Reserved for future use.
744 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
745 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
746 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
747 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
748 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
749 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
750 "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.
751 "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.
752 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
753 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
754 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
755 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
756 {
757 "message": "A String", # [Output Only] A human-readable description of the warning code.
758 "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.
759 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
760 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
761 {
762 "value": "A String", # [Output Only] A warning data value corresponding to the key.
763 "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).
764 },
765 ],
766 },
767 ],
768 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
769 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
770 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
771 "name": "A String", # [Output Only] Name of the resource.
772 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
773 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
774 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
775 {
776 "message": "A String", # [Output Only] An optional, human-readable error message.
777 "code": "A String", # [Output Only] The error type identifier for this error.
778 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
779 },
780 ],
781 },
782 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
783 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800784 "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 -0700785 }</pre>
786</div>
787
788<div class="method">
789 <code class="details" id="get">get(project, zone, instance)</code>
790 <pre>Returns the specified Instance resource. Get a list of available instances by making a list() request.
791
792Args:
793 project: string, Project ID for this request. (required)
794 zone: string, The name of the zone for this request. (required)
795 instance: string, Name of the instance resource to return. (required)
796
797Returns:
798 An object of the form:
799
800 { # An Instance resource.
801 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
802 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
803 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
804 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
805 "a_key": "A String",
806 },
807 "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.
808 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
809 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
810 "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.
811 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
812 "A String",
813 ],
814 "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.
815 #
816 # To see the latest fingerprint, make get() request to the instance.
817 },
818 "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.
819 #
820 # To see the latest fingerprint, make get() request to the instance.
821 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
822 { # An instance-attached disk resource.
823 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
824 #
825 # 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.
826 #
827 # 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.
828 #
829 # 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.
830 #
831 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
832 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
833 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
834 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
835 #
836 # The key must meet the following requirements before you can provide it to Compute Engine:
837 # - The key is wrapped using a RSA public key certificate provided by Google.
838 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
839 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
840 },
841 "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.
842 #
843 # 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.
844 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
845 "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.
846 #
847 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
848 #
849 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
850 "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.
851 #
852 # 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.
853 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
854 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
855 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
856 #
857 # The key must meet the following requirements before you can provide it to Compute Engine:
858 # - The key is wrapped using a RSA public key certificate provided by Google.
859 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
860 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
861 },
862 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
863 "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:
864 #
865 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
866 #
867 # 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:
868 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
869 # - projects/project/zones/zone/diskTypes/diskType
870 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
871 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800872 "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 -0700873 #
874 # 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:
875 #
876 # projects/debian-cloud/global/images/family/debian-8
877 #
878 # Alternatively, use a specific version of a public operating system image:
879 #
880 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
881 #
882 # To create a disk with a private image that you created, specify the image name in the following format:
883 #
884 # global/images/my-private-image
885 #
886 # 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:
887 #
888 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800889 #
890 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700891 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
892 },
893 "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).
894 "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.
895 "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.
896 "licenses": [ # [Output Only] Any valid publicly visible licenses.
897 "A String",
898 ],
899 "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.
900 "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.
901 "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 -0800902 "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.
903 #
904 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
905 #
906 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700907 },
908 ],
909 "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.
910 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
911 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
912 "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.
913 "preemptible": True or False, # Whether the instance is preemptible.
914 "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.
915 },
916 "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:
917 #
918 # zones/us-central1-f/machineTypes/n1-standard-1
919 #
920 # 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):
921 #
922 # zones/zone/machineTypes/custom-CPUS-MEMORY
923 #
924 # For example: zones/us-central1-f/machineTypes/custom-4-5120
925 #
926 # For a full list of restrictions, read the Specifications for custom machine types.
927 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. 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.
928 { # A service account.
929 "scopes": [ # The list of scopes to be made available for this service account.
930 "A String",
931 ],
932 "email": "A String", # Email address of the service account.
933 },
934 ],
935 "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.
936 { # A network interface resource attached to an instance.
937 "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.
938 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
939 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
940 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
941 "name": "A String", # Name of this access configuration.
942 "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.
943 },
944 ],
945 "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.
946 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
947 "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:
948 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
949 # - regions/region/subnetworks/subnetwork
950 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
951 #
952 # global/networks/default
953 #
954 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
955 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
956 # - projects/project/global/networks/network
957 # - global/networks/default
958 },
959 ],
960 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
961 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
962 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
963 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
964 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
965 {
966 "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.
967 "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.
968 },
969 ],
970 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
971 "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.
972 },
973 }</pre>
974</div>
975
976<div class="method">
977 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</code>
978 <pre>Returns the specified instance's serial port output.
979
980Args:
981 project: string, Project ID for this request. (required)
982 zone: string, The name of the zone for this request. (required)
983 instance: string, Name of the instance scoping this request. (required)
984 start: string, For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value that was returned in the previous call.
985 port: integer, Specifies which COM or serial port to retrieve data from.
986
987Returns:
988 An object of the form:
989
990 { # An instance's serial console output.
991 "start": "A String", # [Output Only] 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.
992 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
993 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
994 "contents": "A String", # [Output Only] The contents of the console output.
995 "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.
996 }</pre>
997</div>
998
999<div class="method">
1000 <code class="details" id="insert">insert(project, zone, body)</code>
1001 <pre>Creates an instance resource in the specified project using the data included in the request.
1002
1003Args:
1004 project: string, Project ID for this request. (required)
1005 zone: string, The name of the zone for this request. (required)
1006 body: object, The request body. (required)
1007 The object takes the form of:
1008
1009{ # An Instance resource.
1010 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1011 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1012 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1013 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
1014 "a_key": "A String",
1015 },
1016 "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.
1017 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1018 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1019 "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.
1020 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1021 "A String",
1022 ],
1023 "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.
1024 #
1025 # To see the latest fingerprint, make get() request to the instance.
1026 },
1027 "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.
1028 #
1029 # To see the latest fingerprint, make get() request to the instance.
1030 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1031 { # An instance-attached disk resource.
1032 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1033 #
1034 # 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.
1035 #
1036 # 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.
1037 #
1038 # 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.
1039 #
1040 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1041 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1042 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1043 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1044 #
1045 # The key must meet the following requirements before you can provide it to Compute Engine:
1046 # - The key is wrapped using a RSA public key certificate provided by Google.
1047 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1048 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1049 },
1050 "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.
1051 #
1052 # 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.
1053 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1054 "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.
1055 #
1056 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1057 #
1058 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1059 "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.
1060 #
1061 # 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.
1062 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1063 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1064 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1065 #
1066 # The key must meet the following requirements before you can provide it to Compute Engine:
1067 # - The key is wrapped using a RSA public key certificate provided by Google.
1068 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1069 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1070 },
1071 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1072 "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:
1073 #
1074 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1075 #
1076 # 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:
1077 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1078 # - projects/project/zones/zone/diskTypes/diskType
1079 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1080 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001081 "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 -07001082 #
1083 # 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:
1084 #
1085 # projects/debian-cloud/global/images/family/debian-8
1086 #
1087 # Alternatively, use a specific version of a public operating system image:
1088 #
1089 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1090 #
1091 # To create a disk with a private image that you created, specify the image name in the following format:
1092 #
1093 # global/images/my-private-image
1094 #
1095 # 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:
1096 #
1097 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001098 #
1099 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001100 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1101 },
1102 "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).
1103 "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.
1104 "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.
1105 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1106 "A String",
1107 ],
1108 "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.
1109 "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.
1110 "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 -08001111 "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.
1112 #
1113 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1114 #
1115 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001116 },
1117 ],
1118 "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.
1119 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1120 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1121 "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.
1122 "preemptible": True or False, # Whether the instance is preemptible.
1123 "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.
1124 },
1125 "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:
1126 #
1127 # zones/us-central1-f/machineTypes/n1-standard-1
1128 #
1129 # 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):
1130 #
1131 # zones/zone/machineTypes/custom-CPUS-MEMORY
1132 #
1133 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1134 #
1135 # For a full list of restrictions, read the Specifications for custom machine types.
1136 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. 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.
1137 { # A service account.
1138 "scopes": [ # The list of scopes to be made available for this service account.
1139 "A String",
1140 ],
1141 "email": "A String", # Email address of the service account.
1142 },
1143 ],
1144 "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.
1145 { # A network interface resource attached to an instance.
1146 "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.
1147 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1148 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1149 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1150 "name": "A String", # Name of this access configuration.
1151 "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.
1152 },
1153 ],
1154 "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.
1155 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1156 "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:
1157 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1158 # - regions/region/subnetworks/subnetwork
1159 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
1160 #
1161 # global/networks/default
1162 #
1163 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1164 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1165 # - projects/project/global/networks/network
1166 # - global/networks/default
1167 },
1168 ],
1169 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1170 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1171 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1172 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1173 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1174 {
1175 "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.
1176 "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.
1177 },
1178 ],
1179 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1180 "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.
1181 },
1182}
1183
1184
1185Returns:
1186 An object of the form:
1187
1188 { # An Operation resource, used to manage asynchronous API requests.
1189 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1190 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1191 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1192 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1193 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1194 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1195 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1196 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1197 "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.
1198 "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.
1199 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1200 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1201 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1202 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1203 {
1204 "message": "A String", # [Output Only] A human-readable description of the warning code.
1205 "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.
1206 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1207 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1208 {
1209 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1210 "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).
1211 },
1212 ],
1213 },
1214 ],
1215 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1216 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1217 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1218 "name": "A String", # [Output Only] Name of the resource.
1219 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1220 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1221 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1222 {
1223 "message": "A String", # [Output Only] An optional, human-readable error message.
1224 "code": "A String", # [Output Only] The error type identifier for this error.
1225 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1226 },
1227 ],
1228 },
1229 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1230 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001231 "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 -07001232 }</pre>
1233</div>
1234
1235<div class="method">
1236 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1237 <pre>Retrieves the list of instances contained within the specified zone.
1238
1239Args:
1240 project: string, Project ID for this request. (required)
1241 zone: string, The name of the zone for this request. (required)
1242 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1243
1244You 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.
1245
1246Currently, only sorting by name or creationTimestamp desc is supported.
1247 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.
1248 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.
1249 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.
1250
1251The 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.
1252
1253For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
1254
1255You 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.
1256
1257To 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.
1258
1259Returns:
1260 An object of the form:
1261
1262 { # Contains a list of instances.
1263 "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.
1264 "items": [ # [Output Only] A list of instances.
1265 { # An Instance resource.
1266 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1267 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1268 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1269 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
1270 "a_key": "A String",
1271 },
1272 "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.
1273 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1274 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1275 "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.
1276 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1277 "A String",
1278 ],
1279 "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.
1280 #
1281 # To see the latest fingerprint, make get() request to the instance.
1282 },
1283 "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.
1284 #
1285 # To see the latest fingerprint, make get() request to the instance.
1286 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1287 { # An instance-attached disk resource.
1288 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1289 #
1290 # 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.
1291 #
1292 # 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.
1293 #
1294 # 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.
1295 #
1296 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1297 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1298 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1299 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1300 #
1301 # The key must meet the following requirements before you can provide it to Compute Engine:
1302 # - The key is wrapped using a RSA public key certificate provided by Google.
1303 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1304 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1305 },
1306 "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.
1307 #
1308 # 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.
1309 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1310 "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.
1311 #
1312 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1313 #
1314 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1315 "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.
1316 #
1317 # 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.
1318 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1319 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1320 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1321 #
1322 # The key must meet the following requirements before you can provide it to Compute Engine:
1323 # - The key is wrapped using a RSA public key certificate provided by Google.
1324 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1325 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1326 },
1327 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1328 "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:
1329 #
1330 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1331 #
1332 # 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:
1333 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1334 # - projects/project/zones/zone/diskTypes/diskType
1335 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1336 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001337 "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 -07001338 #
1339 # 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:
1340 #
1341 # projects/debian-cloud/global/images/family/debian-8
1342 #
1343 # Alternatively, use a specific version of a public operating system image:
1344 #
1345 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1346 #
1347 # To create a disk with a private image that you created, specify the image name in the following format:
1348 #
1349 # global/images/my-private-image
1350 #
1351 # 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:
1352 #
1353 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001354 #
1355 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001356 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1357 },
1358 "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).
1359 "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.
1360 "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.
1361 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1362 "A String",
1363 ],
1364 "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.
1365 "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.
1366 "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 -08001367 "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.
1368 #
1369 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1370 #
1371 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001372 },
1373 ],
1374 "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.
1375 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1376 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1377 "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.
1378 "preemptible": True or False, # Whether the instance is preemptible.
1379 "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.
1380 },
1381 "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:
1382 #
1383 # zones/us-central1-f/machineTypes/n1-standard-1
1384 #
1385 # 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):
1386 #
1387 # zones/zone/machineTypes/custom-CPUS-MEMORY
1388 #
1389 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1390 #
1391 # For a full list of restrictions, read the Specifications for custom machine types.
1392 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. 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.
1393 { # A service account.
1394 "scopes": [ # The list of scopes to be made available for this service account.
1395 "A String",
1396 ],
1397 "email": "A String", # Email address of the service account.
1398 },
1399 ],
1400 "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.
1401 { # A network interface resource attached to an instance.
1402 "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.
1403 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1404 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1405 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1406 "name": "A String", # Name of this access configuration.
1407 "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.
1408 },
1409 ],
1410 "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.
1411 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1412 "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:
1413 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1414 # - regions/region/subnetworks/subnetwork
1415 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
1416 #
1417 # global/networks/default
1418 #
1419 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1420 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1421 # - projects/project/global/networks/network
1422 # - global/networks/default
1423 },
1424 ],
1425 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1426 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1427 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1428 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1429 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1430 {
1431 "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.
1432 "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.
1433 },
1434 ],
1435 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1436 "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.
1437 },
1438 },
1439 ],
1440 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
1441 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1442 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1443 }</pre>
1444</div>
1445
1446<div class="method">
1447 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1448 <pre>Retrieves the next page of results.
1449
1450Args:
1451 previous_request: The request for the previous page. (required)
1452 previous_response: The response from the request for the previous page. (required)
1453
1454Returns:
1455 A request object that you can call 'execute()' on to request the next
1456 page. Returns None if there are no more items in the collection.
1457 </pre>
1458</div>
1459
1460<div class="method">
1461 <code class="details" id="reset">reset(project, zone, instance)</code>
1462 <pre>Performs a hard reset on the instance.
1463
1464Args:
1465 project: string, Project ID for this request. (required)
1466 zone: string, The name of the zone for this request. (required)
1467 instance: string, Name of the instance scoping this request. (required)
1468
1469Returns:
1470 An object of the form:
1471
1472 { # An Operation resource, used to manage asynchronous API requests.
1473 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1474 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1475 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1476 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1477 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1478 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1479 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1480 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1481 "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.
1482 "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.
1483 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1484 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1485 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1486 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1487 {
1488 "message": "A String", # [Output Only] A human-readable description of the warning code.
1489 "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.
1490 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1491 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1492 {
1493 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1494 "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).
1495 },
1496 ],
1497 },
1498 ],
1499 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1500 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1501 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1502 "name": "A String", # [Output Only] Name of the resource.
1503 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1504 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1505 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1506 {
1507 "message": "A String", # [Output Only] An optional, human-readable error message.
1508 "code": "A String", # [Output Only] The error type identifier for this error.
1509 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1510 },
1511 ],
1512 },
1513 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1514 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001515 "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 -07001516 }</pre>
1517</div>
1518
1519<div class="method">
1520 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
1521 <pre>Sets the auto-delete flag for a disk attached to an instance.
1522
1523Args:
1524 project: string, Project ID for this request. (required)
1525 zone: string, The name of the zone for this request. (required)
1526 instance: string, The instance name. (required)
1527 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
1528 deviceName: string, The device name of the disk to modify. (required)
1529
1530Returns:
1531 An object of the form:
1532
1533 { # An Operation resource, used to manage asynchronous API requests.
1534 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1535 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1536 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1537 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1538 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1539 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1540 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1541 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1542 "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.
1543 "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.
1544 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1545 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1546 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1547 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1548 {
1549 "message": "A String", # [Output Only] A human-readable description of the warning code.
1550 "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.
1551 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1552 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1553 {
1554 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1555 "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).
1556 },
1557 ],
1558 },
1559 ],
1560 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1561 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1562 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1563 "name": "A String", # [Output Only] Name of the resource.
1564 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1565 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1566 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1567 {
1568 "message": "A String", # [Output Only] An optional, human-readable error message.
1569 "code": "A String", # [Output Only] The error type identifier for this error.
1570 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1571 },
1572 ],
1573 },
1574 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1575 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001576 "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 -07001577 }</pre>
1578</div>
1579
1580<div class="method">
1581 <code class="details" id="setLabels">setLabels(project, zone, instance, body)</code>
1582 <pre>Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.
1583
1584Args:
1585 project: string, Project ID for this request. (required)
1586 zone: string, The name of the zone for this request. (required)
1587 instance: string, Name of the instance scoping this request. (required)
1588 body: object, The request body. (required)
1589 The object takes the form of:
1590
1591{
1592 "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.
1593 "labels": { # A list of labels to apply for this instance. Changing instance labels will also change the instance tags.
1594 #
1595 # Each label key & value must 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. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
1596 "a_key": "A String",
1597 },
1598 }
1599
1600
1601Returns:
1602 An object of the form:
1603
1604 { # An Operation resource, used to manage asynchronous API requests.
1605 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1606 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1607 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1608 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1609 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1610 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1611 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1612 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1613 "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.
1614 "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.
1615 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1616 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1617 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1618 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1619 {
1620 "message": "A String", # [Output Only] A human-readable description of the warning code.
1621 "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.
1622 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1623 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1624 {
1625 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1626 "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).
1627 },
1628 ],
1629 },
1630 ],
1631 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1632 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1633 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1634 "name": "A String", # [Output Only] Name of the resource.
1635 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1636 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1637 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1638 {
1639 "message": "A String", # [Output Only] An optional, human-readable error message.
1640 "code": "A String", # [Output Only] The error type identifier for this error.
1641 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1642 },
1643 ],
1644 },
1645 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1646 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001647 "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 -07001648 }</pre>
1649</div>
1650
1651<div class="method">
1652 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
1653 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
1654
1655Args:
1656 project: string, Project ID for this request. (required)
1657 zone: string, The name of the zone for this request. (required)
1658 instance: string, Name of the instance scoping this request. (required)
1659 body: object, The request body. (required)
1660 The object takes the form of:
1661
1662{
1663 "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
1664 }
1665
1666
1667Returns:
1668 An object of the form:
1669
1670 { # An Operation resource, used to manage asynchronous API requests.
1671 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1672 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1673 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1674 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1675 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1676 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1677 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1678 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1679 "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.
1680 "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.
1681 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1682 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1683 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1684 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1685 {
1686 "message": "A String", # [Output Only] A human-readable description of the warning code.
1687 "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.
1688 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1689 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1690 {
1691 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1692 "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).
1693 },
1694 ],
1695 },
1696 ],
1697 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1698 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1699 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1700 "name": "A String", # [Output Only] Name of the resource.
1701 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1702 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1703 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1704 {
1705 "message": "A String", # [Output Only] An optional, human-readable error message.
1706 "code": "A String", # [Output Only] The error type identifier for this error.
1707 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1708 },
1709 ],
1710 },
1711 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1712 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001713 "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 -07001714 }</pre>
1715</div>
1716
1717<div class="method">
1718 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
1719 <pre>Sets metadata for the specified instance to the data included in the request.
1720
1721Args:
1722 project: string, Project ID for this request. (required)
1723 zone: string, The name of the zone for this request. (required)
1724 instance: string, Name of the instance scoping this request. (required)
1725 body: object, The request body. (required)
1726 The object takes the form of:
1727
1728{ # A metadata key/value entry.
1729 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1730 {
1731 "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.
1732 "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.
1733 },
1734 ],
1735 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1736 "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.
1737}
1738
1739
1740Returns:
1741 An object of the form:
1742
1743 { # An Operation resource, used to manage asynchronous API requests.
1744 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1745 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1746 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1747 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1748 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1749 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1750 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1751 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1752 "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.
1753 "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.
1754 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1755 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1756 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1757 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1758 {
1759 "message": "A String", # [Output Only] A human-readable description of the warning code.
1760 "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.
1761 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1762 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1763 {
1764 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1765 "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).
1766 },
1767 ],
1768 },
1769 ],
1770 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1771 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1772 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1773 "name": "A String", # [Output Only] Name of the resource.
1774 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1775 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1776 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1777 {
1778 "message": "A String", # [Output Only] An optional, human-readable error message.
1779 "code": "A String", # [Output Only] The error type identifier for this error.
1780 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1781 },
1782 ],
1783 },
1784 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1785 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001786 "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 -07001787 }</pre>
1788</div>
1789
1790<div class="method">
1791 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
1792 <pre>Sets an instance's scheduling options.
1793
1794Args:
1795 project: string, Project ID for this request. (required)
1796 zone: string, The name of the zone for this request. (required)
1797 instance: string, Instance name. (required)
1798 body: object, The request body. (required)
1799 The object takes the form of:
1800
1801{ # Sets the scheduling options for an Instance.
1802 "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.
1803 "preemptible": True or False, # Whether the instance is preemptible.
1804 "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.
1805}
1806
1807
1808Returns:
1809 An object of the form:
1810
1811 { # An Operation resource, used to manage asynchronous API requests.
1812 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1813 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1814 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1815 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1816 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1817 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1818 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1819 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1820 "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.
1821 "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.
1822 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1823 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1824 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1825 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1826 {
1827 "message": "A String", # [Output Only] A human-readable description of the warning code.
1828 "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.
1829 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1830 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1831 {
1832 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1833 "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).
1834 },
1835 ],
1836 },
1837 ],
1838 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1839 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1840 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1841 "name": "A String", # [Output Only] Name of the resource.
1842 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1843 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1844 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1845 {
1846 "message": "A String", # [Output Only] An optional, human-readable error message.
1847 "code": "A String", # [Output Only] The error type identifier for this error.
1848 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1849 },
1850 ],
1851 },
1852 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1853 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001854 "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.
1855 }</pre>
1856</div>
1857
1858<div class="method">
1859 <code class="details" id="setServiceAccount">setServiceAccount(project, zone, instance, body)</code>
1860 <pre>Sets the service account on the instance.
1861
1862Args:
1863 project: string, Project ID for this request. (required)
1864 zone: string, The name of the zone for this request. (required)
1865 instance: string, Name of the instance resource to start. (required)
1866 body: object, The request body. (required)
1867 The object takes the form of:
1868
1869{
1870 "scopes": [ # The list of scopes to be made available for this service account.
1871 "A String",
1872 ],
1873 "email": "A String", # Email address of the service account.
1874 }
1875
1876
1877Returns:
1878 An object of the form:
1879
1880 { # An Operation resource, used to manage asynchronous API requests.
1881 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1882 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1883 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1884 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1885 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1886 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1887 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1888 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1889 "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.
1890 "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.
1891 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1892 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1893 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1894 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1895 {
1896 "message": "A String", # [Output Only] A human-readable description of the warning code.
1897 "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.
1898 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1899 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1900 {
1901 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1902 "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).
1903 },
1904 ],
1905 },
1906 ],
1907 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1908 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1909 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1910 "name": "A String", # [Output Only] Name of the resource.
1911 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1912 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1913 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1914 {
1915 "message": "A String", # [Output Only] An optional, human-readable error message.
1916 "code": "A String", # [Output Only] The error type identifier for this error.
1917 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1918 },
1919 ],
1920 },
1921 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1922 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1923 "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 -07001924 }</pre>
1925</div>
1926
1927<div class="method">
1928 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
1929 <pre>Sets tags for the specified instance to the data included in the request.
1930
1931Args:
1932 project: string, Project ID for this request. (required)
1933 zone: string, The name of the zone for this request. (required)
1934 instance: string, Name of the instance scoping this request. (required)
1935 body: object, The request body. (required)
1936 The object takes the form of:
1937
1938{ # A set of instance tags.
1939 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1940 "A String",
1941 ],
1942 "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.
1943 #
1944 # To see the latest fingerprint, make get() request to the instance.
1945}
1946
1947
1948Returns:
1949 An object of the form:
1950
1951 { # An Operation resource, used to manage asynchronous API requests.
1952 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1953 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1954 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1955 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1956 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1957 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1958 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1959 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1960 "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.
1961 "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.
1962 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1963 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1964 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1965 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1966 {
1967 "message": "A String", # [Output Only] A human-readable description of the warning code.
1968 "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.
1969 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1970 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1971 {
1972 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1973 "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).
1974 },
1975 ],
1976 },
1977 ],
1978 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1979 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1980 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1981 "name": "A String", # [Output Only] Name of the resource.
1982 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1983 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1984 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1985 {
1986 "message": "A String", # [Output Only] An optional, human-readable error message.
1987 "code": "A String", # [Output Only] The error type identifier for this error.
1988 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1989 },
1990 ],
1991 },
1992 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1993 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001994 "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 -07001995 }</pre>
1996</div>
1997
1998<div class="method">
1999 <code class="details" id="start">start(project, zone, instance)</code>
2000 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2001
2002Args:
2003 project: string, Project ID for this request. (required)
2004 zone: string, The name of the zone for this request. (required)
2005 instance: string, Name of the instance resource to start. (required)
2006
2007Returns:
2008 An object of the form:
2009
2010 { # An Operation resource, used to manage asynchronous API requests.
2011 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2012 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2013 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2014 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2015 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2016 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2017 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2018 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2019 "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.
2020 "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.
2021 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2022 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2023 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2024 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2025 {
2026 "message": "A String", # [Output Only] A human-readable description of the warning code.
2027 "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.
2028 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2029 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2030 {
2031 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2032 "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).
2033 },
2034 ],
2035 },
2036 ],
2037 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2038 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2039 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2040 "name": "A String", # [Output Only] Name of the resource.
2041 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2042 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2043 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2044 {
2045 "message": "A String", # [Output Only] An optional, human-readable error message.
2046 "code": "A String", # [Output Only] The error type identifier for this error.
2047 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2048 },
2049 ],
2050 },
2051 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2052 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002053 "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 -07002054 }</pre>
2055</div>
2056
2057<div class="method">
2058 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</code>
2059 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2060
2061Args:
2062 project: string, Project ID for this request. (required)
2063 zone: string, The name of the zone for this request. (required)
2064 instance: string, Name of the instance resource to start. (required)
2065 body: object, The request body. (required)
2066 The object takes the form of:
2067
2068{
2069 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key.
2070 #
2071 # In order to start the instance, the disk url and its corresponding key must be provided.
2072 #
2073 # If the disk is not protected with a customer-supplied encryption key it should not be specified.
2074 {
2075 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key.
2076 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2077 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2078 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2079 #
2080 # The key must meet the following requirements before you can provide it to Compute Engine:
2081 # - The key is wrapped using a RSA public key certificate provided by Google.
2082 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2083 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2084 },
2085 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
2086 },
2087 ],
2088 }
2089
2090
2091Returns:
2092 An object of the form:
2093
2094 { # An Operation resource, used to manage asynchronous API requests.
2095 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2096 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2097 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2098 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2099 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2100 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2101 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2102 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2103 "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.
2104 "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.
2105 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2106 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2107 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2108 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2109 {
2110 "message": "A String", # [Output Only] A human-readable description of the warning code.
2111 "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.
2112 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2113 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2114 {
2115 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2116 "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).
2117 },
2118 ],
2119 },
2120 ],
2121 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2122 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2123 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2124 "name": "A String", # [Output Only] Name of the resource.
2125 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2126 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2127 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2128 {
2129 "message": "A String", # [Output Only] An optional, human-readable error message.
2130 "code": "A String", # [Output Only] The error type identifier for this error.
2131 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2132 },
2133 ],
2134 },
2135 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2136 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002137 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002138 }</pre>
2139</div>
2140
2141<div class="method">
2142 <code class="details" id="stop">stop(project, zone, instance)</code>
2143 <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.
2144
2145Args:
2146 project: string, Project ID for this request. (required)
2147 zone: string, The name of the zone for this request. (required)
2148 instance: string, Name of the instance resource to stop. (required)
2149
2150Returns:
2151 An object of the form:
2152
2153 { # An Operation resource, used to manage asynchronous API requests.
2154 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2155 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2156 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2157 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2158 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2159 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2160 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2161 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2162 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
2163 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
2164 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2165 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2166 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2167 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2168 {
2169 "message": "A String", # [Output Only] A human-readable description of the warning code.
2170 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2171 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2172 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2173 {
2174 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2175 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
2176 },
2177 ],
2178 },
2179 ],
2180 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2181 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2182 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2183 "name": "A String", # [Output Only] Name of the resource.
2184 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2185 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2186 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2187 {
2188 "message": "A String", # [Output Only] An optional, human-readable error message.
2189 "code": "A String", # [Output Only] The error type identifier for this error.
2190 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2191 },
2192 ],
2193 },
2194 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2195 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002196 "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 -07002197 }</pre>
2198</div>
2199
2200<div class="method">
2201 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
2202 <pre>Returns permissions that a caller has on the specified resource.
2203
2204Args:
2205 project: string, Project ID for this request. (required)
2206 zone: string, The name of the zone for this request. (required)
2207 resource: string, Name of the resource for this request. (required)
2208 body: object, The request body. (required)
2209 The object takes the form of:
2210
2211{
2212 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2213 "A String",
2214 ],
2215 }
2216
2217
2218Returns:
2219 An object of the form:
2220
2221 {
2222 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2223 "A String",
2224 ],
2225 }</pre>
2226</div>
2227
2228</body></html>